ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aliaksandr Voitau <voi...@gmail.com>
Subject Re: <path id=..>, <classpath refid=..> using trouble
Date Tue, 13 Sep 2005 17:51:20 GMT
It's a single build script.
Though it may behave like property does, it looks really confusing, that 
I assign undefined property "${lib}" to pathelement's location 
attribute, define it later, supposing that when it will be used, e.g. 
referenced by id, it'll be resolved. As a result, I see insted of required
	lib_location/sample.jar
is
	absolute_path_to_current_dir\{lib}\sample.jar


Thanks, Alex.


Andrew Goktepe wrote:
> It looks like the problem occurs within a single build script. The bug 
> mentioned applies only when you make a call to another script using <ant>.
> 
> On 9/13/05, Antoine Levy-Lambert <antoine@gmx.de> wrote: 
> 
>>Hello Aliaksandr,
>>
>>this sounds like bug 25777, which was fixed in Ant 1.6.3,
>>Which version of ant are you using ?
>>
>>
>>Cheers,
>>
>>Antoine
>>
>>http://issues.apache.org/bugzilla/show_bug.cgi?id=25777
>>
>>Aliaksandr Voitau wrote:
>>
>>
>>>Hi,
>>>here is a piece of my buildfile.
>>>
>>><path id="sample.classpath">
>>><pathelement location="${lib}/sample.jar" />
>>></path>
>>>
>>><target name="target-name">
>>><taskdef name="sample"
>>>classname="my.pkg.Sample">
>>><classpath refid="sample.classpath" />
>>></taskdef>
>>></target>
>>>
>>>While trying to invoke this target from java code i get the following
>>>error:
>>>
>>>taskdef class my.pkg.Sample cannot be found,
>>>
>>>although i set ${lib} from java code using setProperty(...) right
>>>before executing target "target-name".
>>>However, if i'll just paste <path> content to <classpath>:
>>>
>>><target name="target-name">
>>><taskdef name="sample"
>>>classname="my.pkg.Sample">
>>><classpath>
>>><pathelement location="${lib}/sample.jar" />
>>></classpath>
>>></taskdef>
>>></target>
>>>
>>>or just put ${lib} to property file everything works fine, or even
>>>just nest <path> into <target>.
>>>
>>>So, <path> seems to resolve nested elements' properties only on the
>>>time of the first parsing by ProjectHelper's parse(...), but not on
>>>executing particular target, using that path, when previously
>>>undefined properties became available. Is it correct behaviour?
>>>Couldn't find any explanation in available documentation.
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message