Fixing versioning
This commit is contained in:
parent
df0640f857
commit
46587f7d28
2 changed files with 13 additions and 1 deletions
|
|
@ -37,13 +37,14 @@ kotlin {
|
|||
}
|
||||
}
|
||||
|
||||
val appVersion = (project.findProperty("appVersion") as? String)?.takeIf { it.isNotBlank() } ?: "1.0.0"
|
||||
val appVersion = providers.gradleProperty("appVersion").orNull?.takeIf { it.isNotBlank() } ?: "DEV-SNAPSHOT"
|
||||
|
||||
val generatedSrcDir = layout.buildDirectory.dir("generated/src/jvmMain/kotlin")
|
||||
|
||||
val generateBuildConfig by tasks.registering {
|
||||
val outputDir = generatedSrcDir
|
||||
val version = appVersion
|
||||
inputs.property("version", version)
|
||||
outputs.dir(outputDir)
|
||||
doLast {
|
||||
val dir = outputDir.get().asFile.resolve("com/rukira/wowbackup")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.rukira.wowbackup
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class BuildConfigTest {
|
||||
@Test
|
||||
fun testBuildConfigVersionIsNotEmpty() {
|
||||
assertTrue(BuildConfig.VERSION.isNotBlank(), "BuildConfig.VERSION should not be blank")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue