Ant target:compile : Compile « Ant « Java






Ant target:compile

  
<?xml version="1.0"?>

<project name="sample" default="test" basedir=".">

   <target name="compile">
      <mkdir dir="build"/>
      <javac destdir="build"
             debug="on"
             optimize="on">
         <src path="src"/>
      </javac>
   </target>

   <target name="test" depends="compile">
      <java fork="no" failonerror="yes"
            classname="test.TestSample"
            classpath="build">  
          <arg line=""/>
      </java>
   </target>

   <target name="clean">
      <delete dir="build"/>
   </target>

</project>

           
         
    
  








AntCompileAndClean.zip( 1 k)

Related examples in the same category

1.Compile the web application
2.Compile the stand-alone application
3.Use a precompiler with Java
4.Indicate the init and max memory when compiling
5.Ant Javac setting
6.Ant javac includes
7.Javac include and exclude
8.Javac with classpath
9.Javac with encoding
10.Javac with optimize
11.Set debug and optimize for javac
12.Set failonerror for javac
13.Set debuglevel for javac
14.Set link for Javac
15.Set source version in javac
16.Set target for javac
17.Ant compile from src folder to build folder, set the class path and java files include