-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
163 lines (136 loc) · 5.43 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
<?xml version="1.0" encoding="utf-8" ?>
<project name="BroadcastViewer" default="build" basedir=".">
<property file="build.properties"/>
<property name="projectname" value="BroadcastViewer" />
<property name="entrypoint" value="ob.BroadcastViewer" />
<property name="entrypoint.html" value="BroadcastViewer.html" />
<property name="WEB-INF" value="war/WEB-INF" />
<property name="classes.dir" value="${WEB-INF}/classes" />
<property name="lib.dir" value="${WEB-INF}/lib" />
<property name="build.dir" value="build" />
<target name="mkdirs">
<mkdir dir="${build.dir}" />
<mkdir dir="${lib.dir}" />
</target>
<target name="probe-proxy">
<condition property="proxy.enabled">
<and>
<isset property="proxy.host"/>
<!--isreachable host="${proxy.host}"/-->
</and>
</condition>
</target>
<target name="proxy" depends="probe-proxy" if="proxy.enabled">
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" />
</target>
<property name="gwt.args" value="" />
<path id="project.class.path">
<pathelement location="${classes.dir}"/>
<pathelement location="${gwtsdk.dir}/gwt-user.jar"/>
<fileset dir="${gwtsdk.dir}" includes="gwt-dev*.jar"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<path id="tools.class.path">
<path refid="project.class.path" />
<pathelement
location="${appenginesdk.dir}/lib/appengine-tools-api.jar"/>
<fileset dir="${appenginesdk.dir}/lib/tools">
<include name="**/asm-*.jar"/>
<include name="**/datanucleus-enhancer-*.jar"/>
</fileset>
</path>
<path id="gwt.class.path">
<pathelement location="${gwtsdk.dir}/validation-api-1.0.0.GA.jar" />
<pathelement location="${gwtsdk.dir}/validation-api-1.0.0.GA-sources.jar" />
</path>
<target name="libs" depends="mkdirs" description="Copy libs to WEB-INF/lib">
<copy todir="${lib.dir}" file="${gwtsdk.dir}/gwt-servlet.jar" />
<copy todir="${lib.dir}"
file="${gwtsdk.dir}/gwt-servlet-deps.jar" />
<copy todir="${lib.dir}" flatten="true">
<fileset dir="${appenginesdk.dir}/lib/user" includes="**/*.jar"/>
</copy>
</target>
<target name="compile" depends="mkdirs,proxy,libs"
description="Compile java source to bytecode">
<mkdir dir="${classes.dir}"/>
<javac srcdir="src" includes="**" encoding="utf-8"
destdir="${classes.dir}"
source="1.5" target="1.5" nowarn="true"
debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
</javac>
<copy todir="${classes.dir}">
<fileset dir="src" excludes="**/*.java"/>
</copy>
<taskdef name="datanucleusenhancer" classpathref="tools.class.path"
classname="org.datanucleus.enhancer.tools.EnhancerTask" />
<datanucleusenhancer classpathref="tools.class.path" failonerror="true">
<fileset dir="${classes.dir}" includes="**/*.class" />
</datanucleusenhancer>
</target>
<target name="gwtc" depends="compile"
description="GWT compile to JavaScript (production mode)">
<java failonerror="true" fork="true"
classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
<path refid="tools.class.path"/>
<path refid="gwt.class.path" />
</classpath>
<!-- add jvmarg -Xss16M or similar if you see a
StackOverflowError -->
<jvmarg value="-Xmx256M"/>
<arg line="-war"/>
<arg value="war"/>
<arg line="${gwt.args}"/>
<arg value="${entrypoint}"/>
</java>
</target>
<target name="devmode" depends="compile" description="Run development mode">
<java failonerror="true" fork="true"
classname="com.google.gwt.dev.DevMode">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
<path refid="gwt.class.path" />
<path refid="tools.class.path"/>
</classpath>
<jvmarg value="-Xmx256M"/>
<arg value="-startupUrl"/>
<arg value="${entrypoint.html}"/>
<arg line="-war"/>
<arg value="war"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="${gwt.args}"/>
<arg value="${entrypoint}"/>
<jvmarg line="-javaagent:${appenginesdk.dir}/lib/agent/appengine-agent.jar" />
<arg value="-server"/>
<arg value="com.google.appengine.tools.development.gwt.AppEngineLauncher"/>
<arg value="${entrypoint}"/>
</java>
</target>
<target name="build" depends="gwtc" description="Build this project" />
<target name="war" depends="build" description="Create a war file">
<zip destfile="${build.dir}/${projectname}.war" basedir="war"/>
</target>
<target name="deploy" depends="proxy" description="Deploy to GAE">
<exec executable="${appenginesdk.dir}/bin/appcfg.sh">
<arg value="update" />
<arg value="war" />
</exec>
</target>
<target name="clean" description="Cleans this project">
<delete dir="${classes.dir}" failonerror="false" />
<delete dir="war/broadcastviewer" failonerror="false" />
</target>
<target name="clean-db" description="Cleans this project's DB">
<delete dir="${WEB-INF}/appengine-generated" failonerror="false" />
</target>
<target name="clean-all" depends="clean,clean-db"
description="Cleans everything">
<delete dir="${WEB-INF}/deploy" failonerror="false" />
<delete file="${build.dir}/${projectname}.war" />
</target>
</project>