-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
186 lines (162 loc) · 6.95 KB
/
build.xml
File metadata and controls
186 lines (162 loc) · 6.95 KB
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<project name="JFlowMap" basedir="." default="build">
<taskdef resource="proguard/ant/task.properties" classpath="tools/proguard.jar" />
<property file="build.properties" />
<property name="app.name" value="jflowmap" />
<property name="app.version" value="0.16.6" />
<property name="dist.name" value="jflowmap-${app.version}" />
<property name="cert.name" value="JFlowMap" />
<property name="path.src" value="src" />
<property name="path.test" value="test" />
<property name="path.classes" value="bin" />
<property name="path.test.out" value="test.out" />
<property name="path.test.classes" value="${path.test.out}/bin" />
<property name="path.test.reports" value="${path.test.out}/reports" />
<property name="path.lib" value="lib" />
<property name="path.junit" value="tools/junit-4.7.jar" />
<property name="path.build" value="demo" />
<property name="mainclass" value="jflowmap.JFlowMapMain" />
<target name="build">
<antcall target="_build">
<param name="include.applet.meta-inf" value="true" />
</antcall>
</target>
<target name="build-dist-package" depends="build">
<delete failonerror="false" file="${dist.name}.zip" />
<zip destfile="${dist.name}.zip">
<zipfileset dir="demo" prefix="${dist.name}/" includes="**"
excludes="data-proprietary/**, viewconf/proprietary/**, JFlowMap.log,
java.policy.applet" />
</zip>
</target>
<target name="_build" depends="mkdirs, compile, test, make-jar, proguard, add-manifest, chmod-jar-exec" />
<path id="libs-classpath">
<fileset dir="${path.lib}">
<include name="*.jar" />
</fileset>
</path>
<path id="master-classpath">
<path refid="libs-classpath"/>
<pathelement path="${path.classes}" />
</path>
<path id="test-classpath">
<path refid="master-classpath"/>
<pathelement path="${path.junit}"/>
<pathelement path="${path.test.classes}"/>
</path>
<target name="mkdirs">
<mkdir dir="${path.classes}" />
<mkdir dir="${path.test.classes}" />
<mkdir dir="${path.test.reports}" />
<mkdir dir="${path.build}" />
</target>
<target name="compile">
<javac destdir="${path.classes}" failonerror="true" debug="true" target="1.6" includeantruntime="false">
<src path="${path.src}" />
<classpath refid="master-classpath" />
</javac>
<copy todir="${path.classes}" verbose="true">
<fileset dir="${path.src}">
<include name="**/resources/*.*" />
</fileset>
</copy>
</target>
<target name="clean">
<delete includeEmptyDirs="true">
<fileset dir="${path.classes}">
<include name="**/*.class" />
</fileset>
</delete>
</target>
<target name="test">
<javac destdir="${path.test.classes}" failonerror="true" debug="true" target="1.6">
<src path="${path.test}" />
<classpath refid="test-classpath" />
</javac>
<junit printsummary="yes" haltonfailure="yes">
<classpath refid="test-classpath" />
<batchtest fork="yes" todir="${path.test.reports}">
<fileset dir="${path.test}">
<include name="**/*Test*.java"/>
<exclude name="jflowmap/tests_manual/**"/>
</fileset>
<formatter type="plain" usefile="true"/>
</batchtest>
</junit>
<delete dir="${path.test.out}"></delete>
</target>
<target name="proguard">
<proguard configuration="proguard.cfg">
<libraryjar path="${java.home}/lib/rt.jar" />
<injar refid="libs-classpath" filter="!META-INF/**,!extras.manifest,!**/*.jj" />
<injar path="${path.build}/${app.name}-no-libs.jar" />
<outjar path="${path.build}/${app.name}.jar" />
</proguard>
<delete file="${path.build}/${app.name}-no-libs.jar" />
</target>
<target name="make-jar">
<copy file="log4j-prod.properties" tofile="${path.build}/log4j.properties"
overwrite="true" failonerror="false" />
<copy file="log4j-applet.xml" tofile="${path.build}/log4j.xml"
overwrite="true" failonerror="false" />
<jar basedir="." jarfile="${path.build}/${app.name}-no-libs.jar">
<exclude name="**/*" />
<fileset dir="${path.classes}">
<include name="**/*.class" />
<exclude name="**/*Test*.class" />
<exclude name="**/*Test$*.class" />
<include name="**/res/*.*" />
<include name="**/resources/*.*" />
<include name="**/images/*.*" />
</fileset>
<fileset dir="${path.build}">
<include name="log4j.properties" />
<include name="log4j.xml" />
</fileset>
<fileset dir=".">
<include name="license.txt" />
</fileset>
<fileset dir="classes-applets">
<selector if="include.applet.meta-inf">
<or>
<filename name="META-INF/**/*.*" />
</or>
</selector>
</fileset>
</jar>
<delete file="${path.build}/log4j.properties" quiet="true" />
<delete file="${path.build}/log4j.xml" quiet="true" />
</target>
<target name="add-manifest">
<move file="${path.build}/${app.name}.jar" tofile="${path.build}/_${app.name}.jar" />
<jar basedir="." jarfile="${path.build}/${app.name}.jar">
<manifest>
<attribute name="Main-Class" value="${mainclass}" />
</manifest>
<exclude name="**/*" />
<zipgroupfileset file="${path.build}/_${app.name}.jar" />
</jar>
<delete file="${path.build}/_${app.name}.jar" />
</target>
<target name="chmod-jar-exec">
<chmod perm="a+x" file="${path.build}/${app.name}.jar"/>
</target>
<target name="sign-cert-gen">
<exec executable="keytool">
<arg line="-keystore ${sign.keystore.name}" />
<arg line="-storepass ${sign.keystore.pass}" />
<arg line="-genkey -keyalg rsa -validity 1095" />
<arg line="-alias ${app.name}" />
<arg line="-keypass ${sign.keystore.pass}" />
<arg line="-dname "CN=Ilya Boyandin, OU=, O=University of Fribourg, L=Fribourg, C=CH"" />
</exec>
</target>
<target name="sign">
<echo>Signing ${path.build}/${app.name}.jar</echo>
<exec executable="jarsigner">
<arg line="-keystore ${sign.keystore.name}" />
<arg line="-storepass ${sign.keystore.pass}" />
<arg line="${path.build}/${app.name}.jar" />
<arg line="${cert.name}" />
</exec>
</target>
</project>