forked from nccgroup/freddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
55 lines (48 loc) · 1.43 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
plugins {
id 'java'
id 'idea'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'net.portswigger.burp.extender:burp-extender-api:1.7.22'
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:2.+"
testCompile 'org.powermock:powermock-module-junit4:1.7.4'
testCompile 'org.powermock:powermock-api-mockito2:1.7.4'
}
def getVersionName = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--abbrev=0'
standardOutput = stdout
}
def tag = stdout.toString().trim()
stdout.reset()
exec {
commandLine 'git', 'describe', '--all'
standardOutput = stdout
}
if ('heads/master'.equalsIgnoreCase(stdout.toString().trim()) || stdout.toString().trim().contains(tag)) {
return tag
} else {
// Adding the branch name to the version
def ver = stdout.toString().trim()
return tag+'-' + ver.substring(ver.indexOf('/')+1)
}
}
catch (ignored) {
return null
}
}
sourceCompatibility = 1.8
// deviates from standard Gradle directory structure
sourceSets.main.java.srcDirs = ['src']
sourceSets.test.java.srcDirs = ['test']
version = getVersionName()
group 'trust.nccgroup'
jar {
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
}