-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
74 lines (66 loc) · 2.27 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<project name="HashTableTester" default="dist" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="bin" location="bin"/>
<property name="dist" location="dist"/>
<property environment="env"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the bin folder used by compile -->
<mkdir dir="${bin}"/>
<path id="build.classpath">
<pathelement location="${env.SCALA_HOME}/lib/scala-library.jar" />
</path>
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${env.SCALA_HOME}/lib/scala-compiler.jar" />
<pathelement location="${env.SCALA_HOME}/lib/scala-reflect.jar"/>
<pathelement location="${env.SCALA_HOME}/lib/scala-library.jar" />
</classpath>
</taskdef>
</target>
<target name="build" depends="init"
description="compile the source " >
<!-- Compile the scala code from ${src} into ${bin} -->
<scalac srcdir="${src}"
destdir="${bin}"
classpathref="build.classpath">
<include name="*.scala" />
</scalac>
</target>
<target name="dist" depends="build"
description="package the jar" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Put everything in ${bin} into the jar file -->
<jar jarfile="${dist}/${ant.project.name}-no-scala.jar" basedir="${bin}">
<manifest>
<attribute name="Main-Class" value="${ant.project.name}"/>
</manifest>
</jar>
<taskdef resource="proguard/ant/task.properties"
classpath="/usr/local/Cellar/proguard/4.8/libexec/proguard.jar" />
<proguard>
-injars ${dist}/${ant.project.name}-no-scala.jar
-injars /usr/local/Cellar/scala/2/libexec/lib/scala-library.jar
-outjars ${ant.project.name}.jar
-libraryjars ${java.home}/lib/rt.jar
-dontwarn scala.**
-dontnote
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
</proguard>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${bin}"/>
<delete dir="${dist}"/>
<delete file="${ant.project.name}.jar"/>
</target>
</project>