Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Ant conditional target in Build.XML

807603Oct 26 2007 — edited Oct 26 2007
Hi!
I am new to the Ant Build process & I am looking for some condition type build parameter in build.xml so that the user can use some command line option to execute the same target but with some modification & if not passed then the normal execution take place. I want something like this

<!-- compiling of java files done here normal "ant"-->
    <target name="compile">
        <javac srcdir="${src}" destdir="${src}" classpathref="classpath"/>
        <echo message="compiling done"/>
    </target>
    <!-- Excute when some argument is passed something like conditional statemet-->
    <!-- compile without wsdl when "ant withoutwsdl"-->
    <target name="compile">
	    <javac srcdir="${src}" destdir="${src}" excludes="wsdl/**" classpathref="classpath"/>
	    <echo message="Compiled without WSDL done."/>
    </target> 
So that i dont have to make much change in the build process.

Please help me out.
Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2007
Added on Oct 26 2007
1 comment
324 views