-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
47 lines (41 loc) · 1.21 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
import org.joda.time.DateTime
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'joda-time:joda-time:2.10.10'
}
}
ext {
getGitInfo = {
return [
branch : 'git rev-parse --abbrev-ref HEAD'.execute().text.trim(),
id : 'git rev-parse HEAD'.execute().text.trim(),
rev : 'git rev-list --count HEAD'.execute().text.trim(),
origin : 'git config --get remote.origin.url'.execute().text.trim()
]
}
gitInfo = getGitInfo()
buildSummary = gitInfo.id
hostname = InetAddress.getLocalHost().getHostName().toUpperCase()
now = DateTime.now().toString()
rev = gitInfo.rev.replaceAll(/[^a-zA-Z0-9]/, '')
branch = gitInfo.branch
if (branch == 'master') {
branch = 'release'
} else if (branch.contains('/')) {
branch = branch.substring(branch.indexOf('/') + 1)
}
baseVersion = '2.2.1'
versionIdentifier = "${baseVersion}-${branch}_r${rev}"
println "versionIdentifier: ${versionIdentifier}"
}
subprojects {
apply plugin: 'java'
group = 'org.nodel'
version = rootProject.ext.baseVersion
repositories {
mavenCentral()
}
}