-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
113 lines (84 loc) · 3.34 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<project name="Ammolite" basedir="." default="main">
<property name="src.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="lib.dir" value="lib" />
<property name="main-class" value="edu.mit.csail.ammolite.AmmoliteMain"/>
<target name="init">
<property name="scala.home" value="/usr/local/Cellar/scala/2.11.2" />
<property name="scala.home.lib" value="${scala.home}/libexec/lib" />
<path id="scala.path" cache="true">
<fileset dir="${scala.home.lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="lib" cache="false">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="build.classpath">
<path refid="lib" />
<path refid="scala.path" />
</path>
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${scala.home.lib}/scala-compiler.jar" />
<pathelement location="${scala.home.lib}/scala-reflect.jar" />
<pathelement location="${scala.home.lib}/scala-library.jar" />
</classpath>
</taskdef>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="cleanjar">
<delete dir="${jar.dir}"/>
</target>
<target name="compile" depends="init">
<mkdir dir="${build.dir}"/>
<javac source="6" target="6" srcdir="${src.dir}" destdir="${build.dir}" classpathref="build.classpath" />
<scalac srcdir="${src.dir}" destdir="${build.dir}" classpathref="build.classpath" force="changed" >
<include name="**/*.scala"/>
<exclude name="**/*.java"/>
</scalac>
</target>
<target name="jar" depends="compile,cleanjar">
<mkdir dir="${jar.dir}"/>
<manifestclasspath property="depends" jarfile="${jar.dir}/${ant.project.name}.jar">
<classpath refid="lib"/>
</manifestclasspath>
<jar jarfile="${jar.dir}/${ant.project.name}.jar" basedir="${build.dir}" >
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Class-Path" value="${depends}"/>
</manifest>
<zipgroupfileset dir="${lib.dir}" includes="**/*.jar" />
</jar>
</target>
<target name="superjar" depends="compile,jar,cleanjar">
<mkdir dir="${jar.dir}"/>
<manifestclasspath property="depends" jarfile="${jar.dir}/${ant.project.name}-super.jar">
<classpath refid="lib"/>
</manifestclasspath>
<jar jarfile="${jar.dir}/${ant.project.name}.jar" basedir="${build.dir}" >
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Class-Path" value="${depends}"/>
</manifest>
<zipgroupfileset dir="${lib.dir}" includes="**/*.jar" />
</jar>
</target>
<!-- <jar destfile="${jar.file}"
basedir="${build.dir}"
manifest="${manifest.file}">
<fileset dir="${classes.dir}" includes="**/*.class" />
<zipgroupfileset dir="${lib.dir}" includes="**/*.jar" />
</jar> -->
<target name="run" depends="jar">
<java jar="${jar.dir}/${ant.project.name}.jar" inputstring="--help" fork="true"/>
</target>
<target name="clean-build" depends="clean,jar"/>
<target name="main" depends="run"/>
</project>