Skip to content

Instantly share code, notes, and snippets.

@tepie
Created October 12, 2012 13:59
Show Gist options
  • Save tepie/3879308 to your computer and use it in GitHub Desktop.
Save tepie/3879308 to your computer and use it in GitHub Desktop.
The most basic java compile and jar build.xml ever
<?xml version="1.0"?>
<project name="project" basedir="." default="jar">
<property file="build.properties"/>
<target name="clean">
<delete dir="dist" />
<delete dir="build" />
<mkdir dir="dist"/>
<mkdir dir="build"/>
</target>
<path id="project.class.path">
</path>
<target name="compile" depends="clean">
<javac srcdir="src" destdir="build" fork="yes" executable="/usr/bin/javac" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="jar" depends="compile">
<jar jarfile="dist/project.jar" basedir="build">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Sealed" value="false"/>
</manifest>
</jar>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment