Skip to content

Commit 3b44092

Browse files
committedMay 26, 2024
Migrate to the Compose gradle plugin
1 parent b7adb98 commit 3b44092

35 files changed

+671
-255
lines changed
 

‎Crane/app/build.gradle.kts

+9-8
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
plugins {
2020
alias(libs.plugins.android.application)
2121
alias(libs.plugins.kotlin.android)
22-
alias(libs.plugins.kapt)
22+
alias(libs.plugins.ksp)
2323
alias(libs.plugins.hilt)
2424
alias(libs.plugins.secrets)
25+
alias(libs.plugins.compose)
2526
}
2627

2728
android {
@@ -90,10 +91,6 @@ android {
9091
buildConfig = true
9192
}
9293

93-
composeOptions {
94-
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
95-
}
96-
9794
packaging.resources {
9895
// Multiple dependency bring these files in. Exclude them to enable
9996
// our test APK to build (has no effect on our AARs)
@@ -102,6 +99,10 @@ android {
10299
}
103100
}
104101

102+
composeCompiler {
103+
enableStrongSkippingMode = true
104+
}
105+
105106
dependencies {
106107
val composeBom = platform(libs.androidx.compose.bom)
107108
implementation(composeBom)
@@ -132,8 +133,8 @@ dependencies {
132133

133134
implementation(libs.androidx.hilt.navigation.compose)
134135
implementation(libs.hilt.android)
135-
kapt(libs.hilt.compiler)
136-
kapt(libs.hilt.ext.compiler)
136+
ksp(libs.hilt.compiler)
137+
ksp(libs.hilt.ext.compiler)
137138

138139
implementation(libs.coil.kt.compose)
139140

@@ -150,7 +151,7 @@ dependencies {
150151
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
151152
androidTestImplementation(libs.hilt.android.testing)
152153
coreLibraryDesugaring(libs.core.jdk.desugaring)
153-
kaptAndroidTest(libs.hilt.compiler)
154+
kspAndroidTest(libs.hilt.compiler)
154155
}
155156

156157
secrets {

‎Crane/build.gradle.kts

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,13 +17,13 @@
1717
plugins {
1818
alias(libs.plugins.gradle.versions)
1919
alias(libs.plugins.version.catalog.update)
20-
21-
alias(libs.plugins.kotlin.android) apply false
22-
alias(libs.plugins.kapt) apply false
23-
alias(libs.plugins.hilt) apply false
24-
alias(libs.plugins.secrets) apply false
2520
alias(libs.plugins.android.application) apply false
2621
alias(libs.plugins.android.test) apply false
22+
alias(libs.plugins.kotlin.android) apply false
23+
alias(libs.plugins.kotlin.parcelize) apply false
24+
alias(libs.plugins.compose) apply false
25+
alias(libs.plugins.ksp) apply false
26+
alias(libs.plugins.hilt) apply false
2727
}
2828

2929
apply("${project.rootDir}/buildscripts/toml-updater-config.gradle")

‎Crane/gradle/libs.versions.toml

+67-19
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,60 @@ accompanist = "0.34.0"
77
androidGradlePlugin = "8.4.0"
88
androidx-activity-compose = "1.9.0"
99
androidx-appcompat = "1.6.1"
10-
androidx-benchmark = "1.2.0"
11-
androidx-benchmark-junit4 = "1.2.1"
10+
androidx-benchmark = "1.2.4"
11+
androidx-benchmark-junit4 = "1.2.4"
1212
androidx-compose-bom = "2024.05.00"
13+
androidx-compose-material3-adaptive = "1.0.0-alpha12"
1314
androidx-constraintlayout = "1.0.1"
15+
androidx-core-splashscreen = "1.0.1"
1416
androidx-corektx = "1.13.1"
1517
androidx-glance = "1.0.0"
16-
androidx-lifecycle-compose = "2.7.0"
17-
androidx-lifecycle-runtime-compose = "2.7.0"
18+
androidx-lifecycle = "2.7.0"
1819
androidx-navigation = "2.7.7"
1920
androidx-palette = "1.0.0"
2021
androidx-test = "1.5.0"
2122
androidx-test-espresso = "3.5.1"
2223
androidx-test-ext-junit = "1.1.5"
2324
androidx-test-ext-truth = "1.5.0"
25+
androidx-tv-foundation = "1.0.0-alpha10"
26+
androidx-tv-material = "1.0.0-beta01"
27+
androidx-wear-compose = "1.3.1"
2428
androidx-window = "1.3.0-beta02"
25-
androidxHiltNavigationCompose = "1.1.0"
26-
androix-test-uiautomator = "2.2.0"
27-
coil = "2.4.0"
29+
androidxHiltNavigationCompose = "1.2.0"
30+
androix-test-uiautomator = "2.3.0"
31+
coil = "2.6.0"
2832
# @keep
2933
compileSdk = "34"
30-
compose-compiler = "1.5.13"
3134
coroutines = "1.8.0"
3235
google-maps = "18.2.0"
3336
gradle-versions = "0.51.0"
34-
hilt = "2.48.1"
35-
hiltExt = "1.1.0"
37+
hilt = "2.51.1"
38+
hiltExt = "1.2.0"
39+
horologist = "0.6.9"
3640
# @pin When updating to AGP 7.4.0-alpha10 and up we can update this https://developer.android.com/studio/write/java8-support#library-desugaring-versions
3741
jdkDesugar = "1.2.2"
3842
junit = "4.13.2"
39-
# @pin Update in conjuction with Compose Compiler
40-
kotlin = "1.9.23"
43+
kotlin = "2.0.0"
4144
kotlinx_immutable = "0.3.5"
42-
ksp = "1.9.20-1.0.14"
45+
ksp = "2.0.0-1.0.21"
4346
maps-compose = "3.1.1"
4447
material = "1.11.0"
4548
# @keep
4649
minSdk = "21"
4750
okhttp = "4.11.0"
4851
robolectric = "4.12.1"
52+
roborazzi = "1.12.0"
4953
rome = "1.18.0"
5054
room = "2.6.0"
55+
play-services-wearable = "18.1.0"
5156
secrets = "2.0.1"
5257
# @keep
5358
targetSdk = "33"
5459
version-catalog-update = "0.8.4"
60+
glanceAppwidget = "1.1.0-beta02"
61+
glanceMaterial3 = "1.1.0-beta02"
62+
glance = "1.1.0-beta02"
63+
composeBom = "2024.04.01"
5564

5665
[libraries]
5766
accompanist-adaptive = { module = "com.google.accompanist:accompanist-adaptive", version.ref = "accompanist" }
@@ -72,30 +81,37 @@ androidx-compose-foundation-layout = { module = "androidx.compose.foundation:fou
7281
androidx-compose-material = { module = "androidx.compose.material:material" }
7382
androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" }
7483
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
84+
androidx-compose-material3-adaptive = { group = "androidx.compose.material3.adaptive", name = "adaptive", version.ref = "androidx-compose-material3-adaptive" }
85+
androidx-compose-material3-adaptive-layout = { group = "androidx.compose.material3.adaptive", name = "adaptive-layout", version.ref = "androidx-compose-material3-adaptive" }
86+
androidx-compose-material3-adaptive-navigation = { group = "androidx.compose.material3.adaptive", name = "adaptive-navigation", version.ref = "androidx-compose-material3-adaptive" }
7587
androidx-compose-materialWindow = { module = "androidx.compose.material3:material3-window-size-class" }
7688
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime" }
7789
androidx-compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata" }
7890
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
7991
androidx-compose-ui-googlefonts = { module = "androidx.compose.ui:ui-text-google-fonts" }
92+
androidx-compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics" }
8093
androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test" }
8194
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
8295
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
96+
androidx-compose-ui-text = { module = "androidx.compose.ui:ui-text" }
8397
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
8498
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
8599
androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util" }
86100
androidx-compose-ui-viewbinding = { module = "androidx.compose.ui:ui-viewbinding" }
87101
androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "androidx-constraintlayout" }
88102
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-corektx" }
103+
androidx-core-splashscreen = { group = "androidx.core", name = "core-splashscreen", version.ref = "androidx-core-splashscreen" }
89104
androidx-glance = { module = "androidx.glance:glance", version.ref = "androidx-glance" }
90105
androidx-glance-appwidget = { module = "androidx.glance:glance-appwidget", version.ref = "androidx-glance" }
91106
androidx-glance-material3 = { module = "androidx.glance:glance-material3", version.ref = "androidx-glance" }
92107
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "androidxHiltNavigationCompose" }
93-
androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle-compose" }
94-
androidx-lifecycle-runtime = "androidx.lifecycle:lifecycle-runtime-ktx:2.6.0-alpha04"
95-
androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle-runtime-compose" }
96-
androidx-lifecycle-viewModelCompose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle-compose" }
97-
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle-compose" }
98-
androidx-lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "androidx-lifecycle-compose" }
108+
androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
109+
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" }
110+
androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
111+
androidx-lifecycle-viewModelCompose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
112+
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
113+
androidx-lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "androidx-lifecycle" }
114+
androidx-material-icons-core = { module = "androidx.compose.material:material-icons-core" }
99115
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
100116
androidx-navigation-fragment = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "androidx-navigation" }
101117
androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "androidx-navigation" }
@@ -110,35 +126,67 @@ androidx-test-ext-truth = { module = "androidx.test.ext:truth", version.ref = "a
110126
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" }
111127
androidx-test-runner = "androidx.test:runner:1.5.2"
112128
androidx-test-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androix-test-uiautomator" }
129+
androidx-tv-foundation = { module = "androidx.tv:tv-foundation", version.ref = "androidx-tv-foundation" }
130+
androidx-tv-material = { module = "androidx.tv:tv-material", version.ref = "androidx-tv-material" }
131+
androidx-wear-compose-foundation = { group = "androidx.wear.compose", name = "compose-foundation", version.ref = "androidx-wear-compose" }
132+
androidx-wear-compose-material = { group = "androidx.wear.compose", name = "compose-material", version.ref = "androidx-wear-compose" }
133+
androidx-wear-compose-ui-tooling = { module = "androidx.wear.compose:compose-ui-tooling", version.ref = "androidx-wear-compose" }
113134
androidx-window = { module = "androidx.window:window", version.ref = "androidx-window" }
135+
androidx-window-core = { module = "androidx.window:window-core", version.ref = "androidx-window" }
114136
coil-kt-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
115137
core-jdk-desugaring = { module = "com.android.tools:desugar_jdk_libs", version.ref = "jdkDesugar" }
138+
dagger-hiltandroidplugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt" }
116139
google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
117140
googlemaps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" }
118141
googlemaps-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "google-maps" }
119142
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
120143
hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" }
121144
hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" }
122145
hilt-ext-compiler = { module = "androidx.hilt:hilt-compiler", version.ref = "hiltExt" }
146+
horologist-audio-ui = { module = "com.google.android.horologist:horologist-audio-ui", version.ref = "horologist" }
147+
horologist-composables = { module = "com.google.android.horologist:horologist-composables", version.ref = "horologist" }
148+
horologist-compose-layout = { module = "com.google.android.horologist:horologist-compose-layout", version.ref = "horologist" }
149+
horologist-compose-material = { module = "com.google.android.horologist:horologist-compose-material", version.ref = "horologist" }
150+
horologist-compose-tools = { group = "com.google.android.horologist", name = "horologist-compose-tools", version.ref = "horologist" }
151+
horologist-images-coil = { module = "com.google.android.horologist:horologist-images-coil", version.ref = "horologist" }
152+
horologist-media-data = { module = "com.google.android.horologist:horologist-media-data", version.ref = "horologist" }
153+
horologist-media-ui = { module = "com.google.android.horologist:horologist-media-ui", version.ref = "horologist" }
154+
horologist-roboscreenshots = { module = "com.google.android.horologist:horologist-roboscreenshots", version.ref = "horologist" }
123155
junit = { module = "junit:junit", version.ref = "junit" }
124156
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
125157
kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlinx_immutable" }
126158
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
127159
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
128160
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
129161
okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
162+
play-services-wearable = { group = "com.google.android.gms", name = "play-services-wearable", version.ref = "play-services-wearable" }
130163
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
164+
roborazzi = { group = "io.github.takahirom.roborazzi", name = "roborazzi", version.ref = "roborazzi" }
165+
roborazzi-compose = { group = "io.github.takahirom.roborazzi", name = "roborazzi-compose", version.ref = "roborazzi" }
166+
roborazzi-rule = { group = "io.github.takahirom.roborazzi", name = "roborazzi-junit-rule", version.ref = "roborazzi" }
131167
rometools-modules = { module = "com.rometools:rome-modules", version.ref = "rome" }
132168
rometools-rome = { module = "com.rometools:rome", version.ref = "rome" }
169+
wear-compose-foundation = { module = "androidx.wear.compose:compose-foundation", version.ref = "androidx-wear-compose" }
170+
wear-compose-material = { module = "androidx.wear.compose:compose-material", version.ref = "androidx-wear-compose" }
171+
wear-compose-navigation = { module = "androidx.wear.compose:compose-navigation", version.ref = "androidx-wear-compose" }
172+
173+
glance-appwidget = { group = "androidx.glance", name = "glance-appwidget", version.ref = "glanceAppwidget" }
174+
glance-material3 = { group = "androidx.glance", name = "glance-material3", version.ref = "glanceMaterial3" }
175+
glance = { group = "androidx.glance", name = "glance", version.ref = "glance" }
176+
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
177+
133178

134179
[plugins]
135180
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
181+
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
136182
android-test = { id = "com.android.test", version.ref = "androidGradlePlugin" }
183+
compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
137184
gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradle-versions" }
138185
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
139186
kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
140187
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
141188
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
142189
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
190+
roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" }
143191
secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" }
144192
version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" }

‎JetLagged/app/build.gradle.kts

+6-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ plugins {
1818
alias(libs.plugins.android.application)
1919
alias(libs.plugins.kotlin.android)
2020
alias(libs.plugins.kotlin.parcelize)
21+
alias(libs.plugins.compose)
2122
}
2223

2324
android {
@@ -84,10 +85,6 @@ android {
8485
shaders = false
8586
}
8687

87-
composeOptions {
88-
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
89-
}
90-
9188
packaging.resources {
9289
// Multiple dependency bring these files in. Exclude them to enable
9390
// our test APK to build (has no effect on our AARs)
@@ -96,6 +93,11 @@ android {
9693
}
9794
}
9895

96+
composeCompiler {
97+
// Configure compose compiler options if required
98+
enableStrongSkippingMode = true
99+
}
100+
99101
dependencies {
100102
val composeBom = platform(libs.androidx.compose.bom)
101103
implementation(composeBom)

‎JetLagged/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 The Android Open Source Project
2+
* Copyright 2020 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,10 +17,10 @@
1717
plugins {
1818
alias(libs.plugins.gradle.versions)
1919
alias(libs.plugins.version.catalog.update)
20-
2120
alias(libs.plugins.android.application) apply false
2221
alias(libs.plugins.kotlin.android) apply false
2322
alias(libs.plugins.kotlin.parcelize) apply false
23+
alias(libs.plugins.compose) apply false
2424
}
2525

2626
apply("${project.rootDir}/buildscripts/toml-updater-config.gradle")

0 commit comments

Comments
 (0)
Please sign in to comment.