Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update build file to build a jar with manifest.

  • Loading branch information...
commit cf6601dde523e0d6bfae968132be9d278d0ee3da 1 parent b75da9e
@childss authored
Showing with 46 additions and 40 deletions.
  1. +46 −40 build.xml
View
86 build.xml
@@ -1,44 +1,50 @@
<project default="build">
- <property name="src.dir" value="src" />
- <property name="lib.dir" value="lib" />
- <property name="build.dir" value="build" />
- <property name="classes.dir" value="${build.dir}/classes" />
- <property name="jars.dir" value="${build.dir}/jars" />
- <property name="dist.name" value="classproject.jar" /> <!--This is the name of our distribution file -->
+ <property name="src.dir" value="src"/>
+ <property name="lib.dir" value="lib"/>
+ <property name="build.dir" value="build"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
+ <property name="jars.dir" value="${build.dir}/jars"/>
+ <property name="dist.name" value="classproject.jar"/>
+ <!--This is the name of our distribution file -->
- <property name="junit.jar" value="${lib.dir}/junit4.8.2/junit-4.8.2.jar" />
- <property name="classpath" value="${junit.jar}" />
-
- <target name="clean" description="Erase all generated files">
- <delete dir="${build.dir}" failonerror="true" />
- </target>
+ <property name="junit.jar" value="${lib.dir}/junit4.8.2/junit-4.8.2.jar"/>
+ <property name="classpath" value="${junit.jar}"/>
- <target name="compile">
- <mkdir dir="${classes.dir}" />
- <javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="${classpath}" />
- </target>
-
- <target name="test" depends="compile">
- <junit haltonfailure="true">
- <classpath path="${junit.jar};${classes.dir}" />
- <formatter type="brief" usefile="false" />
- <batchtest>
- <fileset dir="${src.dir}">
- <include name="**/*Test*.java" />
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="build" depends="test" description="Full build and test">
- </target>
-
- <target name="jar" depends="build">
- <mkdir dir="${jars.dir}" />
- <jar destfile="${dist.name}" basedir="${classes.dir}" />
- </target>
-
- <target name="release" depends="clean, jar" description="Create release package">
- <copy file="${dist.name}" todir="${build.dir}" />
- </target>
+ <target name="clean" description="Erase all generated files">
+ <delete dir="${build.dir}" failonerror="true"/>
+ </target>
+
+ <target name="compile">
+ <mkdir dir="${classes.dir}"/>
+ <javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="${classpath}"/>
+ </target>
+
+ <target name="test" depends="compile">
+ <junit haltonfailure="true">
+ <classpath path="${junit.jar};${classes.dir}"/>
+ <formatter type="brief" usefile="false"/>
+ <batchtest>
+ <fileset dir="${src.dir}">
+ <include name="**/*Test*.java"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="build" depends="test" description="Full build and test">
+ </target>
+
+ <target name="jar" depends="build">
+ <mkdir dir="${jars.dir}"/>
+ <jar destfile="${dist.name}" basedir="${classes.dir}">
+ <manifest>
+ <attribute name="Main-Class"
+ value="com.example.classproject.HelloWorld"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="release" depends="clean, jar" description="Create release package">
+ <copy file="${dist.name}" todir="${build.dir}"/>
+ </target>
</project>
Please sign in to comment.
Something went wrong with that request. Please try again.