Pass ant target to multiple build.xml files in subdirectories -
I have many module projects, each module has its own ant build file (build.xml) / P>
In the root directory I have set up a normal build file which calls the right file of each module.
& lt ;? XML version = "1.0"? & Gt; & Lt; Name of the project = "Brad Gedb" default = "all" based = "." & Gt; & Lt; Target name = "all" & gt; & Lt; Ant dir = "corelib" /> & Lt; Ant dir = "tools" / & gt; & Lt; Ant dir = "makeGdb" /> & Lt; Ant dir = "cytoscape-plugin" / & gt; & Lt; / Target & gt; & Lt; / Project & gt; Now each module has a "clean" goal, so I add these lines:
& lt; Target name = "clean"> & Lt; Ant dir = "corelib" target = "clean" /> & Lt; Ant dir = "tools" target = "clean" /> & Lt; Ant dir = "makeGdb" target = "clean" /> & Lt; Ant dir = "cytoscape-plugin" target = "clean" /> & Lt; / Target & gt; And there are more goals in this way. Do you want to rewrite the build file to avoid this duplication? I've seen an underlying asset in which there is an active goal, but I could not find it.
Why do not use a target call that refers to all your sub-instructions, And the target parameter to be called eg
& lt; Antcall target = "doStuffToSubdirs" & gt; & Lt ;! - Let's clean - & gt; & Lt; Param name = "param1" value = "clean" /> & Lt; / Antcall & gt; and after that:
& lt; Target name = "dustfut SUBDIS" & gt; & Lt; Ant dir = "corelib" target = "$ {param1}" /> & Lt; Ant dir = "tools" target = "$ {param1}" /> ... etc & lt; / Target & gt; So it allows you to call the parameters to call your sub-parts. If you add a new subdir, then you only need to add that subdier to the 'DustfutsBSDIR' target (I will change its name along with it!)
Comments
Post a Comment