forked from tsauvine/omr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
79 lines (68 loc) · 2.66 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
<project name="omr" default="build" basedir=".">
<property name="src.dir" location="src"/>
<property name="lib.dir" location="lib"/>
<property name="build.dir" location="bin"/>
<property name="dist.dir" location="dist"/>
<property name="dist.lib.dir" location="dist/lib"/>
<property name="main.class.name" value="omr.Omr"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="*.jar" />
</path>
<target name="init">
<tstamp/>
<mkdir dir="${build.dir}"/>
</target>
<!-- Compile -->
<target name="compile" depends="init" description="compile the source" >
<copy todir="${build.dir}">
<fileset dir="images" includes="*.png" />
</copy>
<javac srcdir="${src.dir}" destdir="${build.dir}" target="1.8" source="1.8">
<classpath refid="classpath"/>
</javac>
</target>
<!-- Jar -->
<target name="build" depends="compile" description="generate the jar" >
<manifestclasspath property="manifest.classpath" jarfile="${ant.project.name}.jar">
<classpath refid="classpath" />
</manifestclasspath>
<jar destfile="${ant.project.name}.jar" compress="true">
<fileset dir="${build.dir}" includes="**/*" />
<!--fileset dir="images" includes="*.png" /-->
<manifest>
<attribute name="Main-Class" value="${main.class.name}" />
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
</jar>
</target>
<!-- Run -->
<target name="run" depends="build" description="runs the program" >
<!-- java jar="${dist.dir}/${ant.project.name}.jar" fork="true" -->
<java jar="${ant.project.name}.jar" fork="true" />
</target>
<!-- Distribution -->
<target name="dist" depends="build" description="generate the distribution" >
<mkdir dir="${dist.dir}/lib"/>
<copy todir="${dist.dir}/lib">
<fileset dir="lib" includes="*.jar" />
</copy>
<path id="dist.classpath">
<fileset dir="${dist.lib.dir}" includes="*.jar" />
</path>
<manifestclasspath property="dist.manifest.classpath" jarfile="${dist.dir}/${ant.project.name}.jar">
<classpath refid="dist.classpath" />
</manifestclasspath>
<jar destfile="${dist.dir}/${ant.project.name}.jar" basedir="${build.dir}" compress="true">
<fileset dir="${build.dir}" includes="**/*" />
<!--fileset dir="images" includes="*.png" /-->
<manifest>
<attribute name="Main-Class" value="${main.class.name}" />
<attribute name="Class-Path" value="${dist.manifest.classpath}"/>
</manifest>
</jar>
</target>
<target name="clean" description="clean up" >
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>