Update Kotlin + Android dependencies

* Update Kotlin to 1.7.21
* Migrate Hilt to Gradle Plugin DSL and use updated package name
* Update dependencies
* Misc cleanup of build scripts
This commit is contained in:
lynxnb 2023-01-24 19:08:27 +01:00 committed by Niccolò Betto
parent 5137d7d876
commit bac4ec2977
2 changed files with 16 additions and 15 deletions

View File

@ -2,7 +2,7 @@ plugins {
id 'com.android.application' id 'com.android.application'
id 'kotlin-android' id 'kotlin-android'
id 'kotlin-kapt' id 'kotlin-kapt'
id 'dagger.hilt.android.plugin' id 'com.google.dagger.hilt.android'
id 'idea' id 'idea'
id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version" id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version"
} }
@ -153,24 +153,24 @@ android {
dependencies { dependencies {
/* Google */ /* Google */
implementation 'androidx.core:core-ktx:1.8.0' implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.0' implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.preference:preference-ktx:1.2.0' implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.activity:activity-ktx:1.6.1' implementation 'androidx.activity:activity-ktx:1.6.1'
implementation 'com.google.android.material:material:1.6.1' implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1"
implementation 'androidx.fragment:fragment-ktx:1.5.2' implementation 'androidx.fragment:fragment-ktx:1.5.5'
implementation "com.google.dagger:hilt-android:$hilt_version" implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version" kapt "com.google.dagger:hilt-compiler:$hilt_version"
implementation 'com.google.android.flexbox:flexbox:3.0.0' implementation 'com.google.android.flexbox:flexbox:3.0.0'
/* Kotlin */ /* Kotlin */
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_version" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
/* JetBrains */ /* JetBrains */
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

View File

@ -2,10 +2,8 @@
buildscript { buildscript {
ext { ext {
kotlin_version = '1.7.10' kotlin_version = '1.7.21'
serialization_version = '1.3.3' hilt_version = '2.44.2'
lifecycle_version = '2.5.1'
hilt_version = '2.43.2'
} }
repositories { repositories {
@ -16,13 +14,16 @@ buildscript {
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.2.2' classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }
} }
plugins {
id 'com.google.dagger.hilt.android' version "$hilt_version" apply false
}
allprojects { allprojects {
repositories { repositories {
google() google()
@ -30,6 +31,6 @@ allprojects {
} }
} }
task clean(type: Delete) { tasks.register('clean') {
delete rootProject.buildDir delete rootProject.buildDir
} }