Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ANT - Run a single target but without dependencies

Tags:

java

build

ant

I know how to run a single target in ANT, but it also checks the "depends" attribute and runs those before the target. Is there a way to prevent this or a way to structure my ANT file so that I can do this more easily?

like image 740
GreenieMeanie Avatar asked May 28 '09 18:05

GreenieMeanie


1 Answers

Create a "withoutdeps" version of the target. If you had

<target name="A" depends="B">
   ...
</target>

Change to

<target name="A" depends="B,AwithoutDeps"/>

<target name="AwithoutDeps">
    ...
</target>

Now you can call A as normal (which will fire off B then AwithoutDeps) or just call AwithoutDeps explicitly and no deps fired. [Note that "depends" calls the dependencies in order]

Of course, choose some better names than these ;)

like image 131
Scott Stanchfield Avatar answered Oct 04 '22 03:10

Scott Stanchfield