-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
188 lines (172 loc) · 5.91 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.ajoberstar.grgit.Grgit
plugins {
kotlin("jvm") version "1.4.21"
id("com.github.johnrengelman.shadow") version "4.0.2"
id("maven-publish")
id("org.ajoberstar.grgit") version "4.1.0"
}
group = "saarland.cispa"
version = "1.0.93-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
publishing {
publications {
create<MavenPublication>("main") {
from(components["kotlin"])
// artifact(tasks["sourcesJar"])
}
}
repositories {
mavenLocal()
}
}
repositories {
jcenter()
mavenLocal()
// maven { url = uri("https://soot-build.cs.uni-paderborn.de/nexus/repository/soot-snapshot/") }
// maven {
// url = uri("https://soot-build.cs.uni-paderborn.de/nexus/repository/soot-release/")
// content {
// excludeModule("de.fraunhofer.iem", "boomerangPDS")
// }
// }
// maven { url = uri("http://nexus.st.cs.uni-saarland.de:8081/artifactory/libs-snapshot-local/") }
maven { url = uri("http://www.i3s.unice.fr/~hogie/maven_repository/") }
}
dependencies {
implementation("de.fraunhofer.iem", "boomerangPDS", "2.5.1k-SNAPSHOT") {
exclude("ca.mcgill.sable", "soot")
exclude("org.slf4j", "slf4j-simple")
exclude("org.slf4j", "slf4j-log4j12")
}
implementation("io.github.microutils:kotlin-logging:1.6.22")
runtimeOnly("org.slf4j:slf4j-log4j12:1.7.25")
runtimeOnly("org.apache.logging.log4j:log4j-core:2.11.0")
implementation("ca.mcgill.sable:soot:4.1.0-SNAPSHOT")
implementation("de.tud.sse:soot-infoflow-android:2.7.3-SNAPSHOT") {
exclude("ca.mcgill.sable", "soot")
exclude("org.slf4j", "slf4j-simple")
exclude("org.slf4j", "slf4j-log4j12")
}
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3")
implementation("com.google.code.gson:gson:2.8.5")
implementation("com.github.ajalt:clikt:2.8.0")
// implementation("com.github.pemistahl:lingua:0.6.1")
implementation(files("local_libs/langdetect.jar"))
implementation("net.arnx:jsonic:1.3.0") //langdetect dependency
testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
testImplementation("org.assertj:assertj-core:3.9.1")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.3.1")
}
tasks {
register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
withType<Test> {
useJUnitPlatform()
systemProperties["android_jar"] = project.ext["android_jar"]
}
withType<JavaCompile> {
options.compilerArgs.add("-Xlint")
options.isFork = true
}
withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "11"
}
withType<Jar> {
manifest {
attributes["Main-Class"] = "saarland.cispa.frontmatter.MainKt"
attributes["Implementation-Version"] = project.version
}
}
withType<Wrapper>{
gradleVersion = "6.8.3"
}
}
val sootDir = "$buildDir/soot"
val boomerangDir = "$buildDir/boomerang"
val flowdroidDir = "$buildDir/flowdroid"
val sootRepo = "https://github.com/soot-oss/soot.git"
val boomerangRepo = "https://github.com/CROSSINGTUD/SPDS.git"
val flowdroidRepo = "https://github.com/secure-software-engineering/FlowDroid.git"
task("cloneSoot") {
description = "Clone soot"
onlyIf { !file(sootDir).exists()}
doLast {
val sootCommit = "c53e51cd406a78ed622d71e0e2082c308b07f4b8"
val sootPatch = "$projectDir/patches/soot.patch"
val grgit = Grgit.clone(
mapOf(
"dir" to sootDir, "uri" to sootRepo, "checkout" to false,
"all" to false
)
)
grgit.checkout(mapOf("branch" to sootCommit))
grgit.apply(mapOf("patch" to sootPatch))
grgit.close()
}
}
task<Exec>("installSoot") {
dependsOn("cloneSoot")
description = "Build soot artifact"
workingDir(sootDir)
commandLine("mvn", "install", "-DskipTests=true")
}
task("cloneBoomerang") {
description = "Clone Boomerang"
onlyIf { !file(boomerangDir).exists() }
doLast {
val boomerangCommit = "ca61b982878b7c81a674dff5c6909d2bae74bd6e"
val boomerangPatch = "$projectDir/patches/boomerang.patch"
val grgit = Grgit.clone(
mapOf(
"dir" to boomerangDir, "uri" to boomerangRepo, "checkout" to false,
"all" to false
)
)
grgit.checkout(mapOf("branch" to boomerangCommit))
grgit.apply(mapOf("patch" to boomerangPatch))
grgit.close()
}
}
task<Exec>("installBoomerang") {
dependsOn("cloneBoomerang")
description = "Build boomerang artifact"
workingDir(boomerangDir)
commandLine("mvn", "install", "-DskipTests=true")
}
task("cloneFlowdroid") {
description = "Clone Flowdroid"
onlyIf { !file(flowdroidDir).exists() }
doLast {
val flowdroidCommit = "23e93292e453b3655b4a848271890389e0016e61"
val flowdroidPatch = "${projectDir}/patches/flowdroid.patch"
val grgit = Grgit.clone(
mapOf(
"dir" to flowdroidDir, "uri" to flowdroidRepo, "checkout" to false,
"all" to false
)
)
grgit.checkout(mapOf("branch" to flowdroidCommit))
grgit.apply(mapOf("patch" to flowdroidPatch))
grgit.close()
}
}
task<Exec>("installFlowdroid") {
dependsOn("cloneFlowdroid")
dependsOn("installSoot")
description = "Build Flowdroid artifact"
workingDir(flowdroidDir)
commandLine("mvn", "install", "-DskipTests=true")
}
task("installDependencies") {
dependsOn("installSoot")
dependsOn("installBoomerang")
dependsOn("installFlowdroid")
tasks.findByName("installBoomerang")?.mustRunAfter("installSoot")
tasks.findByName("installFlowdroid")?.mustRunAfter("installSoot")
}