ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <>
Subject Re: dynamically setting path id (name)
Date Fri, 08 Aug 2003 10:46:41 GMT
Sorry about my last e-mail, I meant to
explain a little more.

The id field of <path id="x"> gets resolved
at parse time and not at run-time.
This is to allow the element to be accessed outside
of the normal execution run.

So one cannot do <path id="${}.compile.path"/>.

One would need to do:
<project name="projecta">

   <path id ="projecta.compile.path">
     <pathelement path=...../>

and assuming is set to "projecta" in the caller build
    <ant dir="${mountpoint.projects}"
     <!-- compile the source -->
       <classpath refid="${}.compile.classpath"/>

WARNING: I have not run the above script!


On Friday 08 August 2003 11:17, Svetlin Stanchev wrote:
> You are perfectly right.
> I messed up by including not matching versions of the compile target and
> extract-libpaths.xml.
> Let me try again, please.
> I want to compile a sequence of projects referred to by ${}
> and I have extract-libpaths.xml which finds out all libs needed for
> compilation of any individual project. ${} is known in the
> compile target and the <ant/> task by default is passing it to the
> extract-libpaths.xml.
> Now how can I set the id of the path in extract-libpaths.xml based on
> the project name so that I can refer to it from the <javac/> task inside
> the compile target of build.xml?
> Using in both extract-libpaths.xml and build.xml:
> project-compile-classpath
> I get:
> file:<my_build_file_with_compile_target> Reference
> project-compile-classpath not found.
> (probably because in extract-libpaths.xml I am setting the id before
> associating it with a path?)
> But using in both places directly:
> ${}.compile.classpath
> also fails with the error message attached below.
> (that is why I thought <path id.../> does not allow dynamic setting of
> the id using ant properties, but the id value should be set in a
> property before associating it with a path instead)
> I do not see another way to dynamically set the id of the path with the
> project name in extract-libpaths.xml so that I can use it in the compile
> target.
> Hope I did not mess-up again...
> I'll appreciate further suggestions,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message