File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -61,9 +61,20 @@ tasks {
6161 if (project.property(" enableTestClient" ) !in arrayOf(null , false ))
6262 from(project(" :test-client" ).getTasksByName(" copyLogbackConfig" , false ))
6363 from(project(" :player" ).getTasksByName(" shadowJar" , false ))
64- exec {
65- commandLine(" git" , " describe" , " --long" , " --tags" )
66- standardOutput = runnableDir.resolve(" version" ).outputStream()
64+
65+ val versionFile = runnableDir.resolve(" version" )
66+ try {
67+ exec {
68+ commandLine(" git" , " describe" , " --long" , " --tags" )
69+ standardOutput = versionFile.outputStream()
70+ }
71+ } catch (e: Exception ) {
72+ println (" Issue with git describe for version detection, falling back to rev-parse: $e " )
73+ println (versionFile.readText())
74+ exec {
75+ commandLine(" git" , " rev-parse" , " HEAD" )
76+ standardOutput = versionFile.outputStream()
77+ }
6778 }
6879 }
6980 }
You can’t perform that action at this time.
0 commit comments