Skip to content

Commit

Permalink
Bump kotlin from 1.9.24 to 2.0.0 (#33)
Browse files Browse the repository at this point in the history
* Bump ksp from 1.9.24-1.0.20 to 2.0.0-1.0.21

Bumps `ksp` from 1.9.24-1.0.20 to 2.0.0-1.0.21.

Updates `com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin` from 1.9.24-1.0.20 to 2.0.0-1.0.21
- [Release notes](https://github.com/google/ksp/releases)
- [Commits](google/ksp@1.9.24-1.0.20...2.0.0-1.0.21)

Updates `com.google.devtools.ksp` from 1.9.24-1.0.20 to 2.0.0-1.0.21
- [Release notes](https://github.com/google/ksp/releases)
- [Commits](google/ksp@1.9.24-1.0.20...2.0.0-1.0.21)

---
updated-dependencies:
- dependency-name: com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: com.google.devtools.ksp
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump kotlin from 1.9.24 to 2.0.0

Bumps `kotlin` from 1.9.24 to 2.0.0.

Updates `org.jetbrains.kotlin:kotlin-gradle-plugin` from 1.9.24 to 2.0.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.0/ChangeLog.md)
- [Commits](JetBrains/kotlin@v1.9.24...v2.0.0)

Updates `org.jetbrains.kotlin.android` from 1.9.24 to 2.0.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.0/ChangeLog.md)
- [Commits](JetBrains/kotlin@v1.9.24...v2.0.0)

Updates `org.jetbrains.kotlin.jvm` from 1.9.24 to 2.0.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.0/ChangeLog.md)
- [Commits](JetBrains/kotlin@v1.9.24...v2.0.0)

Updates `org.jetbrains.kotlin.plugin.serialization` from 1.9.24 to 2.0.0
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v2.0.0/ChangeLog.md)
- [Commits](JetBrains/kotlin@v1.9.24...v2.0.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.jetbrains.kotlin.android
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.jetbrains.kotlin.jvm
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: org.jetbrains.kotlin.plugin.serialization
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* update kotlin to 2.0.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lucasmodesto <dev.lucasmodesto@gmail.com>
  • Loading branch information
dependabot[bot] and lucasmodesto committed May 27, 2024
1 parent b91ac5e commit a65e440
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 46 deletions.
13 changes: 4 additions & 9 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile


plugins {
`kotlin-dsl`
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

Expand All @@ -33,6 +27,7 @@ dependencies {
compileOnly(libs.android.tools.common)
compileOnly(libs.kotlin.gradle.plugin)
compileOnly(libs.ksp.gradle.plugin)
compileOnly(libs.gradle.kotlin.compose.compiler)
}

gradlePlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@
*/

import br.com.cattose.buildlogic.convention.configureAndroidCompose
import com.android.build.api.dsl.ApplicationExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.getByType

class AndroidApplicationComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("com.android.application")
val extension = extensions.getByType<ApplicationExtension>()
configureAndroidCompose(extension)
configureAndroidCompose()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@
*/

import br.com.cattose.buildlogic.convention.configureAndroidCompose
import com.android.build.gradle.LibraryExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.getByType

class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("com.android.library")
val extension = extensions.getByType<LibraryExtension>()
configureAndroidCompose(extension)
configureAndroidCompose()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@
*/
package br.com.cattose.buildlogic.convention

import com.android.build.api.dsl.CommonExtension
import org.gradle.api.Project
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension

internal fun Project.configureAndroidCompose(
commonExtension: CommonExtension<*, *, *, *, *, *>,
) {
commonExtension.apply {
buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.14"
}
internal fun Project.configureAndroidCompose() {
pluginManager.apply("org.jetbrains.kotlin.plugin.compose")
with(extensions.getByType<ComposeCompilerGradlePluginExtension>()) {
enableStrongSkippingMode.set(true)
includeSourceInformation.set(true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package br.com.cattose.buildlogic.convention
import com.android.build.api.dsl.CommonExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension

internal fun Project.configureKotlinAndroid(
commonExtension: CommonExtension<*, *, *, *, *, *>,
Expand All @@ -38,18 +38,9 @@ internal fun Project.configureKotlinAndroid(
targetCompatibility = JavaVersion.VERSION_17
}
}
configureKotlin()
}

private fun Project.configureKotlin() {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
val warningsAsErrors: String? by project
allWarningsAsErrors = warningsAsErrors.toBoolean()
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
)
with(extensions.getByType<KotlinAndroidProjectExtension>()) {
compilerOptions {
jvmTarget.set(JVM_17)
}
}
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ plugins {
alias(libs.plugins.jetbrains.kotlin.jvm) apply false
alias(libs.plugins.secrets) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.compose.compiler) apply false
}
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
agp = "8.4.1"
tools = "31.4.1"
kotlin = "1.9.24"
kotlin = "2.0.0"
core-ktx = "1.13.1"
junit = "4.13.2"
androidx-test-ext-junit = "1.1.5"
Expand All @@ -13,7 +13,7 @@ espresso-device = "1.0.0-beta01"
lifecycle-runtime-ktx = "2.8.0"
activity-compose = "1.9.0"
#compose-bom = "2024.04.01"
ksp = "1.9.24-1.0.20"
ksp = "2.0.0-1.0.21"
hilt = "2.51.1"
truth = "1.4.2"
turbine = "1.1.0"
Expand Down Expand Up @@ -93,6 +93,7 @@ android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", ver
android-tools-common = { group = "com.android.tools", name = "common", version.ref = "tools" }
kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
ksp-gradle-plugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" }
gradle-kotlin-compose-compiler = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }

[bundles]
test-commons = [
Expand Down Expand Up @@ -128,6 +129,7 @@ hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" }
kotlin-compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

cattose-hilt = { id = "cattose.android.hilt", version = "unspecified" }
cattose-android-application = { id = "cattose.android.application", version = "unspecified" }
Expand Down

0 comments on commit a65e440

Please sign in to comment.