Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Kotlin to 1.9.0. #1081

Merged
merged 6 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ docs/0.x
# Testing
zipline-gradle-plugin/src/test/projects/**/gradle/wrapper

# Yarn
samples/**/yarn.lock
zipline-gradle-plugin/src/test/projects/**/yarn.lock

generated-zipline-webpack-config.js
16 changes: 6 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import kotlinx.validation.ApiValidationExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.DokkaConfiguration.Visibility
import org.jetbrains.dokka.gradle.AbstractDokkaTask
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
Expand Down Expand Up @@ -133,16 +134,11 @@ allprojects {

// Workaround for https://github.com/Kotlin/dokka/issues/2977.
// We disable the C Interop IDE metadata task when generating documentation using Dokka.
gradle.taskGraph.whenReady {
val hasDokkaTasks = gradle.taskGraph.allTasks.any {
it is org.jetbrains.dokka.gradle.AbstractDokkaTask
}
if (hasDokkaTasks) {
// Type is internal so we must look it up with reflection.
val cinteropType = Class.forName("org.jetbrains.kotlin.gradle.targets.native.internal.CInteropMetadataDependencyTransformationTask") as Class<Task>
tasks.withType(cinteropType).configureEach {
enabled = false
}
tasks.withType<AbstractDokkaTask> {
@Suppress("UNCHECKED_CAST")
val taskClass = Class.forName("org.jetbrains.kotlin.gradle.targets.native.internal.CInteropMetadataDependencyTransformationTask") as Class<Task>
parent?.subprojects?.forEach {
dependsOn(it.tasks.withType(taskClass))
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ systemProp.org.gradle.internal.http.socketTimeout=120000

kotlin.js.compiler=ir
kotlin.native.ignoreDisabledTargets=true
kotlin.mpp.androidSourceSetLayoutVersion1.nowarn=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.mpp.stability.nowarn=true
kotlin.mpp.commonizerLogLevel=info
kotlin.mpp.enableCInteropCommonization=true
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]
androidx-compose = "1.4.3"
androidx-compose-compiler = "1.4.8"
androidx-compose-compiler = "1.5.0"
auto-service="1.1.1"
compileSdk = "33"
http4k = "4.48.0.0"
kotlin = "1.8.22"
kotlin = "1.9.0"
kotlinx-coroutines = "1.7.3"
kotlinx-serialization = "1.5.1"
okHttp = "4.11.0"
Expand Down
807 changes: 271 additions & 536 deletions kotlin-js-store/yarn.lock

Large diffs are not rendered by default.

3,018 changes: 0 additions & 3,018 deletions samples/kotlin-js-store/yarn.lock

This file was deleted.

6 changes: 5 additions & 1 deletion samples/trivia/trivia-js/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import app.cash.zipline.gradle.ZiplineCompileTask
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension

plugins {
kotlin("multiplatform")
Expand All @@ -22,8 +24,10 @@ kotlin {
}
}


zipline {
mainFunction.set("app.cash.zipline.samples.trivia.launchZipline")
}

plugins.withType<YarnPlugin> {
the<YarnRootExtension>().yarnLockAutoReplace = true
}
7 changes: 7 additions & 0 deletions samples/trivia/trivia-shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension

apply(plugin = "app.cash.zipline")

plugins {
Expand All @@ -22,3 +25,7 @@ kotlin {
}
}
}

plugins.withType<YarnPlugin> {
the<YarnRootExtension>().yarnLockAutoReplace = true
}
8 changes: 7 additions & 1 deletion samples/world-clock/presenters/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension

plugins {
kotlin("multiplatform")
Expand All @@ -12,7 +14,7 @@ kotlin {
iosX64()
iosSimulatorArm64()

android()
androidTarget()

js {
browser()
Expand Down Expand Up @@ -64,3 +66,7 @@ android {
zipline {
mainFunction.set("app.cash.zipline.samples.worldclock.main")
}

plugins.withType<YarnPlugin> {
the<YarnRootExtension>().yarnLockAutoReplace = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private val ziplineServiceClassId =
internal class FirZiplineApiReader(
output: FirResult,
) {
private val platformOutput = output.platformOutput
private val platformOutput = output.outputs.first()
private val session: FirSession = platformOutput.session

private val ziplineServiceClass: FirClassLikeSymbol<*>? =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.cli.jvm.compiler.VfsBasedProjectEnvironment
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.GroupedKtSources
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.ModuleCompilerEnvironment
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.ModuleCompilerInput
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.compileModuleToAnalyzedFir
Expand Down Expand Up @@ -102,12 +103,16 @@ internal class KotlinFirLoader(
}
}

val sourceFiles = files.mapTo(mutableSetOf(), ::KtVirtualFileSourceFile)
val input = ModuleCompilerInput(
targetId = TargetId(JvmProtoBufUtil.DEFAULT_MODULE_NAME, targetName),
groupedSources = GroupedKtSources(
platformSources = sourceFiles,
commonSources = emptyList(),
sourcesByModuleName = mapOf(JvmProtoBufUtil.DEFAULT_MODULE_NAME to sourceFiles),
),
commonPlatform = CommonPlatforms.defaultCommonPlatform,
commonSources = emptyList(),
platform = JvmPlatforms.unspecifiedJvmPlatform,
platformSources = files.map(::KtVirtualFileSourceFile),
configuration = configuration,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ZiplinePluginTest {
.contains(result.task(taskName)!!.outcome)

val ziplineOut = projectDir.resolve(
"lib/build/distributionsZipline",
"lib/build/dist/js/productionExecutableZipline",
)
assertThat(ziplineOut.listFiles()?.size).isEqualTo(2)
assertThat(ziplineOut.resolve(manifestFileName).exists()).isTrue()
Expand Down Expand Up @@ -130,7 +130,7 @@ class ZiplinePluginTest {
.contains(result.task(taskName)!!.outcome)

val ziplineOut = projectDir.resolve(
"lib/build/compileSync/js/main/developmentExecutable/kotlinZipline",
"lib/build/compileSync/blue/main/developmentExecutable/kotlinZipline",
)
val manifest = ziplineOut.resolve(manifestFileName)
assertThat(manifest.exists()).isTrue()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

kotlin {
android()
androidTarget()
js {
browser()
binaries.executable()
Expand Down
Loading