ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Target overriding inside imported files.
Date Mon, 01 Dec 2008 06:03:40 GMT
>I'm working with Eclipse and I have auto generated the 
>build.xml file. There
>is a way to automatically import your own buildfiles by adding
><?eclipse.ant.import?> on the top.
>My question: ┬┐Is it possible to override the definition of a 
>target in order
>to specify the dependencies?
>Let's say for example:
>
>
><!-- Eclipse automatically generated build.xml file -->
><project ...
>...
><import file="build.proxies.xml"/>
>...
>...
><target depends="build-subprojects,build-project" name="build"/>
>...
><!-- End of Eclipse automatically generated build.xml file -->
>
>---------------------------------------------------------------
>-------------------------------
>
><!-- My own build.proxies.xml file -->
><project ...
>...
>
><!-- Override the target to add the dependency of build -->
><target depends="generateproxies" name="build" />
>
><target name="generateproxies">
>    <!-- generate the proxies for the project -->
></target>
>
><!-- End of my own build.proxies.xml file -->
>
>
>
>Or, do you have any other suggestion in order no to modify the main
>build.xml file every time?


You can overwrite targets and its dependencies.
You can access the overwritten targets by "full qualified names" ${AntProjectName.TargetName}.
In your case your "build" eliminates the dependency on "build-subprojects,build-project".

<!-- Eclipse automatically generated build.xml file -->
<project name="foo" ...
    <target depends="build-subprojects,build-project" name="build"/>
    ...
<!-- End of Eclipse automatically generated build.xml file -->
<!-- My own build.proxies.xml file -->
<project name="myfoo" ...
    <!-- Override the target to add the dependency of build -->
    <target depends="generateproxies,foo.build" name="build" />
    ....
<!-- End of my own build.proxies.xml file -->



Jan

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


Mime
View raw message