mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	fix fetching git info from Gradle
This commit is contained in:
		| @@ -1,27 +1,4 @@ | ||||
| import groovy.json.JsonSlurper | ||||
|  | ||||
| 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 | ||||
| 	gitInfoLauncher = "none" | ||||
| 	gitInfoVcmi = "none" | ||||
|  | ||||
| 	//logger.info("Base path = ${PROJECT_PATH_BASE}") | ||||
| } | ||||
|   | ||||
| @@ -74,7 +74,7 @@ def RenameOutput(final baseName, final variant) { | ||||
|  | ||||
| 	ResolveGitInfo() | ||||
|  | ||||
| 	def name = baseName + "-" + ext.gitInfoLauncher + "-" + ext.gitInfoVcmi | ||||
| 	def name = baseName + "-" + ext.gitInfoVcmi | ||||
|  | ||||
| 	if (buildTaskId != null && !buildTaskId.isEmpty()) { | ||||
| 		name = buildTaskId + "-" + name | ||||
| @@ -109,14 +109,13 @@ def CommandOutput(final cmd, final arguments, final cwd) { | ||||
| } | ||||
|  | ||||
| def ResolveGitInfo() { | ||||
| 	if (ext.gitInfoLauncher != "none" && ext.gitInfoVcmi != "none") { | ||||
| 	if (ext.gitInfoVcmi != "none") { | ||||
| 		return | ||||
| 	} | ||||
| 	ext.gitInfoLauncher = CommandOutput("git", ["describe", "--match=", "--always", "--abbrev=7"], PROJECT_PATH_BASE) | ||||
| 	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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user