-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
157 lines (136 loc) · 6.15 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="tinybinding" default="dist" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus">
<description>
This buildfile is part of tinybinding. It is the main entry point that contains
the common tasks and can be called on to run the main aspects of all the sub-scripts.
</description>
<property name="build.compiler" value="javac1.6" />
<!-- resolve -->
<property name="ivy.retrieve.pattern" value="lib/[conf]/[artifact].[ext]" />
<available file="lib/ivyplusplus.jar" property="ivyplusplus.available" />
<target name="download-ipp" unless="ivyplusplus.available">
<mkdir dir="lib" />
<get src="http://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" usetimestamp="true" />
</target>
<target name="ensure-ipp" depends="download-ipp">
<taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" />
</target>
<target name="config-ivy" depends="ensure-ipp">
<ivy:configure file="buildScripts/ivysettings.xml" />
</target>
<target name="deps" depends="ensureBuildDeps, ensureRuntimeDeps, ensureTestDeps, ensureContribDeps" description="Downloads all dependencies." />
<target name="ensureBuildDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="build" />
<ivy:retrieve />
</target>
<target name="ensureRuntimeDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="runtime" />
<ivy:retrieve />
</target>
<target name="ensureTestDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="test" />
<ivy:retrieve />
</target>
<target name="ensureContribDeps" depends="config-ivy" description="Downloads various non-crucial documentation, sources, etc ">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="contrib" />
<ivy:retrieve />
</target>
<!-- IDE integration -->
<target name="eclipse" depends="deps" description="Creates eclipse project files and downloads all dependencies. Open this directory as project in eclipse after running this target.">
<ivy:eclipsegen source="1.6">
<srcdir dir="src/main/java" />
<srcdir dir="src/test/java" />
<conf name="build" sources="contrib" />
<conf name="test" sources="contrib" />
<settings>
<url url="http://cloud.github.com/downloads/peichhorn/tinybinding/tinybinding.eclipse.settings" />
</settings>
</ivy:eclipsegen>
<copy file="buildScripts/[tinybinding] clean + dist.template" tofile="[tinybinding] clean + dist.launch" preservelastmodified="true" overwrite="true">
</copy>
</target>
<!-- clean -->
<target name="clean" description="Removes all generated files.">
<delete dir="build" quiet="true" />
</target>
<target name="distclean" depends="clean" description="Deletes everything that this build script has ever generated.">
<delete dir="lib" quiet="true" />
<delete dir="dist" quiet="true" />
<delete file=".project" quiet="true" />
<delete file=".classpath" quiet="true" />
<delete dir=".settings" quiet="true" />
</target>
<!-- compile -->
<path id="build.path">
<fileset dir="lib/build">
<include name="*.jar" />
</fileset>
</path>
<target name="compile" depends="ensureBuildDeps" description="Compiles the code.">
<ivy:compile destdir="build/tinybinding" source="1.6" target="1.6" includeantruntime="false">
<src path="src/main/java" />
<classpath location="build/tinybinding" />
<classpath refid="build.path" />
</ivy:compile>
</target>
<!-- version -->
<target name="version" depends="ensure-ipp" description="Shows the version number." unless="tinybinding.version">
<mkdir dir="build/tinybinding" />
<javac includeDestClasses="false" srcdir="src/main/java" debug="on" destdir="build/tinybinding" source="1.6" target="1.6" includes="de/fips/util/tinybinding/Version.java" includeantruntime="false" />
<java classname="de.fips.util.tinybinding.Version" classpath="build/tinybinding" failonerror="true" output="build/version.txt" />
<ivy:loadversion property="tinybinding.version" file="build/version.txt" />
<echo level="info">tinybinding version: ${tinybinding.version}</echo>
</target>
<!-- dist -->
<target name="dist" description="Builds THE tinybinding.jar file which contains everything." depends="compile, version">
<mkdir dir="dist" />
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="lib/build/jarjar.jar" />
<jarjar destfile="dist/tinybinding.jar">
<fileset dir="build/tinybinding" />
<zipfileset src="lib/build/fest-reflect.jar">
<exclude name="**/constructor/**" />
<exclude name="**/field/*StaticField*" />
<exclude name="**/method/*StaticMethod*" />
<exclude name="**/innerclass/**" />
</zipfileset>
<zipfileset src="lib/build/fest-util.jar">
<include name="**/*Array*.class" />
<include name="**/*String*.class" />
<include name="**/*Object*.class" />
</zipfileset>
<rule pattern="org.fest.**" result="de.fips.util.tinybinding.lib.org.fest.@1" />
<fileset dir="." includes="LICENSE" />
<fileset dir="." includes="FEST_LICENSE" />
</jarjar>
<property name="tinybinding.dist.built" value="true" />
</target>
<!-- test -->
<path id="test.path">
<fileset dir="lib/test">
<include name="*.jar" />
</fileset>
</path>
<target name="test-compile" depends="ensureTestDeps, compile" unless="skipTests">
<mkdir dir="build/tests" />
<ivy:compile destdir="build/tests" source="1.6" target="1.6" includeantruntime="false">
<classpath refid="test.path" />
<classpath refid="build.path" />
<classpath path="build/tinybinding" />
<src path="src/test/java" />
</ivy:compile>
</target>
<target name="test" depends="test-compile, dist" unless="tests.skip" description="Runs the tests.">
<junit haltonfailure="yes" fork="true">
<formatter type="plain" usefile="false" unless="tests.quiet" />
<classpath refid="test.path" />
<classpath path="dist/tinybinding.jar" />
<classpath path="build/tests" />
<batchtest>
<fileset dir="src/test/java">
<include name="**/*Test*.java" />
</fileset>
</batchtest>
</junit>
<echo level="info">All tests successful.</echo>
</target>
</project>