-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
93 lines (84 loc) · 3.48 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
<?xml version="1.0"?>
<project name="fling" default="build">
<property name="project.name" value="fling" />
<property name="project.version" value="1.2.0" />
<target name="clean" description="Remove all generated files">
<delete dir="build" />
</target>
<target name="compile" description="Compile the program">
<mkdir dir="build/classes/main" />
<javac
srcdir="src/main"
destdir="build/classes/main"
compiler="modern"
target="8"
source="8"
encoding="utf8"
debug="on"
debuglevel="lines,vars,source"
includeantruntime="false">
<classpath>
<fileset dir="lib" includes="*.jar" excludes="*sources.jar"/>
</classpath>
<compilerarg value="-Xlint" />
<compilerarg value="-Xdiags:verbose" />
</javac>
</target>
<target name="compile-test" description="Compile the tests" depends="compile">
<mkdir dir="build/classes/test" />
<javac
srcdir="src/test"
destdir="build/classes/test"
encoding="utf8"
debug="on"
debuglevel="lines,vars,source"
includeantruntime="false">
<classpath>
<pathelement path="build/classes/main"/>
<fileset dir="lib" includes="*.jar" excludes="*sources.jar"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile" description="Create a jar">
<jar destfile="build/artifacts/fling-${project.version}.jar">
<zipgroupfileset dir="lib" includes="jchalk*.jar" excludes="*sources.jar"/>
<fileset dir="build/classes/main" includes="**/*.class" />
<manifest>
<attribute name="Main-Class" value="io.github.sindrets.fling.Main" />
<attribute name="Implementation-Title" value="${project.name}" />
<attribute name="Implementation-Version" value="${project.version}" />
</manifest>
</jar>
<jar destfile="build/artifacts/fling-${project.version}-sources.jar">
<fileset dir="src/main" includes="**/*.java" />
<manifest>
<attribute name="Main-Class" value="io.github.sindrets.fling.Main" />
<attribute name="Implementation-Title" value="${project.name}" />
<attribute name="Implementation-Version" value="${project.version}" />
</manifest>
</jar>
</target>
<target name="zip" description="Create a zip">
<delete file="build/artifacts/fling-${project.version}.zip"/>
<mkdir dir="build/artifacts" />
<zip destfile="build/artifacts/fling-${project.version}.zip">
<zipfileset dir=".">
<exclude name="build/**"/>
</zipfileset>
</zip>
</target>
<target name="watch">
<exec executable="sh">
<arg value="-c"/>
<arg value="while sleep 1; do find src -path '*.java' | entr -ds 'ant jar'; done"/>
</exec>
</target>
<target name="test" depends="compile-test" description="Run tests">
<java jar="bin/fling-1.2.0.jar" failonerror="true" fork="true">
<arg value="build/classes/main:build/classes/test:lib/jchalk-1.1.0.jar"/>
<arg value="--exclude=**/mock/*" />
<arg value="--loglevel=3" />
</java>
</target>
<target name="build" depends="jar,test" />
</project>