mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Always get the latest commit count for jar name (#763)
When adding commits or switching between branches the "shadowJar" gradle task always used the same (outdated) commit count which created jars with confusing names
This commit is contained in:
@@ -14,8 +14,9 @@ val tachideskVersion = System.getenv("ProductVersion") ?: "v0.7.0"
|
|||||||
|
|
||||||
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r983"
|
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r983"
|
||||||
|
|
||||||
// counts commits on the master branch
|
// counts commits on the current checked out branch
|
||||||
val tachideskRevision = runCatching {
|
val getTachideskRevision = {
|
||||||
|
runCatching {
|
||||||
System.getenv("ProductRevision") ?: ProcessBuilder()
|
System.getenv("ProductRevision") ?: ProcessBuilder()
|
||||||
.command("git", "rev-list", "HEAD", "--count")
|
.command("git", "rev-list", "HEAD", "--count")
|
||||||
.start()
|
.start()
|
||||||
@@ -27,5 +28,6 @@ val tachideskRevision = runCatching {
|
|||||||
process.destroy()
|
process.destroy()
|
||||||
"r" + output.trim()
|
"r" + output.trim()
|
||||||
}
|
}
|
||||||
}.getOrDefault("r0")
|
}.getOrDefault("r0")
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ buildConfig {
|
|||||||
|
|
||||||
buildConfigField("String", "NAME", quoteWrap(rootProject.name))
|
buildConfigField("String", "NAME", quoteWrap(rootProject.name))
|
||||||
buildConfigField("String", "VERSION", quoteWrap(tachideskVersion))
|
buildConfigField("String", "VERSION", quoteWrap(tachideskVersion))
|
||||||
buildConfigField("String", "REVISION", quoteWrap(tachideskRevision))
|
buildConfigField("String", "REVISION", quoteWrap(getTachideskRevision()))
|
||||||
buildConfigField("String", "BUILD_TYPE", quoteWrap(if (System.getenv("ProductBuildType") == "Stable") "Stable" else "Preview"))
|
buildConfigField("String", "BUILD_TYPE", quoteWrap(if (System.getenv("ProductBuildType") == "Stable") "Stable" else "Preview"))
|
||||||
buildConfigField("long", "BUILD_TIME", Instant.now().epochSecond.toString())
|
buildConfigField("long", "BUILD_TIME", Instant.now().epochSecond.toString())
|
||||||
|
|
||||||
@@ -126,12 +126,12 @@ tasks {
|
|||||||
"Implementation-Title" to rootProject.name,
|
"Implementation-Title" to rootProject.name,
|
||||||
"Implementation-Vendor" to "The Suwayomi Project",
|
"Implementation-Vendor" to "The Suwayomi Project",
|
||||||
"Specification-Version" to tachideskVersion,
|
"Specification-Version" to tachideskVersion,
|
||||||
"Implementation-Version" to tachideskRevision,
|
"Implementation-Version" to getTachideskRevision(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
archiveBaseName.set(rootProject.name)
|
archiveBaseName.set(rootProject.name)
|
||||||
archiveVersion.set(tachideskVersion)
|
archiveVersion.set(tachideskVersion)
|
||||||
archiveClassifier.set(tachideskRevision)
|
archiveClassifier.set(getTachideskRevision())
|
||||||
destinationDirectory.set(File("$rootDir/server/build"))
|
destinationDirectory.set(File("$rootDir/server/build"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user