Skip to content

Instantly share code, notes, and snippets.

@adamnew123456
Created March 4, 2012 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamnew123456/1971125 to your computer and use it in GitHub Desktop.
Save adamnew123456/1971125 to your computer and use it in GitHub Desktop.
Ant Build Templates - Templates for different tasks in Ant
<!-- Basic template setup for compiling Intellij Forms By Hand -->
<project name="NAME" default="dist" basedir=".">
<description>
DESCRIPTION
</description>
<path id="javac2.classpath">
<fileset dir="lib">
<!-- Copy these files to the lib/ directory:
- annotations.jar
- asm-commons.jar
- asm.jar
- forms_rt.jar
- javac2.jar
- jdom.jar
-->
<include name="**/*.jar" />
</fileset>
</path>
<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath" />
<target name="compile">
<mkdir dir="build/classes" />
<javac2 srcdir="src" destdir="build/classes" classpathref="javac2.classpath" />
<jar destfile="build/PROGRAM.jar" basedir="build/classes">
<zipgroupfileset dir="lib" includes="*.jar" />
<manifest>
<attribute name="Main-Class" value="CLASS" />
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="build" />
</target>
</project>
<!-- Basic template setup for compiling Scala By Hand -->
<project name="NAME" default="dist" basedir=".">
<description>
DESCRIPTION
</description>
<path id="scala.classpath">
<!-- Copy these files into the lib/ directory
- scala-library.jar
- scala-compiler.jar
-->
<fileset dir="lib">
<include name="scala*.jar" />
</fileset>
</path>
<taskdef resource="scala/tools/ant/antlib.xml" classpathref="scala.classpath" />
<target name="compile">
<mkdir dir="build/classes" />
<scalac srcdir="src" destdir="build/classes" classpathref="scala.classpath" />
<jar destfile="build/NAME.jar" basedir="build/classes">
<zipgroupfileset dir="lib" includes="*.jar" />
<manifest>
<attribute name="Main-Class" value="CLASS" />
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="build" />
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment