-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
276 lines (231 loc) · 9.69 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
<project name="gwt-rawhistory" default="build">
<!-- "build" is the default gwt-rawhistory target -->
<property name="project.target" value="build" />
<!-- Set up initial environment -->
<property name="project.root" location="." />
<property name="project.build.properties" value="${project.root}/build.properties" />
<property environment="env" />
<property file="${project.build.properties}" />
<!-- Also check for global-gwt-rawhistory.properties in the directory above -->
<property file="${project.root}/../global-gwt-rawhistory.properties" />
<!-- import common config -->
<import file="${project.root}/common.ant.xml" />
<!-- Specify project jars -->
<property name="project.jar" value="${project.dist}/gwt-rawhistory.jar" />
<available file="${gwt.tools}" type="dir" property="gwt.tools.exists" />
<!-- Setting up the project bin -->
<property name="project.bin" value="${project.build}/bin" />
<!-- Javadoc -->
<property name="project.javadoc" location="${project.out}/javadoc" />
<!-- GWT demo creation properties -->
<property name="demo.src.dir" value="${project.root}/src-demo" />
<property name="demo.out.dir" value="${project.out}/compiled-demos" />
<property name="demo.js.style" value="OBFUSCATED" />
<property name="demo.filter" value="**/demo/**/*.gwt.xml" />
<!--As the ant task selector puts tasks in the order given by the build file,
we have sorted all common public tasks first-->
<target name="build" depends="checksetup, compile" description="Packages the gwt-rawhistory jar">
<mkdir dir="build" />
<mkdir dir="${project.dist}" />
<jar destfile="${project.jar}">
<fileset dir="src">
</fileset>
<fileset dir="${project.bin}">
<exclude name="**/demo/**" />
</fileset>
</jar>
</target>
<target name="help" description="Short description of gwt-rawhistory properties and tasks">
<echo>
gwt-rawhistory properties
gwt.home
The location of the GWT jars you wish to compile and run against.
gwt.tools
The location of your GWT tools dir.
project.jar
Where should the gwt-rawhistory jar be created.
project.build.properties
Where you have defined the above propeties.
gwt-rawhistory tasks
The gwt-rawhistory tasks are self-documenting. The list of public ones are
build,help,dist,clean,all.
</echo>
</target>
<target name="classpath">
<echo>export CLASSPATH=src:src-demo:${project.jar}:${gwt.user.jar}:${gwt.dev.jar}:${gwt.validation.api.jar}:${gwt.validation.api.sources.jar}</echo>
</target>
<target name="dist"
depends="build, build.demos"
description="Assembles the full gwt-rawhistory distribution.">
<mkdir dir="${project.out}" />
<mkdir dir="${project.demos}" />
<javac srcdir="${project.root}/src-demo"
destdir="${project.bin}"
debug="${javac.debug}"
debuglevel="${javac.debuglevel}"
source="${javac.source}"
target="${javac.target}"
nowarn="${javac.nowarn}"
encoding="${javac.encoding}">
<classpath>
<pathelement location="${project.jar}" />
<pathelement location="${gwt.user.jar}" />
<pathelement location="${gwt.validation.api.jar}" />
<pathelement location="${gwt.validation.api.sources.jar}" />
<pathelement location="${gwt.dev.jar}" />
</classpath>
</javac>
<jar destfile="${project.demos}/gwt-rawhistory-demos.jar">
<fileset dir="${project.root}/src-demo">
<include name="**/demo/**" />
</fileset>
</jar>
<copy todir="${project.root}/demo">
<fileset dir="${demo.out.dir}">
</fileset>
</copy>
<copy todir="${project.root}/javadoc" failonerror="false">
<fileset dir="${project.javadoc}">
</fileset>
</copy>
<mkdir dir="${project.dist}" />
<zip destfile="${project.dist}/gwt-rawhistory.zip">
<zipfileset dir="${project.out}" >
<include name="javadoc/**" />
</zipfileset>
<zipfileset file="${project.jar}" />
</zip>
</target>
<target name="clean" description="Cleans intermediate and output files">
<delete dir="${project.build}" />
</target>
<target name="all"
description="Cleans, builds, and packages gwt-rawhistory"
depends="clean,build,dist" />
<target name="createJavadoc">
<delete dir="${project.javadoc}" />
<mkdir dir="${project.javadoc}" />
<javadoc destdir="${project.javadoc}" windowtitle="gwt-rawhistory api" failonerror="false">
<!-- Link to GWT Javadoc -->
<link href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.5" />
<packageset dir="src">
<include name="com/tractionsoftware/gwt/**" />
<exclude name="**/impl/**" />
</packageset>
<!-- Javadoc has a bug in it that requires the jars on the class path or the index.html will not be created.-->
<classpath>
<pathelement location="${project.jar}" />
<pathelement location="${gwtquery.jar}" />
<pathelement location="${gwt.user.jar}" />
<pathelement location="${gwt.validation.api.jar}" />
<pathelement location="${gwt.validation.api.sources.jar}" />
<pathelement location="${gwt.dev.jar}" />
<pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
</classpath>
</javadoc>
</target>
<!-- helper tasks -->
<target name="checksetup">
<fail message="unknown platform" unless="gwt.platform" />
<echo message="gwt.home = ${gwt.home}" />
<echo message="gwt.tools = ${gwt.tools}" />
<echo message="gwt.platform = ${gwt.platform}" />
</target>
<!-- Compile the project -->
<target name="compile">
<mkdir dir="${project.bin}" />
<echo message="Compiling source..." />
<gwt.javac destdir="${project.bin}">
<classpath>
<pathelement location="${gwtquery.jar}" />
<pathelement location="${gwt.user.jar}" />
<pathelement location="${gwt.validation.api.jar}" />
<pathelement location="${gwt.validation.api.sources.jar}" />
<pathelement location="${gwt.dev.jar}" />
</classpath>
</gwt.javac>
</target>
<target name="gwtc">
<!-- convert from module file path to module name -->
<propertyregex property="gwtc.module.name"
input="${gwtc.module.file}"
regexp="${gwtc.src.dir}[/\\](.*)\.gwt\.xml"
select="\1"
casesensitive="false" />
<propertyregex property="gwtc.module.name"
input="${gwtc.module.name}"
override="true"
global="true"
regexp="[/\\]"
replace="\." />
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<jvmarg value="-Xmx512m" />
<arg value="-war" />
<arg value="${gwtc.out.dir}" />
<arg value="-style" />
<arg value="${gwtc.js.style}" />
<arg value="-strict" />
<arg value="${gwtc.module.name}" />
<classpath>
<pathelement location="${gwtquery.jar}" />
<path path="${gwtc.src.dir}" />
<path path="${project.jar}" />
<pathelement location="${gwt.user.jar}" />
<pathelement location="${gwt.validation.api.jar}" />
<pathelement location="${gwt.validation.api.sources.jar}" />
<pathelement location="${gwt.dev.jar}" />
</classpath>
</java>
</target>
<target name="build.demo.helper" depends="gwtc">
<concat destfile="${gwtc.out.dir}/index.html" append="true">
<filterchain>
<replaceregex flags="g" pattern="\\" replace="/" />
<replaceregex pattern="\('.*/src-demo/" replace="('" />
</filterchain>
<script>writeDemoLink('${gwtc.module.file}');</script>
</concat>
</target>
<target name="clean.demos">
<delete dir="${demo.out.dir}" />
</target>
<target name="build.demos" depends="build, clean.demos, build.demos.body" />
<target name="build.demos.body">
<delete dir="${demo.out.dir}" />
<copy file="html/demoindex.template" tofile="${demo.out.dir}/index.html" />
<foreach target="build.demo.helper" param="gwtc.module.file">
<param name="gwtc.src.dir" value="${demo.src.dir}" />
<param name="gwtc.out.dir" value="${demo.out.dir}" />
<param name="gwtc.js.style" value="${demo.js.style}" />
<path>
<fileset dir="src-demo">
<include name="${demo.filter}" />
</fileset>
</path>
</foreach>
</target>
<target name="dev.rawhistory" description="Run RawHistory">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">
<classpath>
<pathelement location="${project.class.path}" />
<pathelement location="${project.src}" />
<pathelement location="${demo.src.dir}" />
<pathelement location="${gwt.user.jar}" />
<pathelement location="${gwt.validation.api.jar}" />
<pathelement location="${gwt.validation.api.sources.jar}" />
<pathelement location="${gwt.dev.jar}" />
</classpath>
<jvmarg value="-Xmx512M" />
<jvmarg value="-Xdebug" />
<arg value="-startupUrl" />
<arg value="http://localhost:8888/com.tractionsoftware.gwt.demo.history.RawHistoryDemo/RawHistoryDemo.html" />
<arg value="-war" />
<arg value="." />
<arg value="-logLevel" />
<arg value="DEBUG" />
<arg value="-bindAddress" />
<arg value="192.168.46.1" />
<arg value="com.tractionsoftware.gwt.demo.history.RawHistoryDemo" />
</java>
</target>
</project>