Ant path/pathelement not expanding properties correctly

Posted by Jonas Byström on Stack Overflow See other posts from Stack Overflow or by Jonas Byström
Published on 2010-04-26T10:08:10Z Indexed on 2010/05/21 7:50 UTC
Read the original article Hit count: 232

Filed under:
|
|
|
|

My property gwt.sdk expands just fine everywhere else, but not inside a path/pathelement:

<target name="setup.gwtenv">
  <property environment="env"/>
  <condition property="gwt.sdk" value="${env.GWT_SDK}"> 
    <isset property="env.GWT_SDK" />
  </condition>
  <property name="gwt.sdk" value="/usr/local/gwt" /> <!-- Default value. -->
</target>

<path id="project.class.path">
  <pathelement location="${gwt.sdk}/gwt-user.jar"/>
</path>

<target name="libs" depends="setup.gwtenv" description="Copy libs to WEB-INF/lib">
</target>

<target name="javac" depends="libs" description="Compile java source">
  <javac srcdir="src" includes="**" encoding="utf-8"
      destdir="war/WEB-INF/classes"
      source="1.5" target="1.5" nowarn="true"
      debug="true" debuglevel="lines,vars,source">
    <classpath refid="project.class.path"/>
  </javac>
</target>

For instance, placing an echo of ${gwt.sdk} just above works, but not inside "project.class.path". Is it a bug, or do I have to do something that I'm not?

Edit: I tried moving the property out from target setup.gwtenv into "global space", that helped circumvent the problem.

© Stack Overflow or respective owner

Related posts about ant

Related posts about path