Skip to content

Commit

Permalink
chore(deps): update kotlin-ksp-compose to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and tatsutakein committed Jun 4, 2024
1 parent 4613b7c commit fd2fd0b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ bin/
gen/
out/
build/
.kotlin/

# Local configuration file (sdk path, etc)
local.properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-dependencies",
"state" : {
"revision" : "d3a5af3038a09add4d7682f66555d6212058a3c0",
"version" : "1.2.2"
"revision" : "350e1e119babe8525f9bd155b76640a5de270184",
"version" : "1.3.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ class KmpAndroidPlugin : Plugin<Project> {
}
android {
setupAndroid()
sourceSets {
getByName("main") {
assets.srcDirs("src/androidMain/assets")
java.srcDirs("src/androidMain/kotlin", "src/commonMain/kotlin")
res.srcDirs("src/androidMain/res")
}
getByName("test") {
assets.srcDirs("src/androidUnitTest/assets")
java.srcDirs("src/androidUnitTest/kotlin", "src/commonTest/kotlin")
res.srcDirs("src/androidUnitTest/res")
}
}
}
// https://slack-chats.kotlinlang.org/t/13166064/been-discovering-that-the-task-kspcommonmainkotlinmetadata-i#9a50fa1b-1ec5-47c2-9172-2a5780a1900e
tasks.withType<KspTaskMetadata>().configureEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ package club.nito.primitive

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.get
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension

@Suppress("unused")
class KmpComposePlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("org.jetbrains.compose")
apply("org.jetbrains.kotlin.plugin.compose")
}
val compose = (extensions["compose"] as org.jetbrains.compose.ComposeExtension).apply {
kotlinCompilerPlugin.set(libs.version("composeCompiler"))
composeCompiler {
// Enable 'strong skipping'
// https://medium.com/androiddevelopers/jetpack-compose-strong-skipping-mode-explained-cbdb2aa4b900
enableStrongSkippingMode.set(true)
}
val compose = (extensions["compose"] as org.jetbrains.compose.ComposeExtension)
kotlin {
with(sourceSets) {
getByName("commonMain").apply {
Expand All @@ -37,3 +43,7 @@ class KmpComposePlugin : Plugin<Project> {
}
}
}

private fun Project.composeCompiler(block: ComposeCompilerGradlePluginExtension.() -> Unit) {
extensions.configure<ComposeCompilerGradlePluginExtension>(block)
}
15 changes: 2 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ plugins {
alias(libs.plugins.androidGradlePlugin) apply false
alias(libs.plugins.androidGradleLibraryPlugin) apply false
alias(libs.plugins.kotlinGradlePlugin) apply false
alias(libs.plugins.composeMultiplatform) apply false
alias(libs.plugins.composeCompiler) apply false
alias(libs.plugins.kotlinxKover) apply false
}

//tasks.register("clean", Delete::class) {
// delete(rootProject.layout.buildDirectory)
//}

buildscript {
configurations.all {
resolutionStrategy.eachDependency {
Expand All @@ -18,12 +16,3 @@ buildscript {
}
}
}

//plugins {
// //trick: for the same plugin versions in all sub-modules
// alias(libs.plugins.androidApplication).apply(false)
// alias(libs.plugins.androidLibrary).apply(false)
// alias(libs.plugins.kotlinAndroid).apply(false)
// alias(libs.plugins.kotlinMultiplatform).apply(false)
//}

7 changes: 6 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ org.gradle.configuration-cache.problems=warn
########################################################
kotlin.code.style=official
kotlin.js.compiler=ir
kotlin.native.binary.memoryModel=experimental

# Enable incrememental klib compilation
kotlin.incremental.native=true
kotlin.native.ignoreDisabledTargets=true

kotlin.mpp.applyDefaultHierarchyTemplate=false
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.stability.nowarn=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.mpp.androidGradlePluginCompatibility.nowarn=true

org.jetbrains.compose.experimental.uikit.enabled=true
org.jetbrains.compose.experimental.jscanvas.enabled=true

Expand Down
10 changes: 6 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ androidGradlePlugin = "8.4.1"
# For updating Kotlin and Compose Compiler version, see:
# https://github.com/JetBrains/compose-multiplatform/blob/master/VERSIONING.md#kotlin-compatibility
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin?#pre-release_kotlin_compatibility
kotlin = "1.9.23"
kotlin = "2.0.0"

androidDesugarJdkLibs = "2.0.4"
apollographql = "3.8.4"
compose = "1.6.11"
composeCompiler = "1.5.10"
androidxActivity = "1.9.0"
androidxSplashScreen = "1.0.1"
kotlinxCoroutines = "1.8.1"
Expand Down Expand Up @@ -40,7 +39,8 @@ imageLoader = "1.8.1"
[libraries]
androidGradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
kotlinGradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
composeGradlePlugin = { group = "org.jetbrains.compose", name = "compose-gradle-plugin", version.ref = "compose" }
composeGradlePlugin = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "compose" }
composeCompilerGradlePlugin = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }
kspGradlePlugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" }
firebaseGradlePlugin = { module = "com.google.gms:google-services", version = "4.4.2" }
kotlinxSerializationGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
Expand Down Expand Up @@ -135,7 +135,8 @@ kotestFrameworkDatatest = { module = "io.kotest:kotest-framework-datatest" }
kotestRunnerJunit5 = { module = "io.kotest:kotest-runner-junit5" }

[plugins]
composeGradlePlugin = { id = "org.jetbrains.compose", version.ref = "compose" }
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose" }
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
androidGradlePlugin = { id = "com.android.application", version.ref = "androidGradlePlugin" }
androidGradleLibraryPlugin = { id = "com.android.library", version.ref = "androidGradlePlugin" }
apollographql = { id = "com.apollographql.apollo3", version.ref = "apollographql" }
Expand All @@ -150,6 +151,7 @@ plugins = [
"androidGradlePlugin",
"kotlinGradlePlugin",
"composeGradlePlugin",
"composeCompilerGradlePlugin",
"kspGradlePlugin",
"firebaseGradlePlugin",
"kotlinxSerializationGradlePlugin",
Expand Down

0 comments on commit fd2fd0b

Please sign in to comment.