74 lines
2.3 KiB
Kotlin
74 lines
2.3 KiB
Kotlin
plugins {
|
|
alias(libs.plugins.android.application)
|
|
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 {
|
|
version = release(37)
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "de.schanbro.weekfocus"
|
|
minSdk = 29
|
|
targetSdk = 37
|
|
versionCode = major * 10000 + minor * 100 + patch
|
|
versionName = tagVersion
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
optimization {
|
|
enable = false
|
|
}
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
sourceSets["main"].assets.srcDir(layout.buildDirectory.dir("generated/changelog"))
|
|
}
|
|
|
|
dependencies {
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
implementation(libs.androidx.activity.compose)
|
|
implementation(libs.androidx.compose.material3)
|
|
implementation(libs.androidx.compose.ui)
|
|
implementation(libs.androidx.compose.ui.graphics)
|
|
implementation(libs.androidx.compose.ui.tooling.preview)
|
|
implementation(libs.androidx.core.ktx)
|
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
|
testImplementation(libs.junit)
|
|
androidTestImplementation(platform(libs.androidx.compose.bom))
|
|
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
|
|
androidTestImplementation(libs.androidx.espresso.core)
|
|
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) } |