Skip to content

Commit

Permalink
Update to Kotlin 2.0.0 and Compose 1.7.0 beta3 + update several other…
Browse files Browse the repository at this point in the history
… libraries
  • Loading branch information
isaac-udy committed Jun 21, 2024
1 parent 3eb223e commit 1f880d2
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 50 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import java.util.Properties
buildscript {
repositories {
mavenLocal()
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
classpath(libs.android.gradle)
classpath(libs.kotlin.compose.gradle)
classpath(libs.kotlin.gradle)
classpath(libs.processing.ksp.gradle)
classpath(libs.hilt.gradle)
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies {

implementation(libs.android.gradle)
implementation(libs.kotlin.gradle)
implementation(libs.kotlin.compose.gradle)
implementation(libs.emulator.wtf.gradle)
implementation(libs.processing.javaPoet) // https://github.com/google/dagger/issues/3068
}
Expand Down
9 changes: 6 additions & 3 deletions buildSrc/src/main/kotlin/configureCompose.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ fun Project.configureCompose() {
val libs = the<LibrariesForLibs>()
extensions.configure<BaseExtension> {
buildFeatures.compose = true
composeOptions {
kotlinCompilerExtensionVersion = "1.5.3"
}
}
val composePlugin = project.plugins.firstOrNull {
it::class.java.name.startsWith("org.jetbrains.kotlin.compose.compiler.gradle.")
}
if (composePlugin == null) {
error("Compose plugin not found: you forgot to add `alias(libs.plugins.compose.compiler)` to the plugin block in your build.gradle.kts file.")
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions enro-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("kotlin-parcelize")
id("kotlin-kapt")
id("dagger.hilt.android.plugin")
alias(libs.plugins.compose.compiler)
}
configureAndroidLibrary("dev.enro.core")
configureCompose()
Expand Down
1 change: 1 addition & 0 deletions enro/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("kotlin-android")
id("kotlin-parcelize")
id("wtf.emulator.gradle")
alias(libs.plugins.compose.compiler)
}
configureAndroidLibrary("dev.enro")
configureCompose()
Expand Down
1 change: 1 addition & 0 deletions enro/hilt-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("kotlin-android")
id("kotlin-parcelize")
id("kotlin-kapt")
alias(libs.plugins.compose.compiler)
}
configureAndroidLibrary("dev.enro.hilt.test")
configureCompose()
Expand Down
21 changes: 0 additions & 21 deletions example-module/proguard-rules.pro

This file was deleted.

1 change: 1 addition & 0 deletions example/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("kotlin-android")
id("kotlin-parcelize")
id("kotlin-kapt")
alias(libs.plugins.compose.compiler)
}
configureAndroidApp("dev.enro.example")
configureCompose()
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Nov 06 21:58:12 NZDT 2020
#Fri Jun 21 18:10:08 NZST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
53 changes: 29 additions & 24 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[versions]
[libraries]
android-gradle = "com.android.tools.build:gradle:8.1.4"
kotlin = "2.0.0"

[libraries]
android-gradle = "com.android.tools.build:gradle:8.5.0"
emulator-wtf-gradle = "wtf.emulator:gradle-plugin:0.0.11"

androidx-core = "androidx.core:core-ktx:1.13.1"
androidx-appcompat = "androidx.appcompat:appcompat:1.7.0"
androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4"
androidx-fragment = "androidx.fragment:fragment-ktx:1.7.1"
androidx-fragment = "androidx.fragment:fragment-ktx:1.8.0"
androidx-recyclerview = "androidx.recyclerview:recyclerview:1.3.2"
androidx-splashscreen = "androidx.core:core-splashscreen:1.0.1"

Expand All @@ -18,27 +19,28 @@ androidx-navigation-ui = "androidx.navigation:navigation-ui-ktx:2.7.7"
androidx-activity = "androidx.activity:activity-ktx:1.9.0"
compose-activity = "androidx.activity:activity-compose:1.9.0"

androidx-lifecycle = "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.1"
androidx-lifecycle-process = "androidx.lifecycle:lifecycle-process:2.8.1"
compose-viewmodel = "androidx.lifecycle:lifecycle-viewmodel-compose:2.8.1"
androidx-lifecycle = "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2"
androidx-lifecycle-process = "androidx.lifecycle:lifecycle-process:2.8.2"
compose-viewmodel = "androidx.lifecycle:lifecycle-viewmodel-compose:2.8.2"

compose-compiler = "androidx.compose.compiler:compiler:1.5.14"
compose-foundation = "androidx.compose.foundation:foundation:1.6.7"
compose-foundationLayout = "androidx.compose.foundation:foundation-layout:1.6.7"
compose-ui = "androidx.compose.ui:ui:1.6.7"
compose-uiTooling = "androidx.compose.ui:ui-tooling:1.6.7"
compose-runtime = "androidx.compose.runtime:runtime:1.6.7"
compose-livedata = "androidx.compose.runtime:runtime-livedata:1.6.7"
compose-material = "androidx.compose.material:material:1.6.7"
compose-foundation = "androidx.compose.foundation:foundation:1.7.0-beta03"
compose-foundationLayout = "androidx.compose.foundation:foundation-layout:1.7.0-beta03"
compose-ui = "androidx.compose.ui:ui:1.7.0-beta03"
compose-uiTooling = "androidx.compose.ui:ui-tooling:1.7.0-beta03"
compose-runtime = "androidx.compose.runtime:runtime:1.7.0-beta03"
compose-livedata = "androidx.compose.runtime:runtime-livedata:1.7.0-beta03"
compose-material = "androidx.compose.material:material:1.7.0-beta03"

compose-accompanist-systemUiController = "com.google.accompanist:accompanist-systemuicontroller:0.27.0"

compose-materialIcons = "androidx.compose.material:material-icons-core:1.6.7"
compose-materialIconsExtended = "androidx.compose.material:material-icons-extended:1.6.7"
compose-materialIcons = "androidx.compose.material:material-icons-core:1.7.0-beta03"
compose-materialIconsExtended = "androidx.compose.material:material-icons-extended:1.7.0-beta03"

kotlin-gradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10"
kotlin-stdLib = "org.jetbrains.kotlin:kotlin-stdlib:1.9.22"
kotlin-reflect = "org.jetbrains.kotlin:kotlin-reflect:1.9.22"
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-compose-gradle = { module = "org.jetbrains.kotlin:kotlin-compose-compiler-plugin", version.ref = "kotlin" }
kotlin-stdLib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }

hilt-gradle = "com.google.dagger:hilt-android-gradle-plugin:2.48.1"
hilt-android = "com.google.dagger:hilt-android:2.48.1"
Expand All @@ -58,15 +60,15 @@ testing-androidx-orchestrator = "androidx.test:orchestrator:1.4.2"
testing-androidx-espresso = "androidx.test.espresso:espresso-core:3.5.1"
testing-androidx-espressoRecyclerView = "androidx.test.espresso:espresso-contrib:3.5.1"
testing-androidx-espressoIntents = "androidx.test.espresso:espresso-intents:3.5.1"
testing-androidx-fragment = "androidx.fragment:fragment-testing:1.7.1"
testing-androidx-compose = "androidx.compose.ui:ui-test-junit4:1.6.7"
testing-androidx-fragment = "androidx.fragment:fragment-testing:1.8.0"
testing-androidx-compose = "androidx.compose.ui:ui-test-junit4:1.7.0-beta03"

testing-leakcanary-instrumentation = "com.squareup.leakcanary:leakcanary-android-instrumentation:2.10"

testing-archunit = "com.tngtech.archunit:archunit:1.1.0"

processing-ksp-gradle = "com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.10-1.0.13"
processing-ksp = "com.google.devtools.ksp:symbol-processing-api:1.9.22-1.0.17"
processing-ksp-gradle = "com.google.devtools.ksp:symbol-processing-gradle-plugin:2.0.0-1.0.21"
processing-ksp = "com.google.devtools.ksp:symbol-processing-api:2.0.0-1.0.21"
processing-incremental = "net.ltgt.gradle.incap:incap:0.3"
processing-incrementalProcessor = "net.ltgt.gradle.incap:incap-processor:0.3"
processing-autoService = "com.google.auto.service:auto-service:1.0.1"
Expand All @@ -76,5 +78,8 @@ processing-kotlinPoet-ksp = "com.squareup:kotlinpoet-ksp:1.13.2"

material = "com.google.android.material:material:1.12.0"

lint-checks = "com.android.tools.lint:lint-checks:31.4.1"
lint-api = "com.android.tools.lint:lint-api:31.4.1"
lint-checks = "com.android.tools.lint:lint-checks:31.5.0"
lint-api = "com.android.tools.lint:lint-api:31.5.0"

[plugins]
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
28 changes: 28 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@

pluginManagement {
repositories {
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositories {
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
}
}

rootProject.name = "Enro"

include(":example")
Expand Down
1 change: 1 addition & 0 deletions tests/application/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id("kotlin-android")
id("kotlin-parcelize")
id("kotlin-kapt")
alias(libs.plugins.compose.compiler)
}
configureAndroidApp("dev.enro.test.application")
configureCompose()
Expand Down
1 change: 1 addition & 0 deletions tests/module-one/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("kotlin-android")
id("kotlin-parcelize")
id("kotlin-kapt")
alias(libs.plugins.compose.compiler)
}
configureAndroidLibrary("dev.enro.tests.moduleone")
configureCompose()
Expand Down

0 comments on commit 1f880d2

Please sign in to comment.