forked from rambaut/jam-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
100 lines (85 loc) · 3.82 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
<!-- ANT build file for JAM -->
<project name="JAM" default="dist" basedir=".">
<description>
Build file for JAM
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="build-mac-only" location="build-mac-only"/>
<property name="build-java9-only" location="build-java9-only"/>
<property name="lib" location="lib"/>
<property name="dist" location="dist"/>
<property environment="env"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${build-java9-only}"/>
<mkdir dir="${build-mac-only}"/>
<mkdir dir="${dist}"/>
</target>
<target name="compile" depends="init">
<!-- Compile the java code from ${jamsrc} into ${build} -->
<condition property="isMac">
<os family="mac"/>
</condition>
<javac source="1.8" target="1.8" srcdir="${src}" destdir="${build}">
<include name="jam/**/*"/>
<exclude name="jam/**/maconly/*"/>
<exclude name="jam/**/java9only/*"/>
<!--<exclude name="org/**/maconly/*" unless = "isMac"/>-->
</javac>
<copy todir="${build}" verbose="true">
<fileset dir="${src}" includes="jam/**/*.png,jam/**/*.gif"/>
</copy>
</target>
<target name="compile-java9-only" depends="init">
<!-- Compile the java code from ${jamsrc} into ${build} -->
<condition property="isMac">
<os family="mac"/>
</condition>
<javac source="1.9" target="1.9" srcdir="${src}" destdir="${build-java9-only}">
<include name="jam/**/java9only/*"/>
</javac>
</target>
<target name="dist-java9-only" depends="compile-java9-only" description="generate the -java9-only distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- create the mac-only jar file -->
<jar jarfile="${lib}/jam-java9-only.jar">
<fileset dir="${build-java9-only}" includes="**/mac*/**/*.class,*.properties"/>
</jar>
</target>
<target name="compile-mac-only" depends="init">
<!-- Compile the java code from ${jamsrc} into ${build} -->
<condition property="isMac">
<os family="mac"/>
</condition>
<javac source="1.6" target="1.6" srcdir="${src}" destdir="${build-mac-only}">
<include name="jam/**/maconly/*"/>
</javac>
</target>
<target name="dist-mac-only" depends="compile-mac-only" description="generate the -mac-only distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- create the mac-only jar file -->
<jar jarfile="${lib}/jam-mac-only.jar">
<fileset dir="${build-mac-only}" includes="**/mac*/**/*.class,*.properties"/>
</jar>
</target>
<!-- jam-mac-only.jar should be compiled using Java 6 and then is linked in here -->
<!-- jam-java9-only.jar should be compiled using Java 9 and then is linked in here -->
<target name="dist" depends="compile, dist-java9-only, dist-mac-only" description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<delete file="${dist}/jam.jar"/>
<!-- Put everything in ${build} into the jam.jar file -->
<jar jarfile="${dist}/jam.jar">
<fileset dir="${build}" includes="**/*.class,**/*.properties,**/*.png"/>
<zipgroupfileset dir="${lib}" includes="jam-mac-only.jar"/>
<zipgroupfileset dir="${lib}" includes="jam-java9-only.jar"/>
</jar>
</target>
</project>