Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 6138a8c8c0
Fetching contributors…

Cannot retrieve contributors at this time

140 lines (124 sloc) 4.547 kB
<project name="JPGF" default="dist" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="build.debug" value="true"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DIRS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="scala.home" location="tools/scala-2.8.1.final"/>
<property name="sources.dir" value="src/" />
<property name="build.dir" value="build" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="jar.dir" value="${build.dir}/jar" />
<property name="test.dir" location="${build.dir}/test"/>
<property name="test.data.dir" location="${test.dir}/data"/>
<property name="test.reports.dir" location="${test.dir}/reports"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JARS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<property name="scala-library.jar"
value="${scala.home}/lib/scala-library.jar" />
<property name="scala-compiler.jar"
value="${scala.home}/lib/scala-compiler.jar" />
<property name="junit.jar"
value="lib/junit-4.8.2.jar" />
<property name="JPGF.final.jar" value="${jar.dir}/JPGF.final.jar"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PATHS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<path id="compile.classpath">
<pathelement location="${scala-library.jar}" />
<pathelement location="${classes.dir}" />
<pathelement location="lib/java-cup-11a-runtime.jar" />
</path>
<path id="test.classpath">
<path refid="compile.classpath"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${build.dir}/classes"/>
<pathelement location="${build.dir}/test"/>
</path>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TARGETS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="init">
<mkdir dir="${build.dir}" />
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${scala-compiler.jar}" />
<pathelement location="${scala-library.jar}" />
</classpath>
</taskdef>
</target>
<target name="compile" depends="init">
<mkdir dir="${classes.dir}" />
<scalac srcdir="${sources.dir}"
destdir="${classes.dir}"
classpathref="compile.classpath">
</scalac>
<javac srcdir="${sources.dir}"
debug="true" debuglevel="lines,source"
includeAntRuntime="true"
destdir="${classes.dir}"
classpathref="compile.classpath">
</javac>
</target>
<target name="test-init" depends="init">
<mkdir dir="${test.dir}" />
</target>
<target name="test-compile" depends="compile,test-init">
<javac destdir="${test.dir}"
debug="true" debuglevel="lines,source"
includeAntRuntime="true"
srcdir="test">
<classpath refid="test.classpath"/>
</javac>
<copy todir="${test.dir}">
<fileset dir="test" excludes="**/*.java"/>
</copy>
</target>
<target name="test" depends="test-compile">
<junit printsummary="false" haltonfailure="true">
<classpath refid="test.classpath"/>
<formatter type="brief" usefile="false"/>
<batchtest todir="${test.data.dir}">
<fileset dir="${test.dir}" includes="**/*Test.class"/>
</batchtest>
</junit>
</target>
<target name="jar" depends="test">
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard>
<![CDATA[
-injars ${classes.dir}:${scala-library.jar}:lib/java-cup-11a-runtime.jar
-outjars "${JPGF.final.jar}"
-libraryjars <java.home>/lib/rt.jar
-dontnote
-dontwarn
-dontoptimize
-dontobfuscate
-keepattributes
-keep class scala.Function0 { *; }
-keep class scala.Function1 { *; }
-keep class scala.Function2 { *; }
-keep class java_cup.runtime.Scanner { *; }
-keep class org.grammaticalframework.** {
*;
}
]]>
</proguard>
</target>
<target name="test-jar" depends="test-compile, jar">
<path id="test-jar.classpath">
<pathelement location="${junit.jar}"/>
<pathelement location="${JPGF.final.jar}" />
<pathelement location="${build.dir}/test" />
</path>
<junit printsummary="false" haltonfailure="true">
<classpath refid="test-jar.classpath" />
<formatter type="brief" usefile="false"/>
<batchtest todir="${test.data.dir}">
<fileset dir="${test.dir}" includes="**/*Test.class"/>
</batchtest>
</junit>
</target>
<target name="clean">
<delete dir="${build.dir}" failonerror="false" />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.