summaryrefslogtreecommitdiff
path: root/plugins/ant/jps-plugin
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-05-01 12:55:43 -0700
committerTor Norbye <tnorbye@google.com>2013-05-01 12:55:43 -0700
commit8fb0021093e7d978cc06043ba4c06b0a47778294 (patch)
treeb95f5f920574415ae49b26ad6abac86eb6d7b38d /plugins/ant/jps-plugin
parentb17587c84879dd2ea42495f1fbdadbc806b9475b (diff)
downloadidea-8fb0021093e7d978cc06043ba4c06b0a47778294.tar.gz
Snapshot dddb119296e7ee16fa8180784610b89b89112ebb from master branch of git://git.jetbrains.org/idea/community.git
Change-Id: I5fe892d3e4d06009445cc2270aa90bb57dea9d39
Diffstat (limited to 'plugins/ant/jps-plugin')
-rw-r--r--plugins/ant/jps-plugin/src/org/jetbrains/jps/ant/model/JpsAntExtensionService.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/plugins/ant/jps-plugin/src/org/jetbrains/jps/ant/model/JpsAntExtensionService.java b/plugins/ant/jps-plugin/src/org/jetbrains/jps/ant/model/JpsAntExtensionService.java
index d39f6ff79c28..61a7c99d73b7 100644
--- a/plugins/ant/jps-plugin/src/org/jetbrains/jps/ant/model/JpsAntExtensionService.java
+++ b/plugins/ant/jps-plugin/src/org/jetbrains/jps/ant/model/JpsAntExtensionService.java
@@ -37,6 +37,7 @@ import java.util.Collections;
* @author nik
*/
public class JpsAntExtensionService {
+ public static final String BUNDLED_ANT_PATH_PROPERTY = "jps.bundled.ant.path";
private static final Logger LOG = Logger.getInstance(JpsAntExtensionService.class);
@Nullable
@@ -69,17 +70,24 @@ public class JpsAntExtensionService {
@Nullable
private static JpsAntInstallation getBundledAntInstallation() {
- final String appHome = PathManager.getHomePath();
- if (appHome == null) {
- LOG.debug("IDEA home path is null, bundled Ant won't be configured");
- return null;
+ String antPath = System.getProperty(BUNDLED_ANT_PATH_PROPERTY);
+ File antHome;
+ if (antPath != null) {
+ antHome = new File(antPath);
}
+ else {
+ final String appHome = PathManager.getHomePath();
+ if (appHome == null) {
+ LOG.debug("idea.home.path and " + BUNDLED_ANT_PATH_PROPERTY + " aren't specified, bundled Ant won't be configured");
+ return null;
+ }
- File antHome = new File(appHome, "lib" + File.separator + "ant");
- if (!antHome.exists()) {
- File communityAntHome = new File(appHome, "community" + File.separator + "lib" + File.separator + "ant");
- if (communityAntHome.exists()) {
- antHome = communityAntHome;
+ antHome = new File(appHome, "lib" + File.separator + "ant");
+ if (!antHome.exists()) {
+ File communityAntHome = new File(appHome, "community" + File.separator + "lib" + File.separator + "ant");
+ if (communityAntHome.exists()) {
+ antHome = communityAntHome;
+ }
}
}
if (!antHome.exists()) {