ant - Depending on user input , targets in the build should execute -
i want execute targets in build.xml (written using ant scripts) 1 one. these execution of targets should depend on user's input. is, user asked "if target has executed (y/n)?" if users inputs "n" target should not executed. if gives input "y" target should executed.
here answer expanded ant documentation.
<project > <target name="ask" > <input message="all data going deleted db continue (y/n)?" validargs="y,n" addproperty="do.delete" /> <condition property="do.abort"> <equals arg1="n" arg2="${do.delete}"/> </condition> <fail if="do.abort">build aborted user.</fail> <echo message="dropping database"/> </target> </project>
please see what best resources learn ant?. has sample build.xml useful targets...
Comments
Post a Comment