-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
executable file
·101 lines (90 loc) · 4.13 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 name="GamesmanWeb" default="all">
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss"/>
</tstamp>
<description>
Compile and package GamesmanWeb into a distributable WAR file
</description>
<!-- variables -->
<property name="src" location="src"/>
<property name="deploy" location="deploy"/>
<property name="lib" location="${deploy}/WEB-INF/lib"/>
<property name="build" location="${deploy}/WEB-INF/classes"/>
<property name="dist" location="."/>
<property name="deploy-applet" location="${deploy}/ui/applets"/>
<!-- targets -->
<target name="all" depends="compile, applets, war"/>
<target name="rebuild" depends="clean, compile, war"/>
<target name="war" depends="compile, applets" description="Package a WAR file">
<delete file="${dist}/gcweb.war"/>
<war destfile="${dist}/gcweb.war" basedir="${deploy}"
webxml="${deploy}/WEB-INF/web.xml" includes="**"
excludes="**/.* **/.*/* **/servlet-api.jar **/jsp-api.jar"/>
</target>
<target name="compile" description="Compile the GCWeb classes">
<mkdir dir="${build}"/>
<javac classpath="${lib}/asm-3.1.jar:${lib}/jersey-core-1.0.jar:${lib}/jersey-server-1.0.jar:${lib}/json.jar:${lib}/jsr311-api-1.0.jar:${lib}/servlet-api.jar:${lib}/jsp-api.jar:${lib}/libthrift.jar:${lib}/slf4j-api-1.5.8.jar:${lib}/slf4j-nop-1.5.8.jar"
sourcepath="" srcdir="${src}" destdir="${build}"
source="1.6" target="1.6" excludes="src build.xml">
<include name="edu/berkeley/gcweb/**/*.java"/>
<exclude name="**/tests/*.java"/>
<exclude name="**/gui/**/*.java"/>
</javac>
</target>
<target name="clean" depends="clean-applets"
description="Clean the build directories">
<delete dir="${build}"/>
</target>
<target name="applets" depends="jar-gamescubeman, jar-oskarscube" />
<target name="clean-applets" depends="clean-applet-source">
<delete dir="${appletdestdir}"/>
</target>
<target name="compile-applets" description="Compiles Java applets">
<javac source="1.6" target="1.6" srcdir="${src}/edu/berkeley/gcweb/gui/"
classpath="${src}/edu/berkeley/gcweb/gui/gamescubeman/plugin.jar:${src}/"
debug="true" debuglevel="lines,vars,source">
<compilerarg value="-Xlint:unchecked"/></javac>
</target>
<target name="jar-oskarscube" depends="compile-applets">
<mkdir dir="${deploy-applet}"/>
<jar jarfile="${deploy-applet}/OskarsCube.jar">
<manifest>
<attribute name="Class-path" value="."/>
<attribute name="Main-Class" value="edu.berkeley.gcweb.gui.gamescubeman.OskarsCube.OskarsCube"/>
<attribute name="Built-Date" value="${TODAY}"/>
</manifest>
<fileset dir="${src}">
<include name="edu/berkeley/gcweb/gui/gamescubeman/ThreeD/**"/>
<include name="edu/berkeley/gcweb/gui/gamescubeman/OskarsCube/**"/>
<exclude name="**/*.jar"/>
<exclude name="**/*.java"/>
</fileset>
</jar>
</target>
<target name="jar-gamescubeman" depends="compile-applets">
<mkdir dir="${deploy-applet}" />
<jar jarfile="${deploy-applet}/GamesCubeMan.jar">
<manifest>
<attribute name="Class-path" value="."/>
<attribute name="Main-Class" value="edu.berkeley.gcweb.gui.gamescubeman.PuzzleUtils.GamesCubeMan"/>
<attribute name="Built-Date" value="${TODAY}"/>
</manifest>
<fileset dir="${src}">
<include name="edu/berkeley/gcweb/gui/gamescubeman/ThreeD/**"/>
<include name="edu/berkeley/gcweb/gui/gamescubeman/PuzzleUtils/**"/>
<include name="edu/berkeley/gcweb/gui/gamescubeman/Cuboid/**"/>
<include name="edu/berkeley/gcweb/gui/gamescubeman/SquareOne/**"/>
<include name="edu/berkeley/gcweb/gui/gamescubeman/Pyraminx/**"/>
<include name="edu/berkeley/gcweb/gui/gamescubeman/Megaminx/**"/>
<exclude name="**/*.jar"/>
<exclude name="**/*.java" />
</fileset>
</jar>
</target>
<target name="clean-applet-source" description="Clean applet source directory">
<delete>
<fileset dir="${src}" includes="**/*.class"/>
</delete>
</target>
</project>