Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • ANT Build File Example

    • 0
    • 3
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 479
    Comment on it

    Hello Readers..

    In this blog I am giving an example that how can we create an build.xml file for performing clean,compile and run by using ANT.

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="AntProject" basedir="." default="run">
    
    <property name="src.dir" value="${basedir}" />
    <property name="build.dir" value="${basedir}/build" />
    <property name="classes.dir" value="${build.dir}/classes" />
    <property name="jar.dir" value="${build.dir}/jar" /> 
    
    <target name="clean">
    <delete includeemptydirs="true">
    <fileset dir="${build.dir}">
    <include name="**/*" />
    </fileset>
    </delete>
    </target>
    
    <target name="compile" depends="clean">
    <echo message="inside compile" />
    <mkdir dir="${build.dir}" />
    <mkdir dir="${classes.dir}" />
    <javac includeantruntime="false" srcdir="${src.dir}" destdir="${classes.dir}" />
    </target>
    
    <target name="run" depends="compile">
    <echo message="inside run" />
    <java classname="AntPackage.AntClass">
    <classpath path="${classes.dir}" />
    </java>
    </target>
    </project>
    

    Note:- This above mention build.xml code is based on my machine. You can make changes as per your requirement or convenience.

    Please see more details for the above mention code you can visit my previous blog, after click on the below link-

    ANT

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: