forked from deltixlab/DFP
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
34 lines (30 loc) · 1.38 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
def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
allprojects {
ext.versioning = {
def finder = (version =~ /(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?/)
def versionMajor = finder[0][1] as Integer
def versionMinor = finder[0][2] as Integer
def versionBuild = finder[0][3] as Integer
def versionCommit = finder[0][4] != null ? (finder[0][4] as Integer) : 0
//"git rev-list --count HEAD".execute().text.replace("\n", "").replace("\r", "") as Integer
def version4 = "$versionMajor.$versionMinor.$versionBuild.$versionCommit"
def versionSha = getGitHash()
def versionSuffix = version.replace(".", "x").replace("-", "x")
//def versionSuffixFile = new File("$rootDir/versionSuffix.txt")
//if (versionSuffixFile.exists())
// versionSuffix = versionSuffixFile.text.trim()
//else
// versionSuffixFile.write versionSuffix
return ["major": versionMajor, "minor": versionMinor, "build": versionBuild, "commit": versionCommit,
"three": version, "four": version4, "suffix": versionSuffix, "sha": versionSha]
}
project.ext.set("javaPrefix", "com_epam_deltix_dfp_NativeImpl_")
project.ext.set("javaMathPrefix", "com_epam_deltix_dfpmath_NativeMathImpl_")
}