-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathbuild.xml
More file actions
178 lines (150 loc) · 8.14 KB
/
Copy pathbuild.xml
File metadata and controls
178 lines (150 loc) · 8.14 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
<?xml version="1.0"?>
<!-- ======================================================================
Copyright 2011 Google Inc. All Rights Reserved.
Author: kerr@google.com (Debby Wallach)
Blocks editor
In order to ensure that the blocks editor can run on Java 5, we compile
with ai.javac5 and we do not depend on any jars that are not compiled
with ai.javac5.
====================================================================== -->
<project name="blockseditor" default="all" xmlns:as="antlib:org.codehaus.mojo.animal_sniffer">
<description>
BlocksEditor for App Inventor
</description>
<target name="all"
depends="BlocksEditor">
</target>
<target name="tests"
depends="YoungAndroidLibTests,BlocksEditorTest">
</target>
<!-- =====================================================================
Import common directory, task, and target definitions.
===================================================================== -->
<import file="../build-common.xml" />
<!-- =====================================================================
Define base package path.
===================================================================== -->
<property name="blockseditor.pkg" value="com/google/appinventor/blockseditor" />
<!-- =====================================================================
YoungAndroid library
===================================================================== -->
<target name="YoungAndroidLib"
depends="init,blockslib_OpenBlocks,common_BlocksEditorHttpConstants"
description="Generate library containing youngandroid code">
<property name="YoungAndroidLib-class.dir" location="${class.dir}/YoungAndroidLib" />
<mkdir dir="${YoungAndroidLib-class.dir}" />
<ai.javac5 destdir="${YoungAndroidLib-class.dir}">
<include name="${blockseditor.pkg}/jsonp/*.java" />
<include name="${blockseditor.pkg}/youngandroid/*.java" />
<classpath>
<pathelement location="${build.dir}/blockslib/OpenBlocks.jar" />
<pathelement location="${build.dir}/common/BlocksEditorHttpConstants.jar" />
<pathelement location="${lib.dir}/json/json.jar" />
<pathelement location="${lib.dir}/android/tools/ddmlib.jar"/>
</classpath>
</ai.javac5>
<jar basedir="${YoungAndroidLib-class.dir}"
destfile="${local.build.dir}/YoungAndroidLib.jar" />
</target>
<!-- =====================================================================
YoungAndroidLibTests: build and run the YoungAndroidLib tests and generate the output results
===================================================================== -->
<path id="libsForYoungAndroidLibTests.path">
<pathelement location="${local.build.dir}/YoungAndroidLib.jar" />
<pathelement location="${build.dir}/blockslib/OpenBlocks.jar" />
<pathelement location="${build.dir}/common/BlocksEditorHttpConstants.jar" />
<pathelement location="${build.dir}/common/CommonTestUtils.jar" />
<pathelement location="${lib.dir}/guava/guava-14.0.1.jar" />
<pathelement location="${lib.dir}/json/json.jar" />
<pathelement location="${lib.dir}/junit/junit-4.8.2.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/objenesis-1.2.jar" />
</path>
<path id="YoungAndroidLibTests.path">
<path refid="libsForYoungAndroidLibTests.path"/>
<pathelement location="${local.build.dir}/YoungAndroidLibTests.jar" />
</path>
<target name="YoungAndroidLibTests"
depends="YoungAndroidLib,common_BlocksEditorHttpConstants,blockslib_OpenBlocks,common_CommonTestUtils"
description="build and run the test suite" >
<ai.dojunit aij-testingtarget="YoungAndroidLibTests"
aij-dir="${blockseditor.pkg}" >
</ai.dojunit>
</target>
<!-- =====================================================================
KeyStore
If blockseditor.keystore already exists, we don't execute keytool again.
===================================================================== -->
<target name="check-KeyStore">
<available file="${local.build.dir}/blockseditor.keystore" property="KeyStore.present"/>
</target>
<target name="KeyStore" depends="init,check-KeyStore" unless="KeyStore.present"
description="Generates the key store that is used to sign BlocksEditor.jar">
<!-- If you want the certificate info for the blocks editor jar to be a better
match for your organization edit the dname below. See http://ant.apache.org/manual/Tasks/genkey.html
for more info on how to do that -->
<genkey keystore="${local.build.dir}/blockseditor.keystore" alias="simple"
dname="CN=example.com, OU=Organization, O=Example, L=Any Town, ST=CA, C=US"
storepass="aipass" keypass="aipass"/>
</target>
<!-- =====================================================================
BlocksEditor: complete signed jar for the blocks editor with entry
point com.google.appinventor.blockseditor.youngandroid.YaHttpServerMain
===================================================================== -->
<target name="BlocksEditor"
depends="init,blockslib_OpenBlocks,common_BlocksEditorHttpConstants,common_CommonVersion,YoungAndroidLib,KeyStore"
description="Generate complete signed jar for the blocks editor">
<jar destfile="${local.build.dir}/UnsignedBlocksEditor.jar">
<manifest>
<attribute name="Main-Class"
value="com.google.appinventor.blockseditor.youngandroid.YaHttpServerMain" />
</manifest>
<zipfileset src="${local.build.dir}/YoungAndroidLib.jar"/>
<zipfileset src="${build.dir}/blockslib/OpenBlocks.jar"/>
<zipfileset src="${build.dir}/common/BlocksEditorHttpConstants.jar"/>
<zipfileset src="${build.dir}/common/CommonVersion.jar"/>
<zipfileset src="${lib.dir}/json/json.jar"/>
<zipfileset src="${lib.dir}/tablelayout/TableLayout-jdk1.5-2007-04-21.jar"/>
<zipfileset src="${lib.dir}/android/tools/ddmlib_2.2.jar"/>
<zipfileset src="${lib.dir}/QRGenerator/core.jar"/>
<zipfileset src="${lib.dir}/QRGenerator/javase.jar"/>
</jar>
<!-- These are not the comments you're looking for. This is for testing -->
<signjar keystore="${local.build.dir}/blockseditor.keystore"
storepass="aipass"
signedjar="${public.build.dir}/BlocksEditor.jar"
jar="${local.build.dir}/UnsignedBlocksEditor.jar"
alias="simple" />
</target>
<!-- =====================================================================
BlocksEditorTest: Use animal sniffer check-signature to ensure that
the blocks editor will run on Java version 5. If a call to a method
that doesn't exist in Java version 5, such as String.isEmpty(), is
accidentally added to the blocks editor source code, we will find out
with this test.
===================================================================== -->
<target name="BlocksEditorTest"
depends="BlocksEditor">
<as:check-signature signature="${lib.dir}/jdk5/jdk5.sig">
<path path="${public.build.dir}/BlocksEditor.jar"/>
</as:check-signature>
</target>
<!-- =====================================================================
BuildJdk5Signature was used to build the API signature file that is
located at lib/jdk5/jdk5.sig
This target can only be run on a machine that has Java 5 installed.
=====================================================================
<target name="BuildJdk5Signature"
description="Build the API signature file for JDK 5"
depends="init">
<as:build-signatures destfile="${lib.dir}/jdk5/jdk5.sig">
<path>
<fileset dir="/usr/lib/jvm/java-1.5.0-sun/jre/" includes="lib/rt.jar"/>
<fileset dir="/usr/lib/jvm/java-1.5.0-sun/jre/" includes="lib/jce.jar"/>
<fileset dir="/usr/lib/jvm/java-1.5.0-sun/jre/" includes="lib/jsse.jar"/>
</path>
</as:build-signatures>
</target>
-->
</project>