plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
}
// Bumped by hand; everything after it is generated.
val baseVersion = "0.1.0"
// Seconds, from the environment when it's there. CI sets it once per run
// so every artifact from that run agrees; a local build computes it,
// which is fine because local builds are never published.
val buildTimestamp: Long =
(System.getenv("SOURCE_DATE_EPOCH") ?: System.getenv("BUILD_TIMESTAMP"))
?.toLongOrNull()
?: (System.currentTimeMillis() / 1000)
// A real release overrides the whole string; until there is one, every
// build says so in its name.
val appVersionName: String =
System.getenv("RELEASE_VERSION")?.takeIf { it.isNotBlank() }
?: "$baseVersion-dev-$buildTimestamp"
android {
namespace = "io.neiam.ova"
compileSdk {
version = release(36) {
minorApiLevel = 1
}
}
defaultConfig {
applicationId = "io.neiam.ova"
minSdk = 24
targetSdk = 36
// Android refuses an update whose versionCode isn't higher than
// what's installed, and F-Droid orders versions by it. The CI run
// number is monotonic and needs no state; local builds stay at 1.
versionCode = (System.getenv("GITHUB_RUN_NUMBER") ?: "").toIntOrNull() ?: 1
versionName = appVersionName
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
optimization {
enable = false
}
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
buildFeatures {
compose = true
}
lint {
// `assembleRelease` is a packaging step, not a review gate; lint
// still runs on demand with ./gradlew :app:lint.
checkReleaseBuilds = false
}
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material3)
debugImplementation(libs.androidx.compose.ui.tooling)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.junit)
}
⭐
Log in to mark this repository.
2.6 KiB · text
History
a4e2ffe