forked from vincenicoara/W16-lab04
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
334 lines (261 loc) · 12.1 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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
<project default="compile">
<!-- build.xml for lab04, w16, CS56
author: Phill Conrad
Note: for this lab, you should not need to edit this file -->
<property environment="env"/> <!-- load the environment variables -->
<property name="username" value="${env.USER}"/> <!-- username -->
<property name="packagePrefix" value="edu.ucsb.cs56.w16.drawings" />
<property name="pconradPackage" value="${packagePrefix}.pconrad" />
<property name="myPackage"
value="${packagePrefix}.${username}" />
<property name="webRoot" value="${env.HOME}/public_html/cs56" />
<property name="webBaseURL" value="http://www.cs.ucsb.edu/~${env.USER}/cs56" />
<property name="projectName" value="W16-lab04" />
<property name="javadocDest" value="${webRoot}/${projectName}/javadoc" />
<property name="javadocURL" value="${webBaseURL}/${projectName}/javadoc" />
<property name="imagesDest" value="${webRoot}/${projectName}/images" />
<property name="imagesURL" value="${webBaseURL}/${projectName}/images" />
<property name="javadocLink" value="http://java.sun.com/javase/7/docs/api/" />
<!-- The following property will be used by the grader; grader
can change it from csilusername to whomever grader is grading in that
moment. -->
<property name="studentName" value="csilusername"/>
<path id="project.class.path">
<pathelement location="build"/>
<pathelement location="lib/junit-4.8.2.jar"/>
</path>
<target name="compile" description="compile my code">
<mkdir dir="build" />
<javac srcdir="src" destdir="build" debug="true" debuglevel="lines,source"
includeantruntime="false" >
<classpath refid="project.class.path" />
</javac>
</target>
<target name="javadoc" depends="compile" description="publish javadoc">
<delete dir="javadoc" quiet="true" />
<javadoc destdir="javadoc" author="true" version="true" use="true" >
<fileset dir="src" includes="**/*.java"/>
<classpath refid="project.class.path" />
<link href="${javadocLink}" /> <!-- for external links to std API classes -->
</javadoc>
<!-- delete the old javadoc -->
<delete quiet="true" dir="${javadocDest}" />
<!-- copy everything you just made to the javadoc destination,
and then make it readable -->
<copy todir="${javadocDest}" >
<fileset dir="javadoc"/>
</copy>
<!-- Note: this only does the chmod command on the javadoc
subdirectory and its contents. You MIGHT have to MANUALLY do the
chmod on the parent directories. However, you should only need to do
that once.
-->
<chmod dir="${javadocDest}" perm="755" type="dir" includes="**" />
<chmod dir="${javadocDest}" perm="755" type="file" includes="**/*" />
<echo>Javadoc deployed to ${javadocURL}</echo>
<echo> or if not on CSIL, try file://${javadocDest}/index.html</echo>
</target>
<target name="test" depends="compile" description="run junit tests">
<junit haltonerror="no" haltonfailure="no">
<classpath refid="project.class.path" />
<batchtest fork="yes">
<fileset dir="src">
<!-- this will pick up every class with a name ending in Test -->
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<formatter type="plain" usefile="false" />
</junit>
</target>
<target name="clean" description="delete unnecessary files and directories">
<delete dir="build" failonerror="false" verbose="true" />
<mkdir dir="build" />
<delete dir="javadoc" failonerror="false" verbose="true" /> <!-- the local copy -->
<mkdir dir="javadoc" />
</target>
<target name="pconradSimpleGui1" depends="compile"
description="run simpleGui1 from pconrad subdirectory">
<java fork="true" classpathref="project.class.path"
classname="${pconradPackage}.SimpleGui1" />
</target>
<target name="mySimpleGui1" depends="compile"
description="run simpleGui1 from ${env.USER} subdirectory">
<java fork="true" classpathref="project.class.path"
classname="${myPackage}.SimpleGui1" />
</target>
<target name="pconradPV" depends="compile"
description="run from PictureViewer from pconrad subdirectory">
<java fork="true" classpathref="project.class.path" classname="${pconradPackage}.simple.PictureViewer" />
</target>
<target name="pconradMPV" depends="compile"
description="run MultiPictureViewer from pconrad subdir with no arg">
<java fork="true" classpathref="project.class.path" classname="${pconradPackage}.advanced.MultiPictureViewer" />
</target>
<target name="pconradMPV2" depends="compile"
description="run MultiPictureViewer from pconrad subdir with arg 2">
<java fork="true" classpathref="project.class.path" classname="${pconradPackage}.advanced.MultiPictureViewer">
<arg value="2" />
</java>
</target>
<target name="pconradMPV3" depends="compile"
description="run MultiPictureViewer from pconrad subdir with arg 3">
<java fork="true" classpathref="project.class.path" classname="${pconradPackage}.advanced.MultiPictureViewer">
<arg value="3" />
</java>
</target>
<!-- ****************** FOR GRADING HERE ************** -->
<target name="gradeSimpleGui1" depends="compile"
description="run simpleGui1 for student in studentName property">
<java fork="true" classpathref="project.class.path"
classname="${packagePrefix}.${studentName}.SimpleGui1" />
</target>
<target name="gradePV" depends="compile"
description="run simple.PictureViewer for student in studentName property">
<java fork="true"
classpathref="project.class.path"
classname="${packagePrefix}.${studentName}.simple.PictureViewer" />
</target>
<target name="gradeMPV1" depends="compile"
description="run MultiPictureViewer for studentName with arg 1">
<java fork="true" classpathref="project.class.path" classname="${packagePrefix}.${studentName}.advanced.MultiPictureViewer">
<arg value="1" />
</java>
</target>
<target name="gradeMPV2" depends="compile"
description="run MultiPictureViewer for studentName with arg 2">
<java fork="true" classpathref="project.class.path" classname="${packagePrefix}.${studentName}.advanced.MultiPictureViewer">
<arg value="2" />
</java>
</target>
<target name="gradeMPV3" depends="compile"
description="run MultiPictureViewer for studentName with arg 3">
<java fork="true" classpathref="project.class.path" classname="${packagePrefix}.${studentName}.advanced.MultiPictureViewer">
<arg value="3" />
</java>
</target>
<!-- ****************** END GRADING SECTION ************** -->
<target name="pconradWPTF1" depends="compile"
description="run WritePictureToFile from pconrad;create images/pic1">
<mkdir dir="images" />
<java fork="true" classpathref="project.class.path" classname="${pconradPackage}.advanced.WritePictureToFile" >
<arg value="1" />
<arg value="images/pic1" />
</java>
<copy todir="${imagesDest}" >
<fileset dir="images"/>
</copy>
<chmod dir="${webRoot}" type="dir" perm="ugo+rx" includes="**"/>
<chmod dir="${webRoot}" type="file" perm="ugo+rx" includes="**/*"/>
<echo>images/pic1 online at ${imagesURL}/images/pic1.png</echo>
</target>
<target name="pconradWPTF2" depends="compile"
description="run WritePictureToFile from pconrad;create images/pic2">
<mkdir dir="images" />
<java fork="true" classpathref="project.class.path" classname="${pconradPackage}.advanced.WritePictureToFile" >
<arg value="2" />
<arg value="images/pic2" />
</java>
<copy todir="${imagesDest}" >
<fileset dir="images"/>
</copy>
<chmod dir="${webRoot}" type="dir" perm="ugo+rx" includes="**"/>
<chmod dir="${webRoot}" type="file" perm="ugo+rx" includes="**/*"/>
<echo>images/pic2 online at ${imagesURL}/images/pic2.png</echo>
</target>
<target name="pconradWPTF3" depends="compile"
description="run WritePictureToFile from pconrad;create images/pic3">
<mkdir dir="images" />
<java fork="true" classpathref="project.class.path" classname="${pconradPackage}.advanced.WritePictureToFile" >
<arg value="3" />
<arg value="images/pic3" />
</java>
<copy todir="${imagesDest}" >
<fileset dir="images"/>
</copy>
<chmod dir="${webRoot}" type="dir" perm="ugo+rx" includes="**"/>
<chmod dir="${webRoot}" type="file" perm="ugo+rx" includes="**/*"/>
<echo>images/pic3 online at ${imagesURL}/images/pic3.png</echo>
</target>
<target name="myPV" depends="compile"
description="run from PictureViewer from ${env.USER} subdirectory">
<java fork="true"
classpathref="project.class.path"
classname="${myPackage}.simple.PictureViewer" />
</target>
<target name="myMPV" depends="compile"
description="run MultiPictureViewer from ${env.USER} subdir, no arg">
<java fork="true" classpathref="project.class.path"
classname="${myPackage}.advanced.MultiPictureViewer" />
</target>
<target name="myAnim" depends="compile"
description="run AnimatedPictureViewer from ${env.USER} subdir">
<java fork="true" classpathref="project.class.path"
classname="${myPackage}.advanced.AnimatedPictureViewer" />
</target>
<target name="jakeAnim" depends="compile"
description="Jake's example Pencil animation (jstaahl)">
<java fork="true" classpathref="project.class.path"
classname="edu.ucsb.cs56.w16.drawings.jstaahl.advanced.AnimatedPictureViewer" />
</target>
<target name="andrewAnim" depends="compile"
description="Andrews' example iPod animation (andrewberls)">
<java fork="true" classpathref="project.class.path"
classname="edu.ucsb.cs56.w16.drawings.andrewberls.advanced.AnimatedPictureViewer" />
</target>
<target name="myMPV2" depends="compile"
description="run MultiPictureViewer from ${env.USER} subdir, arg 2">
<java fork="true" classpathref="project.class.path"
classname="${myPackage}.advanced.MultiPictureViewer">
<arg value="2" />
</java>
</target>
<target name="myMPV3" depends="compile"
description="run MultiPictureViewer from ${env.USER} subdir, arg 3">
<java fork="true" classpathref="project.class.path"
classname="${myPackage}.advanced.MultiPictureViewer">
<arg value="3" />
</java>
</target>
<target name="myWPTF1" depends="compile"
description="run WritePictureToFile from my code;create images/mypic1">
<mkdir dir="images" />
<java fork="true" classpathref="project.class.path" classname="${myPackage}.advanced.WritePictureToFile" >
<arg value="1" />
<arg value="images/mypic1" />
</java>
<copy todir="${imagesDest}" >
<fileset dir="images"/>
</copy>
<chmod dir="${webRoot}" type="dir" perm="ugo+rx" includes="**"/>
<chmod dir="${webRoot}" type="file" perm="ugo+rx" includes="**/*"/>
<echo>images/mypic1 online at ${imagesURL}/mypic1.png</echo>
</target>
<target name="myWPTF2" depends="compile"
description="run WritePictureToFile from my code;create images/mypic2">
<mkdir dir="images" />
<java fork="true" classpathref="project.class.path" classname="${myPackage}.advanced.WritePictureToFile" >
<arg value="2" />
<arg value="images/mypic2" />
</java>
<copy todir="${imagesDest}" >
<fileset dir="images"/>
</copy>
<chmod dir="${webRoot}" type="dir" perm="ugo+rx" includes="**"/>
<chmod dir="${webRoot}" type="file" perm="ugo+rx" includes="**/*"/>
<echo>images/mypic2 online at ${imagesURL}/mypic2.png</echo>
</target>
<target name="myWPTF3" depends="compile"
description="run WritePictureToFile from my code;create images/mypic3">
<mkdir dir="images" />
<java fork="true" classpathref="project.class.path" classname="${myPackage}.advanced.WritePictureToFile" >
<arg value="3" />
<arg value="images/mypic3" />
</java>
<copy todir="${imagesDest}" >
<fileset dir="images"/>
</copy>
<chmod dir="${webRoot}" type="dir" perm="ugo+rx" includes="**"/>
<chmod dir="${webRoot}" type="file" perm="ugo+rx" includes="**/*"/>
<echo>images/mypic3 online at ${imagesURL}/mypic3.png</echo>
</target>
</project>