mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-15 13:33:36 +02:00
fix fetching git info from Gradle
This commit is contained in:
parent
c960cb0506
commit
dad5b93706
@ -1,27 +1,4 @@
|
|||||||
import groovy.json.JsonSlurper
|
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
final def jsonFile = rootProject.file("../vcmiconf.json")
|
|
||||||
final def rawConf = new JsonSlurper().parseText(jsonFile.text)
|
|
||||||
|
|
||||||
PROJECT_PATH_BASE = jsonFile.getParentFile().getAbsolutePath().replace('\\', '/')
|
|
||||||
VCMI_PATH_EXT = "${PROJECT_PATH_BASE}/ext"
|
|
||||||
VCMI_PATH_MAIN = "${PROJECT_PATH_BASE}/project"
|
|
||||||
|
|
||||||
VCMI_PATH_VCMI = "${VCMI_PATH_EXT}/vcmi"
|
|
||||||
|
|
||||||
// can be 16 if building only for armeabi-v7a, definitely needs to be 21+ to build arm64 and x86_64
|
|
||||||
VCMI_PLATFORM = rawConf.androidApi
|
|
||||||
// we should be able to use the newest version to compile, but it seems that gradle-experimental is somehow broken and doesn't compile native libs correctly for apis older than this setting...
|
|
||||||
VCMI_COMPILE_SDK = 26
|
|
||||||
VCMI_ABIS = rawConf.abis.split(" ")
|
|
||||||
|
|
||||||
VCMI_STL_VERSION = "c++_shared"
|
|
||||||
VCMI_BUILD_TOOLS = "25.0.2"
|
|
||||||
|
|
||||||
// these values will be retrieved during gradle build
|
// these values will be retrieved during gradle build
|
||||||
gitInfoLauncher = "none"
|
|
||||||
gitInfoVcmi = "none"
|
gitInfoVcmi = "none"
|
||||||
|
|
||||||
//logger.info("Base path = ${PROJECT_PATH_BASE}")
|
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ def RenameOutput(final baseName, final variant) {
|
|||||||
|
|
||||||
ResolveGitInfo()
|
ResolveGitInfo()
|
||||||
|
|
||||||
def name = baseName + "-" + ext.gitInfoLauncher + "-" + ext.gitInfoVcmi
|
def name = baseName + "-" + ext.gitInfoVcmi
|
||||||
|
|
||||||
if (buildTaskId != null && !buildTaskId.isEmpty()) {
|
if (buildTaskId != null && !buildTaskId.isEmpty()) {
|
||||||
name = buildTaskId + "-" + name
|
name = buildTaskId + "-" + name
|
||||||
@ -109,14 +109,13 @@ def CommandOutput(final cmd, final arguments, final cwd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def ResolveGitInfo() {
|
def ResolveGitInfo() {
|
||||||
if (ext.gitInfoLauncher != "none" && ext.gitInfoVcmi != "none") {
|
if (ext.gitInfoVcmi != "none") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ext.gitInfoLauncher = CommandOutput("git", ["describe", "--match=", "--always", "--abbrev=7"], PROJECT_PATH_BASE)
|
|
||||||
ext.gitInfoVcmi =
|
ext.gitInfoVcmi =
|
||||||
CommandOutput("git", ["log", "-1", "--pretty=%D", "--decorate-refs=refs/remotes/origin/*"], PROJECT_PATH_BASE + "/ext/vcmi").replace("origin/", "").replace(", HEAD", "").replaceAll("[^a-zA-Z0-9\\-_]", "_") +
|
CommandOutput("git", ["log", "-1", "--pretty=%D", "--decorate-refs=refs/remotes/origin/*"], ".").replace("origin/", "").replace(", HEAD", "").replaceAll("[^a-zA-Z0-9\\-_]", "_") +
|
||||||
"-" +
|
"-" +
|
||||||
CommandOutput("git", ["describe", "--match=", "--always", "--abbrev=7"], PROJECT_PATH_BASE + "/ext/vcmi")
|
CommandOutput("git", ["describe", "--match=", "--always", "--abbrev=7"], ".")
|
||||||
}
|
}
|
||||||
|
|
||||||
def SigningPropertiesPath(final basePath) {
|
def SigningPropertiesPath(final basePath) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user