-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathbuild.xml
More file actions
375 lines (328 loc) · 18.3 KB
/
Copy pathbuild.xml
File metadata and controls
375 lines (328 loc) · 18.3 KB
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
<?xml version="1.0"?>
<!-- ======================================================================
Copyright 2011 Google Inc. All Rights Reserved.
App Inventor component libraries
====================================================================== -->
<project name="components" default="all">
<description>
App Inventor component libraries
</description>
<target name="all"
depends="CommonConstants,AndroidRuntime,
JsonComponentDescription,XmlComponentDescription,
ComponentList">
</target>
<target name="tests"
depends="CommonTests,AndroidRuntimeTests">
</target>
<!-- =====================================================================
Import common directory, task, and target definitions.
===================================================================== -->
<import file="../build-common.xml" />
<!-- =====================================================================
Define base package path.
===================================================================== -->
<property name="components.pkg" value="com/google/appinventor/components" />
<!-- =====================================================================
CommonConstants: library of constants used across App Inventor
===================================================================== -->
<target name="CommonConstants"
description="Generate library of constants used across App Inventor"
depends="init">
<property name="CommonConstants-class.dir" location="${class.dir}/CommonConstants" />
<mkdir dir="${CommonConstants-class.dir}" />
<ai.javac destdir="${CommonConstants-class.dir}">
<include name="${components.pkg}/common/*.java" />
<exclude name="${components.pkg}/common/HtmlEntities.java" />
</ai.javac>
<jar destfile="${public.build.dir}/CommonConstants.jar">
<fileset dir="${CommonConstants-class.dir}"/>
</jar>
<jar destfile="${public.build.dir}/CommonConstants-gwt.jar">
<fileset dir="${CommonConstants-class.dir}"/>
<!-- Source files needed for GWT compilation: -->
<fileset dir="${src.dir}">
<include name="${components.pkg}/common/*.java" />
<exclude name="${components.pkg}/common/HtmlEntities.java" />
<include name="${components.pkg}/CommonConstants.gwt.xml" />
</fileset>
</jar>
</target>
<!-- =====================================================================
HtmlEntities: library containing utility class for working with
HTML entities.
===================================================================== -->
<target name="HtmlEntities"
description="Generate library containing utility class for working with HTML entities"
depends="init">
<property name="HtmlEntities-class.dir" location="${class.dir}/HtmlEntities" />
<mkdir dir="${HtmlEntities-class.dir}" />
<ai.javac destdir="${HtmlEntities-class.dir}">
<include name="${components.pkg}/common/HtmlEntities.java" />
</ai.javac>
<jar destfile="${local.build.dir}/HtmlEntities.jar">
<fileset dir="${HtmlEntities-class.dir}"/>
</jar>
</target>
<!-- =====================================================================
CommonTests: build and run the common tests and generate the output results
===================================================================== -->
<path id="libsForCommonTests.path">
<pathelement location="${local.build.dir}/HtmlEntities.jar" />
<pathelement location="${lib.dir}/junit/junit-4.8.2.jar" />
</path>
<path id="CommonTests.path">
<path refid="libsForCommonTests.path"/>
<pathelement location="${local.build.dir}/CommonTests.jar" />
</path>
<target name="CommonTests"
depends="HtmlEntities"
description="build and run the test suite" >
<ai.dojunit aij-testingtarget="CommonTests"
aij-dir="${components.pkg}/common" >
</ai.dojunit>
</target>
<!-- =====================================================================
AndroidRuntime: library providing runtime support for components
===================================================================== -->
<target name="AndroidRuntime"
description="Generate runtime library implementing components"
depends="CommonConstants,HtmlEntities">
<property name="AndroidRuntime-class.dir" location="${class.dir}/AndroidRuntime" />
<mkdir dir="${AndroidRuntime-class.dir}" />
<ai.javac destdir="${AndroidRuntime-class.dir}">
<include name="${components.pkg}/annotations/*.java" />
<include name="${components.pkg}/runtime/**/*.java" />
<classpath>
<pathelement location="${local.build.dir}/HtmlEntities.jar" />
<pathelement location="${public.build.dir}/CommonConstants.jar" />
<pathelement location="${build.dir}/common/CommonVersion.jar" />
<pathelement location="${lib.dir}/android/4.2.2/android.jar" />
<pathelement location="${lib.dir}/kawa/kawa-1.11-modified.jar" />
<pathelement location="${lib.dir}/acra/acra-4.4.0.jar" />
<pathelement location="${lib.dir}/guava/guava-14.0.1.jar" />
<!-- Conditionally included libraries -->
<pathelement location="${lib.dir}/twitter/twitter4j-core-3.0.3.jar" />
<pathelement location="${lib.dir}/twitter/twitter4j-media-support-3.0.3.jar" />
<pathelement location="${lib.dir}/fusiontables/fusiontables.jar" />
<pathelement location="${lib.dir}/oauth/google-api-client-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-api-client-android2-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-http-client-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-http-client-android2-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-http-client-android3-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-oauth-client-1.10.1-beta.jar" />
</classpath>
</ai.javac>
<jar basedir="${AndroidRuntime-class.dir}"
destfile="${public.build.dir}/AndroidRuntime.jar">
<zipfileset src="${local.build.dir}/HtmlEntities.jar"/>
<zipfileset src="${public.build.dir}/CommonConstants.jar"/>
<zipfileset src="${build.dir}/common/CommonVersion.jar" />
</jar>
</target>
<!-- =====================================================================
AndroidRuntimeTests: build and run the AndroidRuntime tests and generate the output results
===================================================================== -->
<path id="libsForAndroidRuntimeTests.path">
<pathelement location="${public.build.dir}/AndroidRuntime.jar" />
<pathelement location="${public.build.dir}/CommonConstants.jar" />
<pathelement location="${lib.dir}/json/json.jar" />
<pathelement location="${lib.dir}/junit/junit-4.8.2.jar" />
<pathelement location="${lib.dir}/junit4/tl4j-junit4-1.1.3.jar" />
<pathelement location="${lib.dir}/kawa/kawa-1.11-modified.jar" />
<pathelement location="${lib.dir}/acra/acra-4.4.0.jar" />
<pathelement location="${lib.dir}/powermock/cglib-nodep-2.2.jar" />
<pathelement location="${lib.dir}/powermock/easymock-3.0.jar" />
<pathelement location="${lib.dir}/powermock/javassist-3.15.0-GA.jar" />
<pathelement location="${lib.dir}/powermock/objenesis-1.2.jar" />
<pathelement location="${lib.dir}/powermock/powermock-easymock-1.4.10-full.jar" />
<!-- android.jar must go last on the classpath list
so that its junit (or other) stubs don't override the real ones -->
<pathelement location="${lib.dir}/android/4.2.2/android.jar" />
</path>
<path id="AndroidRuntimeTests.path">
<path refid="libsForAndroidRuntimeTests.path"/>
<pathelement location="${local.build.dir}/AndroidRuntimeTests.jar" />
</path>
<target name="AndroidRuntimeTests"
depends="AndroidRuntime"
description="build and run the test suite" >
<ai.dojunit aij-testingtarget="AndroidRuntimeTests"
aij-dir="${components.pkg}/runtime" >
</ai.dojunit>
</target>
<!-- =====================================================================
Define task ai.apt for running the annotation processor.
This is based on the "javac" task instead of the "apt" task because
the apt task does not offer any useful additional tags. We don't use
the "ai.javac" task here because it does dependancy checking that is
not appropriate for annotation processing.
===================================================================== -->
<macrodef name="ai.apt">
<attribute name="apt-classdir" />
<attribute name="apt-processor" />
<attribute name="apt-target" />
<sequential>
<mkdir dir="@{apt-classdir}" />
<!-- Look at all source files to determine whether the target is up-to-date. This will catch
changes to the Java files in the annotations, common, runtime, and scripts packages and .txt
files in scripts/templates. -->
<uptodate property="target.uptodate" targetfile="@{apt-target}">
<srcfiles dir="${src.dir}" includes="${components.pkg}/**/*"/>
</uptodate>
<!-- We need to delete all the classes before running javac below. Otherwise, javac will only
process the Java files whose classes are not up-to-date and we'll end up with only a subset
of the results. For example, if only Label.java was modified, our annotation processor code
will only be executed for Label.java and we'll only have results for Label.java. -->
<delete>
<fileset dir="@{apt-classdir}">
<include name="**/*" unless="target.uptodate"/>
</fileset>
</delete>
<javac destdir="@{apt-classdir}"
sourcepath=""
srcdir="${src.dir}"
includeantruntime="false">
<include name="${components.pkg}/runtime/*.java" />
<classpath>
<pathelement location="${public.build.dir}/AndroidRuntime.jar" />
<pathelement location="${local.build.dir}/HtmlEntities.jar" />
<pathelement location="${public.build.dir}/CommonConstants.jar" />
<pathelement location="${lib.dir}/android/4.2.2/android.jar" />
<pathelement location="${lib.dir}/guava/guava-14.0.1.jar" />
<pathelement location="${lib.dir}/kawa/kawa-1.11-modified.jar" />
<pathelement location="${lib.dir}/acra/acra-4.4.0.jar" />
<pathelement location="${lib.dir}/twitter/twitter4j-core-3.0.3.jar" />
<pathelement location="${lib.dir}/twitter/twitter4j-media-support-3.0.3.jar" />
<pathelement location="${lib.dir}/fusiontables/fusiontables.jar" />
<pathelement location="${lib.dir}/oauth/google-api-client-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-api-client-android2-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-http-client-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-http-client-android2-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-http-client-android3-1.10.3-beta.jar" />
<pathelement location="${lib.dir}/oauth/google-oauth-client-1.10.1-beta.jar" />
<pathelement location="${lib.dir}/guava/guava-14.0.1.jar" />
</classpath>
<compilerarg line="-processorpath ${local.build.dir}/AnnotationProcessors.jar"/>
<compilerarg line="-processor @{apt-processor}" />
</javac>
</sequential>
</macrodef>
<!-- =====================================================================
ComponentProcessingLib: common library for annotation processors that
run over the components.
===================================================================== -->
<target name="ComponentProcessingLib"
description="Generate library for component annotation processors"
depends="CommonConstants">
<property name="ComponentProcessingLib-class.dir"
location="${class.dir}/ComponentProcessingLib" />
<mkdir dir="${ComponentProcessingLib-class.dir}" />
<ai.javac destdir="${ComponentProcessingLib-class.dir}">
<include name="${components.pkg}/scripts/ComponentProcessor.java" />
<include name="${components.pkg}/annotations/*.java" />
<classpath>
<pathelement location="${public.build.dir}/CommonConstants.jar" />
<pathelement location="${lib.dir}/guava/guava-14.0.1.jar" />
</classpath>
</ai.javac>
<jar basedir="${ComponentProcessingLib-class.dir}"
destfile="${local.build.dir}/ComponentProcessingLib.jar" />
</target>
<!-- =====================================================================
AnnotationProcessors: plugins for processing component annotations
Note that AnnotationProcessors.jar, produced here, will contain all
of its dependencies including guava. This makes it much easier to
specify the -processorpath option in ai.apt.
===================================================================== -->
<target name="AnnotationProcessors"
description="Create plugins for annotation processing"
depends="ComponentProcessingLib,CommonConstants,HtmlEntities">
<property name="AnnotationProcessors-class.dir"
location="${class.dir}/AnnotationProcessors" />
<mkdir dir="${AnnotationProcessors-class.dir}" />
<ai.javac destdir="${AnnotationProcessors-class.dir}">
<include name="${components.pkg}/scripts/*.java" />
<classpath>
<pathelement location="${local.build.dir}/ComponentProcessingLib.jar"/>
<pathelement location="${local.build.dir}/HtmlEntities.jar" />
<pathelement location="${public.build.dir}/CommonConstants.jar" />
<pathelement location="${build.dir}/common/CommonUtils.jar" />
<pathelement location="${lib.dir}/guava/guava-14.0.1.jar" />
</classpath>
</ai.javac>
<copy todir="${AnnotationProcessors-class.dir}">
<fileset dir="${src.dir}">
<include name="${components.pkg}/scripts/templates/*" />
</fileset>
</copy>
<jar basedir="${AnnotationProcessors-class.dir}"
destfile="${local.build.dir}/AnnotationProcessors.jar" >
<zipfileset src="${local.build.dir}/ComponentProcessingLib.jar"/>
<zipfileset src="${local.build.dir}/HtmlEntities.jar"/>
<zipfileset src="${public.build.dir}/CommonConstants.jar"/>
<zipfileset src="${build.dir}/common/CommonUtils.jar" />
<zipfileset src="${lib.dir}/guava/guava-14.0.1.jar" />
</jar>
</target>
<!-- =====================================================================
JsonComponentDescription: create simple_components.json.
===================================================================== -->
<target name="JsonComponentDescription"
description="Make simple_components.json."
depends="AnnotationProcessors,AndroidRuntime,HtmlEntities,CommonConstants,common_CommonUtils">
<property name="JsonComponentDescription-class.dir"
location="${class.dir}/JsonComponentDescription" />
<ai.apt apt-classdir="${JsonComponentDescription-class.dir}"
apt-processor="com.google.appinventor.components.scripts.ComponentDescriptorGenerator"
apt-target="${JsonComponentDescription-class.dir}/simple_components.json"/>
<copy file="${JsonComponentDescription-class.dir}/simple_components.json"
todir="${public.build.dir}"/>
</target>
<!-- =====================================================================
XmlComponentDescription: create lang_def.xml for Blocks Editor.
===================================================================== -->
<target name="XmlComponentDescription"
description="Make ya_lang_def.xml file for Blocks Editor."
depends="AnnotationProcessors,AndroidRuntime,HtmlEntities,CommonConstants">
<property name="XmlComponentDescription-class.dir"
location="${class.dir}/XmlComponentDescription" />
<ai.apt apt-classdir="${XmlComponentDescription-class.dir}"
apt-processor="com.google.appinventor.components.scripts.LangDefXmlGenerator"
apt-target="${XmlComponentDescription-class.dir}/ya_lang_def.xml"/>
<copy file="${XmlComponentDescription-class.dir}/ya_lang_def.xml"
todir="${public.build.dir}"/>
</target>
<!-- =====================================================================
ComponentList: create simple_components.txt and
simple_components_build_info.json
===================================================================== -->
<target name="ComponentList"
description="Make simple_components.txt and simple_components_build_info.json."
depends="AnnotationProcessors,AndroidRuntime,HtmlEntities,CommonConstants">
<property name="ComponentList-class.dir" location="${class.dir}/ComponentList" />
<mkdir dir="${ComponentList-class.dir}" />
<ai.apt apt-classdir="${ComponentList-class.dir}"
apt-processor="com.google.appinventor.components.scripts.ComponentListGenerator"
apt-target="${ComponentList-class.dir}/simple_components.txt"/>
<copy file="${ComponentList-class.dir}/simple_components.txt"
todir="${public.build.dir}"/>
<copy file="${ComponentList-class.dir}/simple_components_build_info.json"
todir="${public.build.dir}"/>
</target>
<!-- =====================================================================
ComponentDocumentation: create component documentation from source
===================================================================== -->
<target name="ComponentDocumentation"
description="Make component documentation from source annotations."
depends="AnnotationProcessors,AndroidRuntime,HtmlEntities,CommonConstants">
<property name="ComponentDocumentation-class.dir"
location="${class.dir}/ComponentDocumentation" />
<mkdir dir="${ComponentDocumentation-class.dir}" />
<ai.apt apt-classdir="${ComponentDocumentation-class.dir}"
apt-processor="com.google.appinventor.components.scripts.DocumentationGenerator"
apt-target="${ComponentDocumentation-class.dir}/component-doc.html"/>
<copy file="${ComponentDocumentation-class.dir}/component-doc.html"
todir="${public.build.dir}"/>
</target>
</project>