Fix build.gradle.kts
Fixed build.gradle.kts, added versions plugin to the whole project.
This commit is contained in:
parent
05531fa6f2
commit
609fb301dc
6 changed files with 260 additions and 255 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -7,4 +7,5 @@
|
|||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.jar binary
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
plugins {
|
||||
id("com.android.application")
|
||||
id(AppPlugins.androidApplication)
|
||||
|
||||
kotlin("android")
|
||||
id("kotlin-android-extensions")
|
||||
kotlin("kapt")
|
||||
|
||||
//id("kotlin-parcelize")
|
||||
id("com.github.ben-manes.versions")
|
||||
kotlin(AppPlugins.androidBase)
|
||||
kotlin(AppPlugins.kapt)
|
||||
id(AppPlugins.kotlinExtensions)
|
||||
// id(AppPlugins.kotlinParcelize)
|
||||
}
|
||||
|
||||
android {
|
||||
|
@ -69,6 +67,7 @@ android {
|
|||
ProguardFile.defaultRules
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions.addAll(
|
||||
listOf(
|
||||
|
@ -84,12 +83,6 @@ android {
|
|||
create(Flavors.beta) {
|
||||
dimension = Flavors.Dimensions.release
|
||||
|
||||
/*
|
||||
versionCode = BetaConfig.versionCodeBeta
|
||||
versionName = BetaConfig.versionNameBeta
|
||||
|
||||
applicationIdSuffix = BetaConfig.betaSufix
|
||||
*/
|
||||
versionNameSuffix = "-${BetaConfig.betaSufix}${BetaConfig.betaSufixVersion}"
|
||||
|
||||
buildConfigField(
|
||||
|
@ -156,7 +149,6 @@ android {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
|
||||
|
|
|
@ -10,6 +10,7 @@ buildscript {
|
|||
|
||||
// Plugins
|
||||
classpath(GradlePlugins.gradleVersions)
|
||||
classpath(GradlePlugins.spotless)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,6 +28,8 @@ allprojects {
|
|||
)
|
||||
}
|
||||
|
||||
apply(plugin = AppPlugins.manesVersions)
|
||||
|
||||
tasks.withType<DependencyUpdatesTask> {
|
||||
gradleReleaseChannel = "current"
|
||||
|
||||
|
@ -37,8 +40,6 @@ allprojects {
|
|||
}
|
||||
|
||||
tasks.register<Delete>(BuildTasks.taskTypeClean) {
|
||||
delete(rootProject.buildDir)
|
||||
delete(project.buildDir)
|
||||
delete(buildDir)
|
||||
delete("${projectDir}/buildSrc/build")
|
||||
}
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
object ApplicationLibs {
|
||||
object AppPlugins {
|
||||
const val androidApplication = "com.android.application"
|
||||
const val androidBase = "android"
|
||||
const val kapt = "kapt"
|
||||
const val kotlinExtensions = "kotlin-android-extensions"
|
||||
const val kotlinParcelize = "kotlin-parcelize"
|
||||
const val manesVersions = "com.github.ben-manes.versions"
|
||||
const val spotless = "com.diffplug.gradle.spotless"
|
||||
}
|
||||
|
||||
object ApplicationLibs {
|
||||
private object Versions {
|
||||
const val androidImageCropper = "2.8.0"
|
||||
const val appcompat = "1.2.0"
|
||||
|
@ -7,31 +16,31 @@ object ApplicationLibs {
|
|||
const val bigImageViewer = "1.7.0"
|
||||
const val browser = "1.3.0"
|
||||
const val cardView = "1.0.0"
|
||||
const val conscryptAndroid = "2.5.1"
|
||||
const val constraintlayout = "2.1.0"
|
||||
const val conscryptAndroid = "2.5.2"
|
||||
const val constraintlayout = "2.1.1"
|
||||
const val coreKtx = "1.3.2"
|
||||
const val dagger = "2.38.1"
|
||||
const val emoji = "1.1.0"
|
||||
const val exifInterface = "1.3.2"
|
||||
const val exoplayer = "2.15.0"
|
||||
const val exoplayer = "2.16.0"
|
||||
const val filemojiCompat = "1.0.17"
|
||||
const val flexbox = "2.0.1"
|
||||
const val fragmentKtx = "1.2.5"
|
||||
const val glide = "4.11.0"
|
||||
const val glide = "4.12.0"
|
||||
const val glideImage = "1.8.0"
|
||||
const val lifecycle = "2.2.0"
|
||||
const val lifecycle = "2.4.0"
|
||||
const val markdownEdit = "1.0.0"
|
||||
const val materialDesign = "1.4.0"
|
||||
const val materialDrawer = "8.2.0"
|
||||
const val materialDrawerTypeface = "3.0.1.4.original-kotlin@aar"
|
||||
const val pagingRuntimeKtx = "2.1.2"
|
||||
const val preferenceKtx = "1.1.1"
|
||||
const val okhttpVersion = "4.9.0"
|
||||
const val recyclerView = "1.1.0"
|
||||
const val okhttpVersion = "4.9.2"
|
||||
const val recyclerView = "1.2.1"
|
||||
const val retrofit = "2.9.0"
|
||||
const val room = "2.2.5"
|
||||
const val rxAndroid = "2.1.1"
|
||||
const val rxJava = "2.2.20"
|
||||
const val rxJava = "2.2.21"
|
||||
const val rxKotlin = "2.4.0"
|
||||
const val shareTarget = "1.0.0"
|
||||
const val simplestack = "2.6.2"
|
||||
|
@ -148,3 +157,18 @@ object ApplicationLibs {
|
|||
const val sparkButton = "com.github.connyduck:sparkbutton:${Versions.sparkButton}"
|
||||
const val timber = "com.jakewharton.timber:timber:${Versions.timber}"
|
||||
}
|
||||
|
||||
object GradlePlugins {
|
||||
object Versions {
|
||||
const val gradle = "7.0.3"
|
||||
const val gradleVersions = "0.39.0"
|
||||
const val spotless = "6.0.0"
|
||||
}
|
||||
|
||||
const val android = "com.android.tools.build:gradle:${Versions.gradle}"
|
||||
const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
||||
const val gradleVersions =
|
||||
"com.github.ben-manes:gradle-versions-plugin:${Versions.gradleVersions}"
|
||||
const val spotless =
|
||||
"com.diffplug.spotless:spotless-plugin-gradle:${Versions.spotless}"
|
||||
}
|
||||
|
|
|
@ -35,8 +35,6 @@ object DefaultConfig {
|
|||
object BetaConfig {
|
||||
const val betaSufix = "beta"
|
||||
const val betaSufixVersion = "1"
|
||||
const val versionCodeBeta = 1
|
||||
const val versionNameBeta = "1.0.2"
|
||||
}
|
||||
|
||||
object BuildTypes {
|
||||
|
@ -64,28 +62,17 @@ object BuildTasks {
|
|||
const val taskTypeClean = "clean"
|
||||
}
|
||||
|
||||
object GradlePlugins {
|
||||
object Versions {
|
||||
const val gradle = "7.0.2"
|
||||
const val gradleVersions = "0.38.0"
|
||||
}
|
||||
|
||||
const val android = "com.android.tools.build:gradle:${Versions.gradle}"
|
||||
const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
|
||||
const val gradleVersions =
|
||||
"com.github.ben-manes:gradle-versions-plugin:${Versions.gradleVersions}"
|
||||
}
|
||||
|
||||
// Function to add repositories to the project.
|
||||
fun addRepos(handler: RepositoryHandler) {
|
||||
handler.google()
|
||||
handler.maven(url = "https://jitpack.io")
|
||||
handler.gradlePluginPortal()
|
||||
handler.maven(url = "https://jitpack.io")
|
||||
handler.maven(url = "https://plugins.gradle.org/m2/")
|
||||
}
|
||||
|
||||
// Function to check stable versions
|
||||
fun isNonStable(version: String): Boolean {
|
||||
val stableKeyword = listOf("alpha", "beta", "final", "ga", "m", "release", "rc")
|
||||
val stableKeyword = listOf("a", "alpha", "beta", "final", "ga", "m", "release", "rc")
|
||||
.any { version.toLowerCase(Locale.ROOT).contains(it) }
|
||||
return stableKeyword.not()
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
|
Loading…
Reference in a new issue