-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
131 lines (116 loc) · 4.61 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
<?xml version="1.0" encoding="utf-8" ?>
<project name="GwtQuake" default="build" basedir=".">
<property name="gwt.args" value="" />
<property name="gwt.sdk" location="lib/gwt-2.4.0" />
<property name="gwtgl" location="lib/gwtgl-0.3" />
<path id="project.class.path">
<pathelement location="war/WEB-INF/classes"/>
<pathelement location="${gwt.sdk}/gwt-user.jar"/>
<fileset dir="${gwt.sdk}" includes="gwt-dev*.jar"/>
<fileset dir="${gwt.sdk}" includes="validation*.jar"/>
<fileset dir="${gwtgl}" includes="*.jar"/>
<fileset dir="lib/jetty" includes="**/*.jar"/>
<fileset dir="war/WEB-INF/lib" includes="**/*.jar"/>
</path>
<fileset id="inputfiles" dir=".">
<patternset>
<include name="src/**/*.java"/>
<include name="${gwt.sdk}/gwt-dev.jar" />
<include name="${gwt.sdk}/gwt-user.jar" />
</patternset>
</fileset>
<macrodef name="gwtc">
<attribute name="module" />
<attribute name="destdir" default="war" />
<attribute name="srcdir" default="src" />
<sequential>
<java dir="@{srcdir}"
classname="com.google.gwt.dev.Compiler"
fork="yes"
failonerror="true">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
</classpath>
<jvmarg value="-Xmx512M"/>
<!-- Have to turn off aggressive opts for now because of a weird dataflow bug -->
<arg line="-XdisableAggressiveOptimization" />
<arg line="${gwt.args}" />
<arg value="-war" />
<arg file="@{destdir}" />
<arg value="@{module}" />
</java>
</sequential>
</macrodef>
<target name="libs" description="Copy libs to WEB-INF/lib">
<mkdir dir="war/WEB-INF/lib" />
<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />
</target>
<target name="server" depends="libs" description="Compile java source to bytecode">
<mkdir dir="war/WEB-INF/classes"/>
<javac srcdir="src" includes="**" excludes="com/google/gwt/corp/emul/**"
encoding="utf-8" destdir="war/WEB-INF/classes"
source="1.5" target="1.5" nowarn="true"
debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
</javac>
<copy todir="war/WEB-INF/classes">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="install-resources" depends="server" description="Fetch and install the demo resources from an external server">
<java failonerror="true" fork="true" classname="com.googlecode.gwtquake.tools.Installer">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
</classpath>
<arg value="hires"/>
</java>
</target>
<target name="devmode" depends="server" description="Run development mode">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
</classpath>
<jvmarg value="-Xmx256M"/>
<arg value="-startupUrl"/>
<arg value="GwtQuake.html"/>
<arg line="-war"/>
<arg value="war"/>
<arg line="${gwt.args}"/>
<arg value="com.googlecode.gwtquake.GwtQuake"/>
</java>
</target>
<target name="client.build" depends="server">
<uptodate property="client.updated"
targetfile="war/gwtquake/gwtquake.nocache.js">
<srcfiles refid="inputfiles" />
</uptodate>
<antcall target="client.run" />
</target>
<target name="client.run" depends="server" unless="client.updated"
description="GWT compile to JavaScript (production mode)">
<gwtc module="com.googlecode.gwtquake.GwtQuake" />
</target>
<target name="build" depends="server,install-resources,client.build" description="Build this project" />
<target name="run" depends="build" description="Run the server">
<java failonerror="true" fork="true" classname="com.googlecode.gwtquake.server.GwtQuakeServer">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
</classpath>
</java>
</target>
<target name="war" depends="build" description="Create a war file">
<zip destfile="GwtQuake.war" basedir="war"/>
</target>
<target name="clean" description="Cleans this project">
<delete dir="war/WEB-INF/classes" failonerror="false" />
<delete dir="war/gwtquake" failonerror="false" />
</target>
<target name="clean-resources" description="Removes the downloaded and converted demo resources">
<delete dir="raw/baseq2" failonerror="false" />
<delete dir="war/baseq2" failonerror="false" />
</target>
</project>