Skip to content

Commit 9154f74

Browse files
Migrated to KSP from Kapt
Added legacy kapt instead of kotlin kapt for Migration Codelab Merge branch 'main' into renovate/main-all Merge pull request #562 from raystatic/update/toml-versioning-compose-basics-codelab
1 parent 83230f1 commit 9154f74

File tree

5 files changed

+28
-19
lines changed

5 files changed

+28
-19
lines changed

AdvancedStateAndSideEffectsCodelab/app/build.gradle

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
plugins {
1818
id 'com.android.application'
19-
id 'dagger.hilt.android.plugin'
19+
id 'com.google.devtools.ksp'
2020
id 'org.jetbrains.kotlin.plugin.compose'
21+
id 'dagger.hilt.android.plugin'
2122
}
2223

2324
// Reads the Google maps key that is used in the AndroidManifest
@@ -118,9 +119,9 @@ dependencies {
118119
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle_version"
119120
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
120121

121-
implementation "com.google.dagger:hilt-android:2.59"
122-
kapt "com.google.dagger:hilt-compiler:2.59"
123-
kapt "org.jetbrains.kotlin:kotlin-metadata-jvm:2.3.0"
122+
implementation "com.google.dagger:hilt-android:2.59.1"
123+
ksp "com.google.dagger:hilt-compiler:2.59.1"
124+
ksp "org.jetbrains.kotlin:kotlin-metadata-jvm:2.3.0"
124125

125126
implementation "io.coil-kt:coil-compose:2.7.0"
126127

@@ -131,8 +132,8 @@ dependencies {
131132
androidTestImplementation "androidx.test.espresso:espresso-core:3.7.0"
132133
androidTestImplementation "androidx.test.ext:junit-ktx:1.3.0"
133134
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2"
134-
androidTestImplementation "com.google.dagger:hilt-android:2.59"
135-
androidTestImplementation "com.google.dagger:hilt-android-testing:2.59"
136-
kaptAndroidTest "com.google.dagger:hilt-compiler:2.59"
137-
kaptAndroidTest "org.jetbrains.kotlin:kotlin-metadata-jvm:2.3.0"
135+
androidTestImplementation "com.google.dagger:hilt-android:2.59.1"
136+
androidTestImplementation "com.google.dagger:hilt-android-testing:2.59.1"
137+
kspAndroidTest "com.google.dagger:hilt-compiler:2.59.1"
138+
kspAndroidTest "org.jetbrains.kotlin:kotlin-metadata-jvm:2.3.0"
138139
}

AdvancedStateAndSideEffectsCodelab/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ buildscript {
2121
}
2222
dependencies {
2323
classpath "com.android.tools.build:gradle:9.0.0"
24-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.0"
25-
classpath "com.google.dagger:hilt-android-gradle-plugin:2.59"
26-
classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:2.3.0"
24+
classpath "com.google.dagger:hilt-android-gradle-plugin:2.59.1"
25+
classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:2.3.10"
26+
classpath "com.google.devtools.ksp:symbol-processing-gradle-plugin:2.3.4"
2727
}
2828
}
2929

3030
plugins {
3131
id 'com.diffplug.spotless' version '8.2.1'
32+
id 'com.google.devtools.ksp' version '2.3.4' apply false
3233
}
3334

3435
subprojects {

MigrationCodelab/app/build.gradle

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@
1717
apply plugin: 'com.android.application'
1818
apply plugin: 'androidx.navigation.safeargs.kotlin'
1919
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
20+
apply plugin: 'com.android.legacy-kapt'
2021

2122

2223
android {
23-
compileSdk 36
24-
minSdk 23
25-
targetSdk 33
24+
compileSdkVersion 36
2625
namespace "com.google.samples.apps.sunflower"
2726
defaultConfig {
2827
applicationId "com.google.samples.apps.sunflower"
28+
minSdkVersion 23
29+
targetSdkVersion 33
2930
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3031
versionCode 1
3132
versionName "0.1.6"
@@ -34,17 +35,14 @@ android {
3435
buildTypes {
3536
release {
3637
minifyEnabled false
37-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
38+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
3839
}
3940
}
4041
compileOptions {
4142
sourceCompatibility JavaVersion.VERSION_17
4243
targetCompatibility JavaVersion.VERSION_17
4344
}
44-
kotlinOptions {
45-
jvmTarget = "17"
46-
freeCompilerArgs = ['-Xjvm-default=all-compatibility']
47-
}
45+
4846
buildFeatures {
4947
dataBinding true
5048
compose true

MigrationCodelab/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ buildscript {
3030

3131
plugins {
3232
id 'com.diffplug.spotless' version '8.2.1'
33+
id 'com.android.legacy-kapt' version '9.0.0' apply false
3334
}
3435

3536
allprojects {

MigrationCodelab/settings.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17+
pluginManagement {
18+
repositories {
19+
google()
20+
mavenCentral()
21+
gradlePluginPortal()
22+
}
23+
}
24+
1725
include ':app'

0 commit comments

Comments
 (0)