ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <anto...@gmx.de>
Subject Re: pathelement location
Date Thu, 20 Oct 2005 18:01:27 GMT
Hello Laurie,

there are certainly several ways of achieving this, but not in pure ant
(as far as I know)

one of the ways is to generate your path on the file, using a stylesheet,

you could have a main ant build file which would get the

-Dprojects="subproj1, subproj2"

parameter, and pass it to a stylesheet which would generate an xml build file.

Then you could invoke a target of this xml build file from the main build file.

The other solution is that you implement in java a custom path type which would do what you
want.

A third solution would be to add dynamically path elements to a path using scripting.

In the ant docu, you will see that it is possible to create tasks (types ?) which are implemented
with a script fragment written in the build file.

Look at <script/>, <scriptdef/>, ... You have the choice of groovy, Rhino JavaScript,
Ruby, ...

Cheers,

Antoine





Laurie.Green@ubs.com wrote:

>Hi
>
>To run my main project I currently include all the existing jars using a <fileset />
and include the classes of the subproject that I have changed and eclipse has compiled using
a <pathelement location="....."/>
>
>eg.,	<path id="allClassesCP">
>    		<path refid="javaJars"/>
>    		<pathelement location="C:/ProjectBuilds/${view.name}/build/${project}/classes"
/>
>		<pathelement location="C:/ProjectBuilds/${view.name}/build/${project}/idl" />
>    		<fileset dir="${mainJarDir}" includes="Foundation.jar"/>
>    		<fileset dir="${mainJarDir}" includes="*.jar" excludes="Reports.jar"/>
>    		<fileset dir="${mainJarDir}/3rd" includes="*.jar"/>
>  	</path>
>
>${project} is the subproject. and the 'classes' and 'idl' directories have the route of
classes for that subproject (com/project/...)
>
>
>I would like to be able to specify on the ant command line -Dprojects="subproj1, subproj2"
and for the 'classes' and 'idl' directories to be included for each of the specified subprojects.
I have tried using * char in the location path to include any classes: C:/ProjectBuilds/${view.name}/build/*/classes
but no success.
>
>
>Any ideas on how to achieve this?
>
>Thanks,
>Laurie
>
>  
>


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


Mime
View raw message