forked from MIT-PAC/droidsafe-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-eclipse-libs.xml
More file actions
337 lines (294 loc) · 14.9 KB
/
build-eclipse-libs.xml
File metadata and controls
337 lines (294 loc) · 14.9 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
<?xml version="1.0" encoding="utf-8"?>
<project name="droidsafe" default="help">
<property name="ssl-antlr-spec" value="src/main/java/droidsafe/speclang/DroidSafe.g"/>
<property name="ssl-ast-to-java" value="src/main/java/droidsafe/speclang/SpecCreator.g"/>
<property name="ssl-antlr-target-dir" value="src/main/java/droidsafe/speclang"/>
<property name="test-results-dir" value="test-reports"/>
<property name="eclipse-plugin-path" value="src/eclipse/droidsafe.eclipse.plugin.core"/>
<path id="lib-jars">
<pathelement location="lib/javassist-3.16.1-GA.jar"/>
<pathelement location="lib/reflections-0.9.9-RC1.jar"/>
<pathelement location="lib/commons-cli-1.2.jar"/>
<pathelement location="lib/logback-classic-1.0.7.jar"/>
<pathelement location="lib/slf4j-api-1.7.2.jar"/>
<pathelement location="lib/commons-io-2.4.jar"/>
<pathelement location="lib/logback-core-1.0.7.jar"/>
<pathelement location="lib/soot-trunk.jar"/>
<pathelement location="lib/antlr-3.4-complete.jar"/>
<pathelement location="lib/paddle-0.3.jar"/>
<pathelement location="lib/javabdd_0.6.jar"/>
<pathelement location="lib/jedd-runtime.jar"/>
<pathelement location="lib/guava-11.0.2.jar"/>
<pathelement location="lib/commons-lang3-3.1.jar"/>
<pathelement location="lib/jgrapht-jdk1.6.jar"/>
<pathelement location="lib/string.jar"/>
<pathelement location="lib/automaton.jar"/>
<pathelement location="lib/javaparser.jar"/>
</path>
<target name="help">
<echo>
==================================================================================================
Primary Targets:
=====================================================================
build-libs Build and package required libraries
compile Compile Droidsafe core
clean Cleanup all generated binary files
=====================================================================
Documentation Targets:
=====================================================================
javadoc Generate javadoc for DroidBlaze's Java source code
htmldoc Generate HTML user guide (needs hyperlatex)
=====================================================================
Testing Targets:
=====================================================================
compile-tests compiles Droidsafe tests
run-tests runs all JUnit tests under 'tests/java/droidsafe/test'
> -Dtest.class wildcard class name of tests to run
> -Dtest.timeout seconds after which to fail the test (default 70)
run-specdump-test checks whether 'make specdump' succeeds for each app in '/android-apps/'
> -Ddir.to.search directory inside 'android-apps to which to limit the app search to
> -Dtest.timeout seconds after which to fail the test (default 70)
run-regression-tests runs all JUnit tests under 'tests/java/droidsafe/test/regression'
> -Ddir.to.search directory inside 'android-apps to which to limit the app search to for SpecdumpRegressionTest
update-specdump-regression-values updates the regression values using the results from the latest run of 'run-specdump-tests'
</echo>
</target>
<!--
==========================================================================
BUILD SPEC LANGUAGE PARSER & AST To Java
==========================================================================
-->
<target name="antlr-runs" description="Build Security Specification Parser" unless="droidsafe.core-uptodate">
<java classname="org.antlr.Tool" fork="true" failonerror="true">
<classpath>
<pathelement location="lib/antlr-3.4-complete.jar"/>
</classpath>
<arg value="-verbose"/>
<arg value="-make"/>
<arg value="-o"/>
<arg path="${ssl-antlr-target-dir}"/>
<arg path="${ssl-antlr-spec}"/>
</java>
<java classname="org.antlr.Tool" fork="true" failonerror="true">
<classpath>
<pathelement location="lib/antlr-3.4-complete.jar"/>
</classpath>
<arg value="-verbose"/>
<arg value="-make"/>
<arg value="-o"/>
<arg path="${ssl-antlr-target-dir}"/>
<arg path="${ssl-ast-to-java}"/>
</java>
</target>
<!--
==========================================================================
CHECK FOR UP-TO-DATE SOURCE OR LIB FILES
==========================================================================
-->
<target name="check-for-changes">
<uptodate property="droidsafe.core-uptodate" targetfile="${eclipse-plugin-path}/bin/droidsafe-core.jar" >
<srcfiles dir="src/main/" includes="**"/>
</uptodate>
<uptodate property="droidsafe.test-uptodate" targetfile="bin/droidsafe-test.jar" >
<srcfiles dir="src/test" includes="**"/>
</uptodate>
<uptodate property="droidsafe.libs-uptodate" targetfile="${eclipse-plugin-path}/bin/droidsafe-libs.jar" >
<srcfiles dir="lib" includes="**"/>
</uptodate>
<uptodate property="droidsafe.calls-uptodate" targetfile="${eclipse-plugin-path}/android-lib/droidcalls.jar" >
<srcfiles dir="android-lib/src" includes="**"/>
</uptodate>
<uptodate property="droidsafe.model-uptodate" targetfile="${eclipse-plugin-path}/android-lib/droidsafe-api-model.jar" >
<srcfiles dir="modeling/api" includes="**"/>
</uptodate>
</target>
<!-- <target name="droidsafe-calls-build" unless="droidsafe.calls-uptodate"> -->
<!-- <exec executable="make" dir="android-lib"> -->
<!-- </exec> -->
<!-- </target> -->
<target name="droidsafe-calls-build" unless="droidsafe.calls-uptodate">
<javac debug="true" debuglevel="source,lines,vars" includeAntRuntime="false"
source="1.7" target="1.7" srcdir="android-lib/src">
<classpath>
<pathelement location="android-lib"/>
<pathelement location="android-lib/android.jar"/>
<pathelement location="android-lib/src"/>
</classpath>
</javac>
<jar destfile="${eclipse-plugin-path}/android-lib/droidcalls.jar" basedir="android-lib/src" includes="**/*.class">
</jar>
</target>
<target name="build-libs" description="Create jar file libraries."
depends="check-for-changes, antlr-runs" unless="droidsafe.libs-uptodate">
<jar destfile="${eclipse-plugin-path}/lib/droidsafe-libs.jar">
<zipfileset includes="**/*.class" src="lib/javassist-3.16.1-GA.jar"/>
<zipfileset includes="**/*.class" src="lib/reflections-0.9.9-RC1.jar"/>
<zipfileset includes="**/*.class" src="lib/commons-cli-1.2.jar"/>
<zipfileset includes="**/*.class" src="lib/commons-io-2.4.jar"/>
<zipfileset includes="**/*.class" src="lib/soot-trunk.jar"/>
<zipfileset includes="**/*.class" src="lib/antlr-3.4-complete.jar"/>
<zipfileset includes="**/*.class" src="lib/paddle-0.3.jar"/>
<zipfileset includes="**/*.class" src="lib/javabdd_0.6.jar"/>
<zipfileset includes="**/*.class" src="lib/jedd-runtime.jar"/>
<zipfileset includes="**/*.class" src="lib/guava-11.0.2.jar"/>
<zipfileset includes="**/*.class" src="lib/commons-lang3-3.1.jar"/>
<zipfileset includes="**/*.class" src="lib/jgrapht-jdk1.6.jar"/>
<zipfileset includes="**/*.class" src="lib/string.jar"/>
<zipfileset includes="**/*.class" src="lib/automaton.jar"/>
<zipfileset includes="**/*.class" src="lib/javaparser.jar"/>
</jar>
</target>
<!--
==========================================================================
COMPILE MODELING
==========================================================================
-->
<target name="compile-model" description="Compile DroidSafe API Model."
depends="check-for-changes" unless="droidsafe.model-uptodate">
<mkdir dir="${eclipse-plugin-path}/modeling/classes/api"/>
<javac debug="true" debuglevel="source,lines,vars" includeAntRuntime="false"
destdir="${eclipse-plugin-path}/modeling/classes/api" srcdir="modeling/api">
<classpath>
<pathelement location="android-lib/android-impl.jar"/>
</classpath>
</javac>
<jar destfile="${eclipse-plugin-path}/android-lib/droidsafe-api-model.jar" basedir="${eclipse-plugin-path}/modeling/classes/api" includes="**/*.class">
</jar>
</target>
<!--
==========================================================================
COMPILE DROIDSAFE
==========================================================================
-->
<target name="compile" description="Compile DroidSafe." depends="build-libs,droidsafe-calls-build,compile-model" unless="droidsafe.core-uptodate">
<mkdir dir="${eclipse-plugin-path}/classes/main"/>
<javac debug="true" debuglevel="source,lines,vars" includeAntRuntime="false" includeJavaRuntime="false" destdir="${eclipse-plugin-path}/classes/main" srcdir="src/main/java" classpathref="lib-jars">
</javac>
<jar destfile="${eclipse-plugin-path}/lib/droidsafe-core.jar" basedir="${eclipse-plugin-path}/classes/main" includes="**/*.class">
<manifest>
<attribute name="Main-Class" value="droidsafe.main.Main"/>
<attribute name="Boot-Class-Path" value="droidsafe-core.jar"/>
</manifest>
</jar>
</target>
<target name="clean" description="Clean all generated files.">
<delete dir="${eclipse-plugin-path}/classes"/>
<delete dir="${eclipse-plugin-path}/modeling/classes"/>
<delete file="${eclipse-plugin-path}/lib/droidsafe-core.jar"/>
<delete file="${eclipse-plugin-path}/lib/droidsafe-libs.jar"/>
<delete file="${eclipse-plugin-path}/android-lib/droidsafe-api-model.jar"/>
<delete file="${eclipse-plugin-path}/android-lib/droidcalls.jar"/>
<delete dir="test-reports"/>
</target>
<!--
==========================================================================
TEST DROIDSAFE
==========================================================================
-->
<target name="compile-tests" depends="compile">
<mkdir dir="classes/test"/>
<javac debug="true" debuglevel="source,lines,vars" includeAntRuntime="false" includeJavaRuntime="false"
destdir="classes/test" srcdir="src/test/java">
<classpath id="path.classpath.compile">
<pathelement path="classes/main"/>
<pathelement path="lib/junit-4.11.jar"/>
<pathelement location="lib/commons-cli-1.2.jar"/>
<pathelement location="lib/slf4j-api-1.7.2.jar"/>
<pathelement location="lib/commons-lang3-3.1.jar"/>
</classpath>
</javac>
<jar destfile="bin/droidsafe-test.jar" basedir="classes/test" includes="**/*.class">
<manifest>
<attribute name="Main-Class" value="droidsafe.test.Main"/>
<attribute name="Boot-Class-Path" value="droidsafe-test.jar"/>
</manifest>
</jar>
</target>
<target name="run-tests"
description="Run a JUnit test under tests/java/droidsafe/test. Specify name or pattern with -Dtest.class=ClassName"
depends="compile-tests">
<property name="timeout" value="-1"/>
<fail unless="test.class"
message="Please define a test class with -Dtest.class=ClassName (no file extension) to run this target. This will run any tests under test/java/droidsafe/test matching the given class name to be run. May include wildcards."/>
<mkdir dir="test-reports"/>
<junit fork="true" forkmode="perTest" printsummary="on" logfailedtests="on">
<formatter type="xml"/>
<!-- let user set their desired per-test timeout value -->
<sysproperty key="timeout" value="${timeout}"/>
<classpath>
<pathelement path="classes/main"/>
<pathelement path="classes/test"/>
<path refid="lib-jars"/>
</classpath>
<batchtest todir="test-reports">
<fileset dir="test/java">
<include name="droidsafe/test/**/${test.class}.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="run-specdump-test" depends="compile-tests">
<!-- defaults for values users can specify-->
<property name="timeout" value="70"/>
<property name="dir.to.search" value=""/>
<mkdir dir="test-reports"/>
<junit fork="true" forkmode="perTest" printsummary="on" logfailedtests="on">
<formatter type="xml"/>
<!-- let user set their desired per-test timeout value -->
<sysproperty key="timeout" value="${timeout}"/>
<!-- let user limit app search to a particular subdirectory (wildcards allowed) -->
<sysproperty key="dir-to-search" value="${dir.to.search}"/>
<classpath>
<pathelement path="classes/main"/>
<pathelement path="classes/test"/>
<pathelement location="lib/junit-4.11.jar"/>
<pathelement location="lib/slf4j-api-1.7.2.jar"/>
<pathelement location="lib/hamcrest-core-1.3.jar"/>
<pathelement location="lib/logback-classic-1.0.7.jar"/>
<pathelement location="lib/logback-core-1.0.7.jar"/>
</classpath>
<batchtest todir="test-reports">
<fileset dir="src/test/java">
<include name="droidsafe/test/SpecdumpTestCase.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="run-regression-tests" description="Run regression tests." depends="compile-tests">
<antcall target="run-specdump-test"/>
<mkdir dir="test-reports/regression/"/>
<junit fork="true" forkmode="perTest" printsummary="on" logfailedtests="on">
<formatter type="xml"/>
<classpath>
<pathelement path="classes/main"/>
<pathelement path="classes/test"/>
<pathelement location="lib/junit-4.11.jar"/>
<pathelement location="lib/slf4j-api-1.7.2.jar"/>
<pathelement location="lib/hamcrest-core-1.3.jar"/>
<pathelement location="lib/logback-classic-1.0.7.jar"/>
<pathelement location="lib/logback-core-1.0.7.jar"/>
<pathelement location="lib/commons-lang3-3.1.jar"/>
</classpath>
<batchtest todir="test-reports/regression/">
<fileset dir="src/test/java">
<include name="droidsafe/test/regression/*TestCase.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="update-specdump-regression-values" depends="compile-tests">
<java classname="droidsafe.test.Main">
<arg value="-target"/>
<arg value="update-specdump-regression-values"/>
<classpath>
<pathelement location="bin/droidsafe-core.jar"/>
<pathelement location="bin/droidsafe-test.jar"/>
<pathelement location="lib/commons-cli-1.2.jar"/>
<pathelement location="lib/slf4j-api-1.7.2.jar"/>
<pathelement location="lib/logback-classic-1.0.7.jar"/>
<pathelement location="lib/logback-core-1.0.7.jar"/>
<pathelement location="lib/commons-lang3-3.1.jar"/>
</classpath>
</java>
</target>
</project>