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

Fix opting into EngineApi and expect-actual-classes. #1226

Merged
merged 1 commit into from
Jan 16, 2024
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
12 changes: 12 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ allprojects {
plugins.withId("org.jetbrains.kotlin.multiplatform") {
configure<KotlinMultiplatformExtension> {
jvmToolchain(11)
@Suppress("OPT_IN_USAGE")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who watches the watchmen?

compilerOptions {
freeCompilerArgs.addAll("-opt-in=app.cash.zipline.EngineApi")
}
// https://youtrack.jetbrains.com/issue/KT-61573
targets.configureEach {
compilations.configureEach {
compilerOptions.configure {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised you need this last configure block. I thought compilerOptions returned an object directly on which you could invoke freeCompilerArgs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly it's a different return type for KotlinCompilation and KotlinProjectExtension

freeCompilerArgs.addAll("-Xexpect-actual-classes")
}
}
}
}
}

Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ auto-service-compiler = { module = "dev.zacsweers.autoservice:auto-service-ksp",
auto-service-annotations = { module = "com.google.auto.service:auto-service-annotations", version = "1.1.1" }
binary-compatibility-validator-gradle-plugin = { module = "org.jetbrains.kotlinx.binary-compatibility-validator:org.jetbrains.kotlinx.binary-compatibility-validator.gradle.plugin", version = "0.13.2" }
cklib-gradle-plugin = { module = "co.touchlab:cklib-gradle-plugin", version = "0.3.0" }
coil-compose = { module = "io.coil-kt:coil-compose", version = "2.5.0" }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed this is unused (unfortunately!)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah from emoji probably, before it moved to Redwood.

dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.9.10" }
duktape = { module = "com.squareup.duktape:duktape-android", version = "1.4.0" }
http4k-core = { module = "org.http4k:http4k-core", version.ref = "http4k" }
Expand Down
1 change: 0 additions & 1 deletion samples/world-clock/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ dependencies {
implementation(libs.androidx.appCompat)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle)
implementation(libs.coil.compose)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.tooling.preview)
Expand Down
8 changes: 4 additions & 4 deletions zipline-bytecode/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ plugins {
}

kotlin {
sourceSets.all {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this worked previously, but it currently doesn't opt in for the JVM plugin.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I've only used this construct with the multiplatform plugin. Probably me copy/pasting too aggressively.

languageSettings {
optIn("app.cash.zipline.EngineApi")
}
compilerOptions {
freeCompilerArgs.addAll(
"-opt-in=app.cash.zipline.EngineApi",
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
*/
package app.cash.zipline.bytecode

import app.cash.zipline.EngineApi
import app.cash.zipline.QuickJs
import assertk.assertThat
import assertk.assertions.startsWith
import kotlin.test.assertFailsWith
import org.junit.After
import org.junit.Test

@OptIn(EngineApi::class)
class StripLineNumbersTest {
private val quickJs = QuickJs.create()

Expand Down
8 changes: 4 additions & 4 deletions zipline-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ plugins {
}

kotlin {
sourceSets.all {
languageSettings {
optIn("app.cash.zipline.EngineApi")
}
compilerOptions {
freeCompilerArgs.addAll(
"-opt-in=app.cash.zipline.EngineApi",
)
}
}

Expand Down
6 changes: 0 additions & 6 deletions zipline-loader-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ kotlin {
implementation(libs.kotlinx.serialization.json)
}
}

sourceSets.all {
languageSettings {
optIn("app.cash.zipline.EngineApi")
}
}
}

targets.all {
Expand Down
6 changes: 0 additions & 6 deletions zipline-loader/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ kotlin {
implementation(projects.ziplineLoaderTesting)
}
}

all {
languageSettings {
optIn("app.cash.zipline.EngineApi")
}
}
}
}

Expand Down
6 changes: 0 additions & 6 deletions zipline-profiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ kotlin {
tvosX64()

sourceSets {
all {
languageSettings {
optIn("app.cash.zipline.EngineApi")
}
}

val commonMain by getting {
dependencies {
api(projects.zipline)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package app.cash.zipline.testing

import app.cash.zipline.EngineApi
import app.cash.zipline.Zipline
import okio.FileSystem
import okio.Path
Expand All @@ -36,7 +35,6 @@ val ziplineRootOrNull: Path?
internal expect fun getEnv(name: String): String?

/** Load our testing libraries into QuickJS. */
@OptIn(EngineApi::class)
fun Zipline.loadTestingJs() {
// Load modules in topologically-sorted order. In production the zipline-manifest does this.
loadJsModuleFromResource("./kotlin-kotlin-stdlib.js")
Expand Down
6 changes: 0 additions & 6 deletions zipline/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ kotlin {
project.dependencies.add(pluginConfigurationName, projects.ziplineKotlinPlugin)
}
}

all {
languageSettings {
optIn("app.cash.zipline.EngineApi")
}
}
}
}

Expand Down
Loading