-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.xml
99 lines (99 loc) · 3.72 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="dist" name="Swordfish">
<property name="target" value="21"/>
<property name="source" value="21"/>
<property name="build.compiler" value="javac10+"/>
<path id="Swordfish.classpath">
<pathelement location="jars/bcp47j.jar" />
<pathelement location="jars/dtd.jar" />
<pathelement location="jars/json.jar" />
<pathelement location="jars/jsoup.jar" />
<pathelement location="jars/mapdb.jar" />
<pathelement location="jars/openxliff.jar" />
<pathelement location="jars/xmljava.jar" />
<pathelement location="jars/slf4j-api-2.0.13.jar" />
<pathelement location="jars/slf4j-nop-2.0.13.jar" />
<pathelement location="jars/sqlite-jdbc-3.45.3.0.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"/>
<delete dir="bin" failonerror="false"/>
<delete dir="conf" failonerror="false"/>
<delete dir="include" failonerror="false"/>
<delete dir="legal" failonerror="false"/>
<delete dir="lib" failonerror="false"/>
<delete file="release"/>
</target>
<target name="compile" depends="clean,init">
<description>Build jar file</description>
<delete file="jars/swordfish.jar"/>
<javac srcdir="src" destdir="out" classpathref="Swordfish.classpath" modulepathref="Swordfish.classpath" includeAntRuntime="false"/>
<jar destfile="jars/swordfish.jar" basedir="out"/>
</target>
<target name="link" depends="distclean,compile">
<description>Build Java binaries</description>
<link destDir="dist" modulepath="jars:${java.home}/jmods">
<module name="swordfish"/>
</link>
<delete file="dist/lib/jrt-fs.jar"/>
</target>
<target name="copyWindows" if="isWindows">
<description>Move java binaries to work folder</description>
<move todir=".\bin">
<fileset dir="dist\bin"/>
</move>
<move todir=".\conf">
<fileset dir="dist\conf"/>
</move>
<move todir=".\include">
<fileset dir="dist\include"/>
</move>
<move todir=".\legal">
<fileset dir="dist\legal"/>
</move>
<move todir=".\lib">
<fileset dir="dist\lib"/>
</move>
<move file="dist\release" todir="."/>
<delete dir="dist" failonerror="false"/>
<delete file=".\jars\swordfish.jar" />
</target>
<target name="copyUnix" unless="isWindows">
<description>Move java binaries to work folder</description>
<move todir="./bin">
<fileset dir="dist/bin"/>
</move>
<move todir="./conf">
<fileset dir="dist/conf"/>
</move>
<move todir="./include">
<fileset dir="dist/include"/>
</move>
<move todir="./legal">
<fileset dir="dist/legal"/>
</move>
<move todir="./lib">
<fileset dir="dist/lib"/>
</move>
<move file="dist/release" todir="."/>
<delete dir="dist" failonerror="false"/>
<delete file="jars/swordfish.jar" />
</target>
<target name="dist" depends="link,copyWindows,copyUnix">
<description>Prepare distribution</description>
</target>
</project>