diff options
author | Brent Eagles <brent@zeroc.com> | 2006-11-20 18:02:53 +0000 |
---|---|---|
committer | Brent Eagles <brent@zeroc.com> | 2006-11-20 18:02:53 +0000 |
commit | 287d28f8d3aebd19ceea9f7c4d6f0a486138d422 (patch) | |
tree | c6f2ec71b30f70898660e035f90f48305679e02b /java/ant/SliceTask.java | |
parent | Added cancel (diff) | |
download | ice-287d28f8d3aebd19ceea9f7c4d6f0a486138d422.tar.bz2 ice-287d28f8d3aebd19ceea9f7c4d6f0a486138d422.tar.xz ice-287d28f8d3aebd19ceea9f7c4d6f0a486138d422.zip |
ant tasks check the ice.dir property that may be set in the XML
Diffstat (limited to 'java/ant/SliceTask.java')
-rw-r--r-- | java/ant/SliceTask.java | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/java/ant/SliceTask.java b/java/ant/SliceTask.java index de281433c1a..53db1152975 100644 --- a/java/ant/SliceTask.java +++ b/java/ant/SliceTask.java @@ -61,21 +61,6 @@ public class SliceTask extends org.apache.tools.ant.Task _caseSensitive = false; _ice = false; _includePath = null; - - // - // Check for the presence of the ICE_HOME environment variable. - // - java.util.Vector env = Execute.getProcEnvironment(); - java.util.Enumeration e = env.elements(); - while(e.hasMoreElements()) - { - String entry = (String)e.nextElement(); - if(entry.startsWith("ICE_HOME=")) - { - _iceHome = entry.substring(entry.indexOf('=') + 1); - break; - } - } } public void @@ -323,6 +308,44 @@ public class SliceTask extends org.apache.tools.ant.Task return dependencies; } + + protected String + getIceHome() + { + // + // _iceHome used to be set in the constructor. It appears that the + // current project isn't available at that point and consequently, the + // properties that allow us to find the ice translators based on the + // contents the 'ice.dir' property in the ant projects aren't available + // yet. + // + if(_iceHome == null) + { + // + // Check for the presence of the ICE_HOME environment variable. + // + java.util.Vector env = Execute.getProcEnvironment(); + java.util.Enumeration e = env.elements(); + while(e.hasMoreElements()) + { + String entry = (String)e.nextElement(); + if(entry.startsWith("ICE_HOME=")) + { + _iceHome = entry.substring(entry.indexOf('=') + 1); + break; + } + } + + if(_iceHome == null) + { + if(getProject().getProperties().containsKey("ice.dir")) + { + _iceHome = (String)getProject().getProperties().get("ice.dir"); + } + } + } + return _iceHome; + } // // A slice dependency. @@ -380,5 +403,5 @@ public class SliceTask extends org.apache.tools.ant.Task protected java.util.List _fileSets = new java.util.LinkedList(); protected java.util.List _defines = new java.util.LinkedList(); protected java.util.List _meta = new java.util.LinkedList(); - protected String _iceHome; + private String _iceHome; } |