Ant javac includes : Compile « Ant « Java

Ant javac includes

<?xml version="1.0"?>

<project name="yourname" basedir=".." default="all">

  <property name="dist" location="dist/"/> 
  <property name="lib" location="lib/"/> 
  <property name="src" location="src/"/> 

  <path id="class.path">
    <pathelement path="${src}"/> 
    <fileset dir="${lib}">
      <include name="**/*.jar"/>
      <include name="**/*.zip"/>
    <fileset dir="/dev">
      <include name="**/*.jar"/>
      <include name="**/*.zip"/>
  <target name="clean">
      <fileset dir="${src}" includes="**/*.class"/>
    <delete dir="${dist}"/>
  <target name="zip" depends="clean">
    <mkdir dir="${dist}"/>
    <zip destfile="${dist}\actionServlet-${DSTAMP}${TSTAMP}.zip">
      <zipfileset dir=".">
        <exclude name="${dist}"/>

  <target name="compile">
      <src path="${src}" />
      <classpath refid="class.path"/> 
      <include name = "*/**" />

  <target name="jar" depends="compile">
    <mkdir dir="${dist}"/>

      excludes="**/*.java, *.mdb"

  <target name="all" depends="jar"/>



Related examples in the same category

1.Compile the web application
2.Ant target:compile
3.Compile the stand-alone application
4.Use a precompiler with Java
5.Indicate the init and max memory when compiling
6.Ant Javac setting
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