-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
53 lines (53 loc) · 2.11 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="dist" name="Terms">
<property name="target" value="21" />
<property name="source" value="21" />
<property name="build.compiler" value="javac10+" />
<path id="Terms.classpath">
<pathelement location="jars/json.jar" />
<pathelement location="jars/xmljava.jar" />
</path>
<condition property="isWindows">
<os family="windows" />
</condition>
<target name="init">
<mkdir dir="out" />
<copy includeemptydirs="false" todir="out">
<fileset dir="src">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="out" failonerror="false" />
</target>
<target name="distclean">
<delete dir="dist" failonerror="false" />
</target>
<target name="compile" depends="clean,init">
<description>Build jar file</description>
<delete file="jars/terms.jar" />
<javac srcdir="src" destdir="out" classpathref="Terms.classpath" modulepathref="Terms.classpath" includeAntRuntime="false" />
<jar destfile="jars/terms.jar" basedir="out" />
</target>
<target name="link" depends="distclean,compile">
<description>Build Java binaries</description>
<link destDir="dist" modulepath="jars:${java.home}/jmods" includeManPages="false" includeHeaders="false">
<module name="terms" />
</link>
<delete file="dist/lib/jrt-fs.jar" />
</target>
<target name="copyBats" if="isWindows">
<description>Copy .cmd to /dist</description>
<copy file="extractTerms.cmd" todir="dist" />
</target>
<target name="copyShells" unless="isWindows">
<description>Copy .sh to /dist</description>
<copy file="extractTerms.sh" todir="dist" />
<chmod dir="dist" perm="ugo+rx" includes="**/*.sh" />
</target>
<target name="dist" depends="link,copyBats,copyShells">
<description>Prepare distribution</description>
<copy file="LICENSE" todir="dist" />
</target>
</project>