forked from henrikor2/bridlensis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
131 lines (118 loc) · 4.83 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
<project name="BridleNSIS" default="build">
<loadfile property="bridle.version"
srcfile="src/main/resources/bridlensis/VERSION" />
<property name="bridle.nsis.home" value="" />
<property name="bridle.java.version" value="1.7" />
<property name="bridle.jar.file" value="BridleNSIS-${bridle.version}.jar" />
<path id="main.classpath">
<pathelement location="build/classes/main" />
<pathelement location="build/resources/main" />
<pathelement location="${ant.home}/lib/ant.jar" />
</path>
<path id="test.classpath">
<pathelement location="build/classes/test" />
<pathelement location="build/resources/test" />
<path refid="main.classpath" />
<pathelement location="lib/junit-4.11.jar" />
<pathelement location="lib/hamcrest-core-1.3.jar" />
</path>
<path id="doc.classpath">
<pathelement location="build/classes/doc" />
<pathelement location="build/resources/doc" />
<path refid="main.classpath" />
<pathelement location="lib/markdown4j-2.2.jar" />
</path>
<target name="build">
<echo message="Build BridleNSIS ${bridle.version}" />
<antcall target="classes" />
<antcall target="test" />
<antcall target="jar" />
<antcall target="doc" />
<antcall target="installer" />
</target>
<target name="classes">
<compileClasses src="main" />
</target>
<target name="test">
<compileClasses src="test" />
<mkdir dir="build/test-results" />
<junit printsummary="true" haltonfailure="true">
<formatter type="plain" />
<batchtest fork="yes" todir="build/test-results">
<fileset dir="src/test/java" includes="**/*Test.java" />
</batchtest>
<classpath refid="test.classpath" />
</junit>
</target>
<target name="jar">
<mkdir dir="build/libs" />
<jar destfile="build/libs/${bridle.jar.file}">
<fileset dir="build/classes/main" />
<fileset dir="build/resources/main" />
<manifest>
<attribute name="Implementation-Title" value="BridleNSIS" />
<attribute name="Implementation-Version"
value="${bridle.version}" />
<attribute name="Main-Class"
value="bridlensis.MakeBridleNSIS" />
</manifest>
</jar>
</target>
<target name="doc">
<compileClasses src="doc" />
<java classname="bridlensis.doc.HTMLConvert"
fork="true"
failonerror="true"
classpathref="doc.classpath">
<arg value="build/doc" />
</java>
</target>
<target name="installer">
<mkdir dir="build/inst/Example" />
<copy todir="build/inst/Example" overwrite="true">
<fileset dir="src/inst" />
</copy>
<copy todir="build/inst" overwrite="true">
<fileset dir="." includes="LICENSE" />
<fileset dir="build/libs" includes="${bridle.jar.file}" />
<fileset dir="build/doc" includes="*.html" />
</copy>
<replace file="build/inst/Example/MakeInstaller.bat"
token="@BRIDLE_VERSION@"
value="${bridle.version}" />
<taskdef name="bridle"
classname="bridlensis.ApacheAntTask"
classpathref="main.classpath" />
<bridle file="build/inst/Example/Installer.nsi"
dir="."
nsishome="${bridle.nsis.home}"
encoding="Cp1252"
failOnError="true"
resultProperty="makebridle.result">
<nsisoption value="/DBRIDLE_HOME=${basedir}\build\inst" />
<nsisoption value="/DBRIDLE_VERSION=${bridle.version}" />
</bridle>
<echo message="makebridle.result=${makebridle.result}" />
</target>
<target name="clean">
<delete dir="build" />
</target>
<macrodef name="compileClasses">
<attribute name="src" />
<sequential>
<mkdir dir="build/classes/@{src}" />
<mkdir dir="build/resources/@{src}" />
<copy todir="build/resources/@{src}" overwrite="true">
<fileset dir="src/@{src}/resources" />
</copy>
<javac destdir="build/classes/@{src}"
source="${bridle.java.version}"
target="${bridle.java.version}"
debug="on"
includeAntRuntime="false">
<src path="src/@{src}/java" />
<classpath refid="@{src}.classpath" />
</javac>
</sequential>
</macrodef>
</project>