forked from PeterCxy/OpenEUICC
buildSrc: Use HEAD rev count as version code
In Actions, we do not always have a checkout of the master branch. This only applies to release builds anyway. For debug builds, we always use the timestamp.
This commit is contained in:
parent
ca0085e147
commit
8ee3c53492
|
@ -12,7 +12,7 @@ val Project.gitVersionCode: Int
|
||||||
try {
|
try {
|
||||||
val stdout = ByteArrayOutputStream()
|
val stdout = ByteArrayOutputStream()
|
||||||
exec {
|
exec {
|
||||||
commandLine("git", "rev-list", "--first-parent", "--count", "master")
|
commandLine("git", "rev-list", "--first-parent", "--count", "HEAD")
|
||||||
standardOutput = stdout
|
standardOutput = stdout
|
||||||
}
|
}
|
||||||
stdout.toString("utf-8").trim('\n').toInt()
|
stdout.toString("utf-8").trim('\n').toInt()
|
||||||
|
|
Loading…
Reference in a new issue