forked from EduMIPS64/edumips64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·262 lines (242 loc) · 8.49 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
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<!-- build.xml
ant build file for EduMIPS64.
(c) 2006-2011 Andrea Spadaccini and the EduMIPS64 dev team.
Useful targets:
- debugjar builds the GUI version (edumips64-debug.jar) with debug symbols
- jar builds the GUI version (edumips64-VERSION.jar) without debug symbols
- clijar builds the CLI version
- clean removes the jar file and the build dir
-->
<project name="edumips64" default="debugjar" basedir=".">
<target name="init">
<!-- Access the environment -->
<property environment="env" />
<property name="base.classpath" value="${env.CLASSPATH}" />
<!-- Set build file properties -->
<property name="sourceDir" value="." />
<property name="helpClassesDir" value="./libs" />
<property name="version" value="0.5.4" />
<property name="outputDir" value="edumips" />
<property name="tarbz2File" value="edumips64-${version}.tar.bz2" />
<property name="debug_jar_filename" value="edumips64-debug.jar" />
<property name="release_jar_filename" value="edumips64-${version}.jar" />
<property name="cli_jar_filename" value="edumips64-${version}-cli.jar" />
</target>
<target name="mkdirs" depends="init">
<!-- Create directories for the compilation process. -->
<mkdir dir="${outputDir}" />
<mkdir dir="${outputDir}/edumips64/img" />
<mkdir dir="${outputDir}/edumips64/data" />
<mkdir dir="${outputDir}/edumips64/utils" />
<mkdir dir="${outputDir}/edumips64/help" />
<mkdir dir="${outputDir}/edumips64/help_en" />
<mkdir dir="${outputDir}/edumips64/help_it" />
</target>
<!-- *** clean *** target that cleans the built files and the build directory-->
<target name="clean">
<delete file="${release_jar_filename}" />
<delete file="${debug_jar_filename}" />
<delete dir="${outputDir}" />
</target>
<!-- *** javadoc *** build the javadoc -->
<target name="javadoc" depends="mkdirs">
<mkdir dir="${outputDir}/docs" />
<javadoc
destdir="${outputDir}/docs"
author="true"
version="true"
use="true"
sourcepath="."
classpath="${sourceDir}/.."
packagenames="edumips64.*"/>
</target>
<target name="tests" depends="mkdirs">
<javac
target="5"
srcdir="${sourceDir}"
classpath="${base.classpath}:${helpClassesDir}"
destdir="${outputDir}"
nowarn="yes"
debug="on"
includeantruntime="false"
debuglevel="lines,vars,source"/>
<junit printsummary="true">
<classpath>
<pathelement path="${base.classpath}"/>
</classpath>
<classpath>
<pathelement path="${outputDir}"/>
</classpath>
<test name="edumips64.tests.CpuTests">
<formatter type="plain" usefile="false"/>
</test>
</junit>
</target>
<!-- *** debugjar *** compile with debug information and set the jar
filename to edumips64-debug.jar -->
<target name="debugjar" depends="mkdirs">
<javac
target="5"
srcdir="${sourceDir}"
excludes="tests/**"
classpath="${helpClassesDir}"
destdir="${outputDir}"
nowarn="yes"
debug="on"
includeantruntime="false"
debuglevel="lines,vars,source"/>
<property name="app_type" value="GUI" />
<property name="jar_filename" value="${debug_jar_filename}" />
<antcall target="makeGUIJar" />
</target>
<!-- *** jar *** compile without debug information and set the jar
filename to edumips64-VERSION.jar -->
<target name="jar" depends="mkdirs">
<javac
target="5"
srcdir="${sourceDir}"
excludes="tests/**"
classpath="${helpClassesDir}"
destdir="${outputDir}"
includeantruntime="false"
nowarn="yes"/>
<property name="app_type" value="GUI" />
<property name="jar_filename" value="${release_jar_filename}" />
<antcall target="makeGUIJar" />
</target>
<!-- *** clijar *** compile with debug information, set the CLI Main and set the jar
filename to edumips64-VERSION.jar -->
<target name="clijar" depends="mkdirs">
<javac
target="5"
srcdir="${sourceDir}"
excludes="${sourceDir}/tests/**"
classpath="${helpClassesDir}"
destdir="${outputDir}"
nowarn="yes"
debug="on"
includeantruntime="false"
debuglevel="lines,vars,source"/>
<property name="app_type" value="CLI" />
<property name="jar_filename" value="${release_jar_filename}" />
<antcall target="makeCLIJar" />
</target>
<!-- TODO: remove duplicated code between makeCLIJar and makeGUIjar -->
<target name="makeCLIJar">
<copy todir="${outputDir}/edumips64/img">
<fileset dir="img">
<include name="**/*.png" />
</fileset>
</copy>
<copy todir="${outputDir}/edumips64/data">
<fileset dir="data">
<include name="**/*.txt" />
</fileset>
</copy>
<copy todir="${outputDir}/edumips64/utils">
<fileset dir="utils">
<include name="**/*.properties" />
</fileset>
</copy>
<jar destfile="${cli_jar_filename}" basedir="${outputDir}">
<manifest>
<attribute name="Main-Class" value="edumips64.MainCLI"/>
</manifest>
</jar>
<signjar jar="${cli_jar_filename}" keystore="key-edumips" storepass="123456" keypass="123456" alias="edumips64" />
<delete dir="${outputDir}" />
</target>
<target name="makeGUIJar">
<!-- Help -->
<copy todir="${outputDir}/edumips64/help/en/html">
<fileset dir="docs/en/output/html">
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="${outputDir}/edumips64/help/en">
<fileset dir="docs/en/javahelp">
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="${outputDir}/edumips64/help/it/html">
<fileset dir="docs/it/output/html">
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="${outputDir}/edumips64/help/it/img">
<fileset dir="docs/img">
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="${outputDir}/edumips64/help/en/img">
<fileset dir="docs/img">
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="${outputDir}/edumips64/help/it">
<fileset dir="docs/it/javahelp">
<include name="**/*.*" />
</fileset>
</copy>
<!-- Other things -->
<copy todir="${outputDir}/edumips64/img">
<fileset dir="img">
<include name="**/*.png" />
</fileset>
</copy>
<copy todir="${outputDir}/edumips64/data">
<fileset dir="data">
<include name="**/*.txt" />
</fileset>
</copy>
<copy todir="${outputDir}/edumips64/utils">
<fileset dir="utils">
<include name="**/*.properties" />
</fileset>
</copy>
<copy todir="${outputDir}/com">
<fileset dir="libs/com">
<include name="**/*.class" />
</fileset>
</copy>
<copy todir="${outputDir}/javax">
<fileset dir="libs/javax">
<include name="**/*.class" />
</fileset>
</copy>
<!--<copy todir="${outputDir}/edumips64/help">
<fileset dir="help">
<include name="**/*.*" />
</fileset>
</copy>-->
<!--
<copy todir="${outputDir}/edumips64/help_it">
<fileset dir="help_it">
<include name="**/*.*" />
</fileset>
</copy>
-->
<jar destfile="${jar_filename}" basedir="${outputDir}">
<manifest>
<attribute name="Main-Class" value="edumips64.Main"/>
<attribute name="SplashScreen-Image" value="edumips64/img/splash.png"/>
</manifest>
</jar>
<signjar jar="${jar_filename}" keystore="key-edumips" storepass="123456" keypass="123456" alias="edumips64" />
<delete dir="${outputDir}" />
</target>
<target name="src-release" depends="init">
<mkdir dir="edumips64" />
<copy todir="edumips64/">
<fileset dir=".">
<include name="**/*" />
<exclude name="**/*.jar" />
<exclude name="${outputDir}" />
<exclude name="edumips64" />
<exclude name="**/*.tbz2" />
</fileset>
</copy>
<tar destfile="${tarbz2File}" basedir="." includes="edumips64/" compression="bzip2" />
<delete dir="edumips64" />
</target>
</project>