I have an external SDK that I need to set the path to in my ant file. Since this could be different in each of our Dev's environments we have it set via environment variable. In the ant file I have done the following:
<project name="myProj">
<property environment="env"/>
<property name ="MY_SDK" value="${env.MY_SDK}"/>
.
.
.
<target name="compile-code">
<echo>
1: ${env.MY_SDK}
2: ${env}
</echo>
<javac includeantruntime="false" destdir="${CLASSES}" fork="true" debug="on">
<classpath>
<pathelement path="${MY_SDK}" />
</classpath>
</javac>
</target>
When I run "ant -f build_java.xml" however this is the output I get for my echo:
compile-java:
[echo]
[echo] 1: ${env.MY_SDK}
[echo] 2: ${env}
[echo]
I also get a bunch of errors not finding anything from my SDK.
I have ensured that my environment variable is set correctly. If I copy it exactly from my .bash_profile and pasted it into the "VALUE" for my property, it works great. So I have a feeling it has something to do with my environment property.
I am somewhat new to ANT so any advice on what I could be doing wrong here would be greatly appreciated. Thanks.