forked from GTNewHorizons/GT5-Unofficial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addon.gradle
41 lines (39 loc) · 1.31 KB
/
addon.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
compileJava {
options.encoding = "UTF-8"
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
minecraft {
def vMajor, vMinor, vPatch, logLevel = LogLevel.INFO
try {
String version = project.version
def (five,major,minor,patch)= version.split("[.-]", 5)
vMajor = 500 + major.toInteger()
vMinor = minor.toInteger()
vPatch = patch.toInteger()
} catch (Exception ex) {
try {
String version = "git describe".execute().text
def (five,major,minor,patch)= version.split("[.-]", 5)
vMajor = 500 + major.toInteger()
vMinor = minor.toInteger()
vPatch = patch.toInteger()
logLevel = LogLevel.LIFECYCLE
} catch (Exception ex2) {
def err = "Cannot automatically determine NBT version. Using defaults hardcoded in buildscript. This could break your world!"
project.logger.error(err)
vMajor = 509
vMinor = 42
vPatch = 55
logLevel = LogLevel.WARN
}
}
injectedTags.put 'VERSION_MAJOR', vMajor
injectedTags.put 'VERSION_MINOR', vMinor
injectedTags.put 'VERSION_PATCH', vPatch
project.logger.log(logLevel, 'Using ({}, {}, {}) as NBT version', vMajor, vMinor, vPatch)
}