build: move app and ktlint version to buildSrc Versions
This commit is contained in:
parent
1855c08787
commit
16dd40d489
9 changed files with 23 additions and 18 deletions
|
@ -19,11 +19,8 @@ android {
|
||||||
minSdk = 28
|
minSdk = 28
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
|
|
||||||
val appVersionCode: Int by rootProject.extra
|
versionCode = Versions.appCode
|
||||||
val appVersionName: String by rootProject.extra
|
versionName = Versions.appName
|
||||||
|
|
||||||
versionCode = appVersionCode
|
|
||||||
versionName = appVersionName
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -75,7 +72,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
ktlint {
|
ktlint {
|
||||||
version.set("0.50.0")
|
version.set(Versions.ktlint)
|
||||||
android.set(true)
|
android.set(true)
|
||||||
ignoreFailures.set(false)
|
ignoreFailures.set(false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,3 @@ allprojects {
|
||||||
tasks.create<Delete>("clean") {
|
tasks.create<Delete>("clean") {
|
||||||
delete(rootProject.layout.buildDirectory)
|
delete(rootProject.layout.buildDirectory)
|
||||||
}
|
}
|
||||||
|
|
||||||
val appVersionCode by extra { 22 }
|
|
||||||
val appVersionName by extra { "0.13.1" }
|
|
7
buildSrc/build.gradle.kts
Normal file
7
buildSrc/build.gradle.kts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
plugins {
|
||||||
|
`kotlin-dsl`
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
6
buildSrc/src/main/kotlin/Versions.kt
Normal file
6
buildSrc/src/main/kotlin/Versions.kt
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
object Versions {
|
||||||
|
const val appCode = 22
|
||||||
|
const val appName = "0.13.1"
|
||||||
|
|
||||||
|
const val ktlint = "0.50.0"
|
||||||
|
}
|
|
@ -39,7 +39,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
ktlint {
|
ktlint {
|
||||||
version.set("0.50.0")
|
version.set(Versions.ktlint)
|
||||||
android.set(true)
|
android.set(true)
|
||||||
ignoreFailures.set(false)
|
ignoreFailures.set(false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,8 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk = 28
|
minSdk = 28
|
||||||
|
|
||||||
val appVersionCode: Int by rootProject.extra
|
buildConfigField("int", "VERSION_CODE", Versions.appCode.toString())
|
||||||
val appVersionName: String by rootProject.extra
|
buildConfigField("String", "VERSION_NAME", "\"${Versions.appName}\"")
|
||||||
buildConfigField("int", "VERSION_CODE", appVersionCode.toString())
|
|
||||||
buildConfigField("String", "VERSION_NAME", "\"$appVersionName\"")
|
|
||||||
|
|
||||||
consumerProguardFile("proguard-rules.pro")
|
consumerProguardFile("proguard-rules.pro")
|
||||||
|
|
||||||
|
@ -42,7 +40,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
ktlint {
|
ktlint {
|
||||||
version.set("0.50.0")
|
version.set(Versions.ktlint)
|
||||||
android.set(true)
|
android.set(true)
|
||||||
ignoreFailures.set(false)
|
ignoreFailures.set(false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
ktlint {
|
ktlint {
|
||||||
version.set("0.50.0")
|
version.set(Versions.ktlint)
|
||||||
android.set(true)
|
android.set(true)
|
||||||
ignoreFailures.set(false)
|
ignoreFailures.set(false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
ktlint {
|
ktlint {
|
||||||
version.set("0.50.0")
|
version.set(Versions.ktlint)
|
||||||
android.set(true)
|
android.set(true)
|
||||||
ignoreFailures.set(false)
|
ignoreFailures.set(false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
ktlint {
|
ktlint {
|
||||||
version.set("0.50.0")
|
version.set(Versions.ktlint)
|
||||||
android.set(true)
|
android.set(true)
|
||||||
ignoreFailures.set(false)
|
ignoreFailures.set(false)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue