Generates java2s.jar : Jar « Ant « Java






Generates java2s.jar

 
<?xml version="1.0"?>
<project name="Template Buildfile" default="compile" basedir=".">
  <property name="dir.src" value="src"/>
  <property name="dir.build" value="build"/>
  <property name="dir.dist" value="dist"/>

  <!-- Creates the output directories -->
  <target name="prepare">
    <mkdir dir="${dir.build}"/>
    <mkdir dir="${dir.dist}"/>
  </target>

  <target name="clean"
          description="Remove all generated files.">
    <delete dir="${dir.build}"/>
    <delete dir="${dir.dist}"/>
  </target>

  <target name="compile" depends="prepare"
          description="Compile all source code.">
    <javac srcdir="${dir.src}" destdir="${dir.build}"/>
  </target>

  <target name="jar" depends="compile"
          description="Generates java2s.jar in the 'dist' directory.">
    <jar jarfile="${dir.dist}/java2s.jar" 
         basedir="${dir.build}"/>
  </target>
</project>

           
         
  








AntBasic.zip( 3 k)

Related examples in the same category

1.Ant task: jar
2.Jar with includes and excludes using filesets
3.Jar with includes and excludes
4.Ant jar file setting the Main-Class
5.Jar file with fileset and exclude
6.Jar file: exclude files
7.More than one filesets for jar
8.Add attribute to jar file manifest