ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <>
Subject Re: just not getting it
Date Mon, 11 Aug 2003 01:25:34 GMT
On Mon, 11 Aug 2003 06:44 am, Gregory Seidman wrote:
> Would someone please explain how to handle the simple example of a
> directory/package tree full of .java source files to be built into a JAR?
> Once I have that toehold, I think I can start learning the rest.

Here is a complete and relatively simple example of a full build file to 
compile and build a jar. This particular example uses a set of external 
libraries in the build. If you don;t need that, you can drop out the 
lib.classpath related stuff.

<project name="piston" default="jar">
  <property name="src.dir" value="src"/>
  <property name="build.dir" value="build"/>
  <property name="lib.dir" value="lib"/>
  <property name="jar.dir" value="jar"/>

  <path id="lib.classpath">
    <fileset dir="${lib.dir}"/>

  <target name="compile">
    <mkdir dir="${build.dir}"/>
    <javac srcdir="${src.dir}" destdir="${build.dir}" debug="on">
      <classpath refid="lib.classpath"/>

  <target name="jar" depends="compile">
    <mkdir dir="${jar.dir}"/>
    <jar destfile="${jar.dir}/piston.jar">
      <fileset dir="${build.dir}"/>
        <attribute name="Main-Class" value="com.codefeed.piston.Piston"/>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message