Skip to content

Instantly share code, notes, and snippets.

@fsouza
Created August 19, 2012 04:21
Show Gist options
  • Save fsouza/3391920 to your computer and use it in GitHub Desktop.
Save fsouza/3391920 to your computer and use it in GitHub Desktop.
<project name="hello" basedir=".">
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/jar"/>
<target name="setup">
<tstamp/>
<mkdir dir="${classes}"/>
<mkdir dir="${jar}"/>
</target>
<target name="build" depends="setup" description="compile the source">
<javac srcdir="${src}" destdir="${classes}" includeantruntime="false"/>
</target>
<target name="jar" depends="build">
<jar destfile="${jar}/Hello.jar" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="br.ufes.hello.Hello"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java jar="${jar}/Hello.jar" fork="true"/>
</target>
<target name="clean">
<delete dir="${build}"/>
</target>
</project>
package br.ufes.hello;
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment