-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
57 lines (45 loc) · 990 Bytes
/
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
version = '2.3.0'
ext {
isReleaseBuild = false
}
def getBuildSuffix() {
return 'git rev-list HEAD --count'.execute().text.trim()
}
def isDirty() {
def dirty = 'git diff --shortstat'.execute().text.trim()
if (dirty == "") {
return false
} else {
return true;
}
}
def isRelease() {
def getRelease = "git describe --exact-match --tags HEAD".execute()
getRelease.waitFor()
if (getRelease.exitValue() == 0) {
return true
} else {
return false
}
}
//set build variables based on build type (release, continuous integration, development)
ext.isReleaseBuild = isRelease()
if (!ext.isReleaseBuild) {
version = version + "-" + getBuildSuffix()
}
if (isDirty()) {
version = version + "+dirty"
}
subprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
repositories {
mavenCentral()
}
}
configure(subprojects.findAll {(it.name != 'devscan')}) {
apply plugin: 'application'
}
task createWrapper(type: Wrapper) {
gradleVersion = '5.2'
}