forked from Schanbro/WeekFocus
chore: v1.0.1
This commit is contained in:
1 parent
e563b2e796
commit
7dde81a715
2 files changed
+43
-4
No files matched your search
+23
-3
@@ -3,6 +3,22 @@ plugins {
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
}
|
||||
|
||||
val tagVersion = (project.findProperty("versionNameOverride") as String?) ?: "0.0.0-dev"
|
||||
|
||||
// "1.2.3" oder "1.2.3-alpha9" -> Kern "1.2.3" für den versionCode
|
||||
val core = tagVersion
|
||||
.removePrefix("v")
|
||||
.substringBefore("-")
|
||||
val parts = core.split(".").map { it.toIntOrNull() ?: 0 }
|
||||
val major = parts.getOrElse(0) { 0 }
|
||||
val minor = parts.getOrElse(1) { 0 }
|
||||
val patch = parts.getOrElse(2) { 0 }
|
||||
|
||||
val copyChangelog by tasks.registering(Copy::class) {
|
||||
from(rootProject.file("CHANGELOG.md"))
|
||||
into(layout.buildDirectory.dir("generated/changelog"))
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "de.schanbro.weekfocus"
|
||||
compileSdk {
|
||||
@@ -13,8 +29,8 @@ android {
|
||||
applicationId = "de.schanbro.weekfocus"
|
||||
minSdk = 29
|
||||
targetSdk = 37
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
versionCode = major * 10000 + minor * 100 + patch
|
||||
versionName = tagVersion
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@@ -33,6 +49,7 @@ android {
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
sourceSets["main"].assets.srcDir(layout.buildDirectory.dir("generated/changelog"))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -51,4 +68,7 @@ dependencies {
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
debugImplementation(libs.androidx.compose.ui.test.manifest)
|
||||
debugImplementation(libs.androidx.compose.ui.tooling)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.matching { it.name.startsWith("merge") && it.name.endsWith("Assets") }
|
||||
.configureEach { dependsOn(copyChangelog) }
|
||||
Reference in new issue
Block a user