fix: versioning and changelog parsing
This commit is contained in:
@@ -1169,15 +1169,17 @@ class HomeRootSection : Routes.Route() {
|
||||
private fun extractChangelogForVersion(raw: String, version: String): String {
|
||||
val lines = raw.lines()
|
||||
val headerRegex = Regex("^\\s*#+\\s*v?${Regex.escape(version)}\\b", RegexOption.IGNORE_CASE)
|
||||
var collecting = false
|
||||
val collected = mutableListOf<String>()
|
||||
lines.forEach { line ->
|
||||
if (headerRegex.containsMatchIn(line)) {
|
||||
collecting = true
|
||||
return@forEach
|
||||
var collecting = false
|
||||
for (line in lines) {
|
||||
if (!collecting) {
|
||||
if (headerRegex.containsMatchIn(line)) {
|
||||
collecting = true
|
||||
}
|
||||
continue
|
||||
}
|
||||
if (collecting && line.startsWith("#")) return@forEach
|
||||
if (collecting) collected.add(line)
|
||||
if (line.trimStart().startsWith("#")) break
|
||||
collected.add(line)
|
||||
}
|
||||
return collected.joinToString("\n").trim()
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ tasks.register<GetVersionTask>("getVersion") {
|
||||
}
|
||||
|
||||
// You can still set these for legacy use by submodules or scripts:
|
||||
rootProject.ext.set("appVersionName", providers.gradleProperty("APP_VERSION_NAME").orElse("1.1.0").get())
|
||||
rootProject.ext.set("appVersionCode", providers.gradleProperty("APP_VERSION_CODE").orElse("1").get().toInt())
|
||||
rootProject.ext.set("appVersionName", providers.gradleProperty("APP_VERSION_NAME").orElse("1.1.2").get())
|
||||
rootProject.ext.set("appVersionCode", providers.gradleProperty("APP_VERSION_CODE").orElse("252").get().toInt())
|
||||
rootProject.ext.set("applicationId", "me.eternal.purrfectsnap")
|
||||
rootProject.ext.set(
|
||||
"buildHash",
|
||||
|
||||
@@ -8,8 +8,8 @@ org.gradle.configuration-cache=true
|
||||
org.gradle.configuration-cache.problems=warn
|
||||
nativeAbis=arm64-v8a
|
||||
|
||||
APP_VERSION_NAME=1.1.0
|
||||
APP_VERSION_CODE=250
|
||||
APP_VERSION_NAME=1.1.2
|
||||
APP_VERSION_CODE=252
|
||||
debug_build_hash=18fe2a814d0e2eb5
|
||||
psIntegrityPinnedSha256=
|
||||
EXPECTED_CERT_SHA256=97fc5c4dff7e33c159528eb9e53f86c356d430cd63d177f40c22b577ac829dee
|
||||
|
||||
Reference in New Issue
Block a user