-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
285 lines (244 loc) · 9.02 KB
/
build.gradle
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
import java.nio.file.Files
import static java.nio.file.attribute.PosixFilePermissions.*
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'commons-io:commons-io:2.4'
}
}
plugins {
id 'antlr'
id 'application'
id 'groovy'
id 'maven-publish'
//see https://github.com/researchgate/gradle-release
id 'net.researchgate.release' version '2.6.0'
}
applicationDefaultJvmArgs = ["-Xmx12000m", "-Xss2000m"]
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
group = "org.clyze"
//For the doop app
mainClassName = "org.clyze.doop.Main"
//def heapDLVersion = "master-SNAPSHOT"
def heapDLVersion = "1.0.2"
if (project.hasProperty('heapDLVersion'))
heapDLVersion = project.property('heapDLVersion')
wrapper {
gradleVersion = "4.9"
}
repositories {
mavenLocal()
maven { url "http://centauri.di.uoa.gr:8081/artifactory/plast-deps" }
maven { url "http://centauri.di.uoa.gr:8081/artifactory/plast-public" }
maven {
name "soot-snapshot"
url "https://soot-build.cs.uni-paderborn.de/nexus/repository/soot-snapshot"
}
maven {
name "soot-release"
url "https://soot-build.cs.uni-paderborn.de/nexus/repository/soot-release"
}
if (heapDLVersion == "master-SNAPSHOT")
maven { url 'https://jitpack.io' }
}
configurations.all {
//This is required for SNAPSHOT dependencies
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
//This is required for dependencies using the "+" notation
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
dependencies {
compile "org.clyze:clue-common:3.8.+",
"org.clyze:deepdoop:0.9.+",
"org.codehaus.groovy:groovy-all:2.4.13", // Groovy
"commons-logging:commons-logging:1.1", // Logging wrapper
"log4j:log4j:1.2.14", // Logging implementation
"commons-cli:commons-cli:1.2", // Command line processor
"commons-io:commons-io:2.4", // File Utils
"org.apache.ivy:ivy:2.3.0", // Apache Ivy (for downloading jars from maven repos)
"org.ow2.asm:asm-debug-all:5.1", // Java Bytecode library
"org.smali:dexlib2:2.2.5", // Dexlib2: library for reading/modifying/writing Android dex files
"com.google.code.gson:gson:2.4", // GSON library
"com.github.plast-lab:HeapDL:$heapDLVersion",
"net.dongliu:apk-parser:2.6.2", // needed for reading binary XML entries from APK inputs
// "ext:apktool:2.3.3", // needed for decoding APK inputs (optional)
// Soot
"ext:AXMLPrinter:2.0",
// Upstream stable version, to be used instead of ext:sootclasses.
// "ca.mcgill.sable:soot:3.1.0",
// Doop's Soot fork.
"ext:sootclasses:3.2.7",
"ext:soot-infoflow:2.5.1",
"ext:soot-infoflow-android:2.5.1",
/// WALA
/// https://mvnrepository.com/artifact/com.ibm.wala/com.ibm.wala.util
//"com.ibm.wala:com.ibm.wala.util:1.4.3",
"ext:com.ibm.wala.util:1.5.1-SNAPSHOT",
/// https://mvnrepository.com/artifact/com.ibm.wala/com.ibm.wala.core
//"com.ibm.wala:com.ibm.wala.core:1.4.3",
"ext:com.ibm.wala.core:1.5.1-SNAPSHOT",
/// https://mvnrepository.com/artifact/com.ibm.wala/com.ibm.wala.shrike
//"com.ibm.wala:com.ibm.wala.shrike:1.4.3",
"ext:com.ibm.wala.shrike:1.5.1-SNAPSHOT",
/// https://mvnrepository.com/artifact/com.ibm.wala/com.ibm.wala.dalvik
//"com.ibm.wala:com.ibm.wala.dalvik:1.4.3"
"ext:com.ibm.wala.dalvik:1.5.1-SNAPSHOT",
"ext:com.ibm.wala.cast:1.5.1-SNAPSHOT",
"ext:com.ibm.wala.cast.java:1.5.1-SNAPSHOT",
"ext:com.ibm.wala.cast.python:0.0.1-SNAPSHOT",
"ext:com.ibm.wala.cast.lsp:0.0.1-SNAPSHOT",
"org.python:jython:2.7.1b3"
//"commons-cli:commons-cli:1.3.1",
//"org.eclipse.lsp4j:org.eclipse.lsp4j:0.4.0"
// JPhantom is a runtime dependency
runtime "org.clyze:jphantom:1.2",
"ext:herosclasses:1.1",
"ext:axml:2.0",
"org.smali:util:2.2.5", // Dexlib2 utilities
"com.google.guava:guava:23.0",
"ext:scaler:1.0",
"ext:zipper:1.0"
// JimpleParser
antlr "org.antlr:antlr4:4.5.1-1"
compile "org.antlr:antlr4-runtime:4.5.1-1"
testCompile "org.spockframework:spock-core:1.0-groovy-2.4"
}
applicationDistribution.from(file("$projectDir/logic")) {
into 'logic'
}
applicationDistribution.from(file("$projectDir/souffle-logic")) {
into 'souffle-logic'
}
applicationDistribution.from(projectDir) {
include 'docs', 'COLLABORATORS', 'LICENSE', 'README.md'
}
run {
//debug true
// We set the DOOP_HOME environment variable (see org.clyze.doop.Main)
environment.DOOP_HOME = projectDir
if (project.hasProperty('args')) {
args project.property('args').split()
}
}
task jimple2json(type: JavaExec) {
description 'Generate JSON files from Jimple'
group = 'Other'
main = 'org.clyze.jimple.Main'
classpath = sourceSets.main.runtimeClasspath
if (project.hasProperty("args"))
args project.property("args").split()
}
task scaler(type: JavaExec) {
description 'Run Scaler'
group = 'Other'
main = 'ptatoolkit.scaler.doop.Main'
classpath = sourceSets.main.runtimeClasspath.filter {
!it.name.startsWith("zipper")
}
if (project.hasProperty("args"))
args project.property("args").split()
//jvmArgs = ['-Xmx=48g']
}
task zipper(type: JavaExec) {
description 'Run Zipper'
group = 'Other'
main = 'ptatoolkit.zipper.doop.Main'
classpath = sourceSets.main.runtimeClasspath.filter {
!it.name.startsWith("scaler")
}
if (project.hasProperty("args"))
args project.property("args").split()
//jvmArgs = ['-Xmx=48g']
}
task soot(type: JavaExec) {
description 'Run Soot front-end'
group = 'Other'
main = 'org.clyze.doop.soot.Main$Standalone'
classpath = sourceSets.main.runtimeClasspath
if (project.hasProperty("args"))
args project.property("args").split()
//jvmArgs = ['-Xmx=48g']
}
task souffleScript(type: JavaExec) {
description 'Run a custom Souffle Script'
group = 'Other'
main = 'org.clyze.doop.utils.SouffleScriptMain'
classpath = sourceSets.main.runtimeClasspath
if (project.hasProperty("args"))
args project.property("args").split()
}
task createEmptyProperties {
doLast {
def urls = sourceSets.main.runtimeClasspath.files.collect { it.toURI().toURL() } as URL[]
def classloader = new URLClassLoader(urls, null as ClassLoader)
Class
.forName("org.clyze.doop.CommandLineAnalysisFactory", true, classloader)
.createEmptyProperties(new File("empty.properties"))
}
}
compileJava {
options.compilerArgs << '-Xlint:unchecked'
}
test {
// failFast = true
maxParallelForks = 4
testLogging {
exceptionFormat = 'full'
}
environment.DOOP_HOME = projectDir
environment.HOME = Files.createTempDirectory("lb-test-home-dir", asFileAttribute(fromString("rwxrwxrwx"))).toString()
}
task fullClean {
description 'Clean everything, including caches and analysis results.'
doLast {
def out = System.getenv('DOOP_OUT') ?: "$projectDir/out"
def cache = System.getenv('DOOP_CACHE') ?: "$projectDir/cache"
file(out ).list().each { f -> delete "$out/$f" }
file(cache ).list().each { f -> delete "$cache/$f" }
file('results').list().each { f -> delete "results/$f" }
org.apache.commons.io.FileUtils.deleteQuietly(new File('last-analysis'))
}
}
fullClean.dependsOn clean
task printClasspath {
doLast {
configurations.compile.each { println it }
}
}
if (project.hasProperty('artifactory_user')) {
// Generate a jar with all the logic files
task logicFilesJar(type: Jar) {
into('logic') { from "logic" }
into('souffle-logic') { from "souffle-logic" }
into('souffle-scripts') { from "souffle-scripts" }
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact logicFilesJar {
classifier "logic-files"
}
}
}
repositories {
maven {
credentials {
username artifactory_user
password artifactory_password
}
url "$artifactory_contextUrl/libs-release-local"
}
}
}
release {
failOnSnapshotDependencies = false
git {
commitVersionFileOnly = true
}
}
afterReleaseBuild.dependsOn publish
}