-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.xml
executable file
·101 lines (86 loc) · 3.64 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
<?xml version="1.0" encoding="utf-8" ?>
<project default="compile">
<!-- build.xml for github.com/UCSB-CS56-Projects/cs56-games-fish-animation
original author : Lawrence Khuu for CS56, S11
updated : Christina Morris, Mathew Glodack for CS56, S13
updated : Casey Barbello, Daryl Pham for CS56, S13
updated : Jenna Cryan, Josephine Vo for CS56, W14
-->
<property environment="env" />
<!-- load the environment variables
-->
<property name="webRoot" value="${env.HOME}/public_html/cs56" />
<property name="webBaseURL" value="http://www.cs.ucsb.edu/~${env.USER}/cs56" />
<property name="project" value="cs56_games_fish_animation" />
<property name="fullPkg" value="edu.ucsb.cs56.projects.games.fish_animation"/>
<property name="javadocDest" value="${webRoot}/${project}/docs/javadoc" />
<property name="javadocURL" value="${webBaseURL}/${project}/docs/javadoc" />
<property name="mainClass" value="${fullPkg}/Menu" />
<property name="envClass" value="${fullPkg}/FishEnvironment" />
<path id="project.class.path">
<pathelement location="build"/>
<pathelement location="lib/junit-4.12.jar"/>
</path>
<target name="run" depends="compile" description="runs FishAnimation">
<java classname="${mainClass}" fork="true">
<classpath refid="project.class.path"/>
</java>
</target>
<target name="runEnv" depends="compile" description="runs FishEnvironment">
<java classname="${envClass}" fork="true">
<classpath refid="project.class.path"/>
</java>
</target>
<target name="compile" description="compiles my code">
<mkdir dir="build" />
<javac srcdir="src" destdir="build" debug="true" debuglevel="lines,source" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<copy todir="build/resources">
<fileset dir="resources" includes="**/*"/>
</copy>
</target>
<target name="clean" description="removes unnessessary files">
<delete failonerror="false" verbose="true">
<fileset dir="build" includes="*.class" />
</delete>
<delete dir="javadoc" quiet="true" />
</target>
<target name="jar" depends="compile">
<mkdir dir="build/dist"/>
<manifestclasspath property="jar.class.path" jarfile="build/dist/cs_56_fish_animation.jar">
<classpath refid="project.class.path"/>
</manifestclasspath>
<jar destfile="build/dist/cs_56_fish_animation.jar" basedir="build/edu">
<fileset dir="src">
<exclude name="**/*.java" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${mainClass}"/>
<attribute name="Class-Path" value="${jar.class.path}"/>
</manifest>
</jar>
</target>
<target name="run-from-jar" depends="jar">
<java fork="true" classname="${mainClass}">
<classpath>
<pathelement location="build/dist/cs_56_fish_animation.jar"/>
</classpath>
</java>
</target>
<target name="javadoc" depends="compile" description="publish javadoc">
<delete dir="docs/javadoc" quiet="true" />
<javadoc destdir="docs/javadoc" author="true" version="true" use="true" >
<fileset dir="src" includes="**/*.java"/>
<classpath refid="project.class.path" />
</javadoc>
<delete quiet="true" dir="${javadocDest}" />
<copy todir="${javadocDest}" >
<fileset dir="docs/javadoc"/>
</copy>
<chmod dir="${javadocDest}" perm="755" type="dir" includes="**" />
<chmod dir="${javadocDest}" perm="755" type="file" includes="**/*" />
<echo>Javadoc deployed to ${javadocURL} if on CSIL</echo>
<echo> or if not on CSIL, try file:///${javadocDest}/index.html</echo>
</target>
</project>