Conditional execution in Ant -


i have target, executed if my_step==true:

<target name="pre-compile" if="my_step"> ... </target> 

but want make pre-compile target available regardless of value of my_step, execute action manually using ant do_my_step:

<target name"-do_my_step"> ... </target> 

question. how can run make pre-compile execute -do_my_step target? is, if property my_step true, pre-compile step execute -do_my_step target. obviously, copy-paste contents of -do_my_step target pre-compile target, want keep target cleanly separated.

target names prefix '-' common practice make target 'private' it's impossible call via commandline. ant -f yourbuildfile.xml -yourprivatetarget won't work ant commandline interface uses leading '-' options. strip leading '-' target name call via ant -f yourbuildfile.xml do_my_step
consider :
"..question. how can run make pre-compile execute -do_my_step target? .."
ant has antcall task calling target within same buildscript. antcall should avoided because opens new project scope (so needs more memory , slow down build) , breaks dependency chain built via <target name="..." depends"=..."> .
antcall superfluous since ant 1.6 introduced macrodef purpose (reuse of functionality).


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -