You get this with ant 1.6.*.
This behavior is kept in ant 1.7.*, but now you will get the message:
Warning: Reference junit.classpath has not been set at runtime, but
was found during
build file parsing, attempting to resolve. Future versions of Ant may support
referencing ids defined in non-executed targets.
In current ant SVN (1.8) you will just get: ${toString:junit.classpath}.
Peter
On Dec 5, 2007 1:39 PM, Knuplesch, Jürgen <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I use antcontribs "if" and have the following strange effect:
>
> If I define a refid in antfile-passage, that is never reached (using if,
> else) ant then
> Try to access the refid it has the value that ist set in the not reached code!
>
> Is this correct behaviour?
>
>
> My Antfile looks like:
> dope.fix is false
>
> <property name="dope.fix" value="false"/>
> <if>
> <equals arg1="${dope.fix}" arg2="true" />
> <then>
> <path id="junit.classpath">
> <pathelement location="${dope.javac.dest}"/>
> <pathelement location="${cvs.fixexportboxbase}/config"/>
> <pathelement location="${cvs.exportboxbase}/DOPE/lib/dope.jar"/>
> </path>
> </then>
> <else>
> <echo>Kein Fix, also Klassenpfad JUnit nicht erweitern</echo>
> </else>
> </if>
> <echo>Klassenpfad in junit: classpath=${toString:junit.classpath}</echo>
>
> The output looks like:
> [echo] Kein Fix, also Klassenpfad JUnit nicht erweitern
> [echo] Klassenpfad in junit:
> classpath=D:\nightlybuild\exportbaseHEAD\DOPE\code;D:\nightlybuild\exportbaseHEAD_FIX\config;D:\nightlybuild\exportbaseHEAD\DOPE\lib\dope.jar
>
>
> Greetings
>
> Juergen
>
> --
> Jürgen Knuplesch www.icongmbh.de
> icon Systemhaus GmbH Tel. +49 711 806098-275
> Sophienstraße 40
> D-70178 Stuttgart Fax. +49 711 806098-299
>
> Geschäftsführer: Uwe Seltmann
> HRB Stuttgart 17655
> USt-IdNr.: DE 811944121
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]