-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathbuild.gradle
60 lines (46 loc) · 1.44 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
group 'ch.securify'
apply plugin: 'java'
apply plugin: 'idea'
def computeVersion() {
if (System.env.SECURIFY_VERSION) {
return System.env.SECURIFY_VERSION;
}
def default_version = "unknown_version"
try {
def dirty = "git diff-index --quiet HEAD".execute()
dirty.waitFor()
def suffix = dirty.exitValue() ? "-dirty" : ""
def proc = "git describe --long".execute()
proc.waitFor()
return proc.exitValue() ? default_version : proc.text.trim() + suffix
} catch (IOException e) {
return default_version
}
}
jar {
manifest {
attributes 'Main-Class': 'ch.securify.Main'
attributes('Implementation-Title': project.name,
'Implementation-Version': computeVersion()
)
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
task compileSouffle(type: Exec) {
doFirst {mkdir project.buildDir}
executable "./build_souffle.sh"
}
compileJava.dependsOn compileSouffle
repositories {
mavenCentral()
}
dependencies {
compile "com.beust:jcommander:1.48"
compile group: 'com.google.guava', name: 'guava', version: '27.0.1-jre'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
// https://mvnrepository.com/artifact/org.apache.commons/commons-csv
compile group: 'org.apache.commons', name: 'commons-csv', version: '1.4'
testCompile group: 'junit', name: 'junit', version: '4.12'
}