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

Enable klib ABI dump #1884

Merged
merged 1 commit into from
Apr 4, 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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.diffplug.gradle.spotless.SpotlessExtension
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import kotlinx.validation.ApiValidationExtension
import kotlinx.validation.ExperimentalBCVApi
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.Action
import org.gradle.api.JavaVersion
Expand Down Expand Up @@ -392,6 +393,9 @@ private class RedwoodBuildExtensionImpl(private val project: Project) : RedwoodB
project.plugins.apply("org.jetbrains.kotlinx.binary-compatibility-validator")
val apiValidation = project.extensions.getByName("apiValidation") as ApiValidationExtension
apiValidation.apply {
@OptIn(ExperimentalBCVApi::class)
klib.enabled = true

nonPublicMarkers += listOf(
// The yoga module is an implementation detail of our layouts.
"app.cash.redwood.yoga.RedwoodYogaApi",
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }

kotlinx-binaryCompatibilityValidator = "org.jetbrains.kotlinx:binary-compatibility-validator:0.14.0"
kotlinx-binaryCompatibilityValidator = "org.jetbrains.kotlinx:binary-compatibility-validator:0.15.0-Beta.2"

kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
Expand Down
75 changes: 75 additions & 0 deletions redwood-compose/api/redwood-compose.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Klib ABI Dump
// Targets: [iosArm64, iosSimulatorArm64, iosX64, js, macosArm64, macosX64]
// Alias: apple => [iosArm64, iosSimulatorArm64, iosX64, macosArm64, macosX64]
// Rendering settings:
// - Signature version: 2
// - Show manifest properties: true
// - Show declarations: true

// Library unique name: <app.cash.redwood:redwood-compose>
abstract interface <#A: kotlin/Any> app.cash.redwood.compose/RedwoodApplier { // app.cash.redwood.compose/RedwoodApplier|null[0]
abstract fun recordChanged(app.cash.redwood.widget/Widget<#A>) // app.cash.redwood.compose/RedwoodApplier.recordChanged|recordChanged(app.cash.redwood.widget.Widget<1:0>){}[0]
abstract val widgetSystem // app.cash.redwood.compose/RedwoodApplier.widgetSystem|{}widgetSystem[0]
abstract fun <get-widgetSystem>(): app.cash.redwood.widget/WidgetSystem<#A> // app.cash.redwood.compose/RedwoodApplier.widgetSystem.<get-widgetSystem>|<get-widgetSystem>(){}[0]
}
abstract interface app.cash.redwood.compose/RedwoodComposition { // app.cash.redwood.compose/RedwoodComposition|null[0]
abstract fun cancel() // app.cash.redwood.compose/RedwoodComposition.cancel|cancel(){}[0]
abstract fun setContent(kotlin/Function2<androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>) // app.cash.redwood.compose/RedwoodComposition.setContent|setContent(kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>){}[0]
}
final class <#A: out app.cash.redwood.widget/Widget<#B>, #B: kotlin/Any> app.cash.redwood.compose/WidgetNode : app.cash.redwood.compose/Node<#B> { // app.cash.redwood.compose/WidgetNode|null[0]
constructor <init>(app.cash.redwood.compose/RedwoodApplier<#B>, #A) // app.cash.redwood.compose/WidgetNode.<init>|<init>(app.cash.redwood.compose.RedwoodApplier<1:1>;1:0){}[0]
final fun recordChanged() // app.cash.redwood.compose/WidgetNode.recordChanged|recordChanged(){}[0]
final object Companion { // app.cash.redwood.compose/WidgetNode.Companion|null[0]
final val SetModifiers // app.cash.redwood.compose/WidgetNode.Companion.SetModifiers|{}SetModifiers[0]
final fun <get-SetModifiers>(): kotlin/Function2<app.cash.redwood.compose/WidgetNode<app.cash.redwood.widget/Widget<kotlin/Any>, kotlin/Any>, app.cash.redwood/Modifier, kotlin/Unit> // app.cash.redwood.compose/WidgetNode.Companion.SetModifiers.<get-SetModifiers>|<get-SetModifiers>(){}[0]
}
final val widget // app.cash.redwood.compose/WidgetNode.widget|<get-widget>(){}[0]
final fun <get-widget>(): #A // app.cash.redwood.compose/WidgetNode.widget.<get-widget>|<get-widget>(){}[0]
final var container // app.cash.redwood.compose/WidgetNode.container|{}container[0]
final fun <get-container>(): app.cash.redwood.widget/Widget.Children<#B>? // app.cash.redwood.compose/WidgetNode.container.<get-container>|<get-container>(){}[0]
final fun <set-container>(app.cash.redwood.widget/Widget.Children<#B>?) // app.cash.redwood.compose/WidgetNode.container.<set-container>|<set-container>(app.cash.redwood.widget.Widget.Children<1:1>?){}[0]
final var index // app.cash.redwood.compose/WidgetNode.index|{}index[0]
final fun <get-index>(): kotlin/Int // app.cash.redwood.compose/WidgetNode.index.<get-index>|<get-index>(){}[0]
final fun <set-index>(kotlin/Int) // app.cash.redwood.compose/WidgetNode.index.<set-index>|<set-index>(kotlin.Int){}[0]
}
final class <#A: out app.cash.redwood.widget/Widget<*>> app.cash.redwood.compose/RedwoodComposeContent { // app.cash.redwood.compose/RedwoodComposeContent|null[0]
constructor <init>() // app.cash.redwood.compose/RedwoodComposeContent.<init>|<init>(){}[0]
final fun Children(kotlin/Function1<#A, app.cash.redwood.widget/Widget.Children<*>>, kotlin/Function2<androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int) // app.cash.redwood.compose/RedwoodComposeContent.Children|Children(kotlin.Function1<1:0,app.cash.redwood.widget.Widget.Children<*>>;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int){}[0]
final object Companion { // app.cash.redwood.compose/RedwoodComposeContent.Companion|null[0]
final val Instance // app.cash.redwood.compose/RedwoodComposeContent.Companion.Instance|<get-Instance>(){}[0]
final fun <get-Instance>(): app.cash.redwood.compose/RedwoodComposeContent<kotlin/Nothing> // app.cash.redwood.compose/RedwoodComposeContent.Companion.Instance.<get-Instance>|<get-Instance>(){}[0]
}
}
final const val app.cash.redwood.compose/app_cash_redwood_compose_ChildrenNode$stableprop // app.cash.redwood.compose/app_cash_redwood_compose_ChildrenNode$stableprop|#static{}app_cash_redwood_compose_ChildrenNode$stableprop[0]
final const val app.cash.redwood.compose/app_cash_redwood_compose_NodeApplier$stableprop // app.cash.redwood.compose/app_cash_redwood_compose_NodeApplier$stableprop|#static{}app_cash_redwood_compose_NodeApplier$stableprop[0]
final const val app.cash.redwood.compose/app_cash_redwood_compose_RedwoodComposeContent$stableprop // app.cash.redwood.compose/app_cash_redwood_compose_RedwoodComposeContent$stableprop|#static{}app_cash_redwood_compose_RedwoodComposeContent$stableprop[0]
final const val app.cash.redwood.compose/app_cash_redwood_compose_WidgetNode$stableprop // app.cash.redwood.compose/app_cash_redwood_compose_WidgetNode$stableprop|#static{}app_cash_redwood_compose_WidgetNode$stableprop[0]
final fun <#A: kotlin/Any> app.cash.redwood.compose/RedwoodComposition(kotlinx.coroutines/CoroutineScope, app.cash.redwood.widget/RedwoodView<#A>, app.cash.redwood.widget/WidgetSystem<#A>, kotlin/Function0<kotlin/Unit> =...): app.cash.redwood.compose/RedwoodComposition // app.cash.redwood.compose/RedwoodComposition|RedwoodComposition(kotlinx.coroutines.CoroutineScope;app.cash.redwood.widget.RedwoodView<0:0>;app.cash.redwood.widget.WidgetSystem<0:0>;kotlin.Function0<kotlin.Unit>){0§<kotlin.Any>}[0]
final fun <#A: kotlin/Any> app.cash.redwood.compose/RedwoodComposition(kotlinx.coroutines/CoroutineScope, app.cash.redwood.widget/Widget.Children<#A>, app.cash.redwood.ui/OnBackPressedDispatcher, androidx.compose.runtime.saveable/SaveableStateRegistry?, kotlinx.coroutines.flow/StateFlow<app.cash.redwood.ui/UiConfiguration>, app.cash.redwood.widget/WidgetSystem<#A>, kotlin/Function0<kotlin/Unit> =...): app.cash.redwood.compose/RedwoodComposition // app.cash.redwood.compose/RedwoodComposition|RedwoodComposition(kotlinx.coroutines.CoroutineScope;app.cash.redwood.widget.Widget.Children<0:0>;app.cash.redwood.ui.OnBackPressedDispatcher;androidx.compose.runtime.saveable.SaveableStateRegistry?;kotlinx.coroutines.flow.StateFlow<app.cash.redwood.ui.UiConfiguration>;app.cash.redwood.widget.WidgetSystem<0:0>;kotlin.Function0<kotlin.Unit>){0§<kotlin.Any>}[0]
final fun app.cash.redwood.compose/BackHandler(kotlin/Boolean, kotlin/Function0<kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // app.cash.redwood.compose/BackHandler|BackHandler(kotlin.Boolean;kotlin.Function0<kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final inline fun <#A: app.cash.redwood.widget/WidgetFactoryOwner<#C>, #B: app.cash.redwood.widget/Widget<#C>, #C: kotlin/Any> app.cash.redwood.compose/RedwoodComposeNode(crossinline kotlin/Function1<#A, #B>, kotlin/Function1<androidx.compose.runtime/Updater<app.cash.redwood.compose/WidgetNode<#B, #C>>, kotlin/Unit>, kotlin/Function3<app.cash.redwood.compose/RedwoodComposeContent<#B>, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int) // app.cash.redwood.compose/RedwoodComposeNode|RedwoodComposeNode(kotlin.Function1<0:0,0:1>;kotlin.Function1<androidx.compose.runtime.Updater<app.cash.redwood.compose.WidgetNode<0:1,0:2>>,kotlin.Unit>;kotlin.Function3<app.cash.redwood.compose.RedwoodComposeContent<0:1>,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int){0§<app.cash.redwood.widget.WidgetFactoryOwner<0:2>>;1§<app.cash.redwood.widget.Widget<0:2>>;2§<kotlin.Any>}[0]
final val app.cash.redwood.compose/LocalOnBackPressedDispatcher // app.cash.redwood.compose/LocalOnBackPressedDispatcher|{}LocalOnBackPressedDispatcher[0]
final fun <get-LocalOnBackPressedDispatcher>(): androidx.compose.runtime/ProvidableCompositionLocal<app.cash.redwood.ui/OnBackPressedDispatcher> // app.cash.redwood.compose/LocalOnBackPressedDispatcher.<get-LocalOnBackPressedDispatcher>|<get-LocalOnBackPressedDispatcher>(){}[0]
final val app.cash.redwood.compose/LocalUiConfiguration // app.cash.redwood.compose/LocalUiConfiguration|{}LocalUiConfiguration[0]
final fun <get-LocalUiConfiguration>(): androidx.compose.runtime/ProvidableCompositionLocal<app.cash.redwood.ui/UiConfiguration> // app.cash.redwood.compose/LocalUiConfiguration.<get-LocalUiConfiguration>|<get-LocalUiConfiguration>(){}[0]
final val app.cash.redwood.compose/LocalWidgetVersion // app.cash.redwood.compose/LocalWidgetVersion|{}LocalWidgetVersion[0]
final fun <get-LocalWidgetVersion>(): androidx.compose.runtime/ProvidableCompositionLocal<kotlin/UInt> // app.cash.redwood.compose/LocalWidgetVersion.<get-LocalWidgetVersion>|<get-LocalWidgetVersion>(){}[0]
final val app.cash.redwood.compose/WidgetVersion // app.cash.redwood.compose/WidgetVersion|{}WidgetVersion[0]
final fun <get-WidgetVersion>(androidx.compose.runtime/Composer?, kotlin/Int): kotlin/UInt // app.cash.redwood.compose/WidgetVersion.<get-WidgetVersion>|<get-WidgetVersion>(androidx.compose.runtime.Composer?;kotlin.Int){}[0]
final val app.cash.redwood.compose/current // app.cash.redwood.compose/current|@app.cash.redwood.ui.OnBackPressedDispatcher.Companion{}current[0]
final fun (app.cash.redwood.ui/OnBackPressedDispatcher.Companion).<get-current>(androidx.compose.runtime/Composer?, kotlin/Int): app.cash.redwood.ui/OnBackPressedDispatcher // app.cash.redwood.compose/current.<get-current>|<get-current>@app.cash.redwood.ui.OnBackPressedDispatcher.Companion(androidx.compose.runtime.Composer?;kotlin.Int){}[0]
final val app.cash.redwood.compose/current // app.cash.redwood.compose/current|@app.cash.redwood.ui.UiConfiguration.Companion{}current[0]
final fun (app.cash.redwood.ui/UiConfiguration.Companion).<get-current>(androidx.compose.runtime/Composer?, kotlin/Int): app.cash.redwood.ui/UiConfiguration // app.cash.redwood.compose/current.<get-current>|<get-current>@app.cash.redwood.ui.UiConfiguration.Companion(androidx.compose.runtime.Composer?;kotlin.Int){}[0]
sealed interface <#A: kotlin/Any> app.cash.redwood.compose/Node // app.cash.redwood.compose/Node|null[0]
// Targets: [apple]
final const val app.cash.redwood.compose/app_cash_redwood_compose_DisplayLinkClock$stableprop // app.cash.redwood.compose/app_cash_redwood_compose_DisplayLinkClock$stableprop|#static{}app_cash_redwood_compose_DisplayLinkClock$stableprop[0]
// Targets: [apple]
final object app.cash.redwood.compose/DisplayLinkClock : androidx.compose.runtime/MonotonicFrameClock { // app.cash.redwood.compose/DisplayLinkClock|null[0]
final suspend fun <#A1: kotlin/Any?> withFrameNanos(kotlin/Function1<kotlin/Long, #A1>): #A1 // app.cash.redwood.compose/DisplayLinkClock.withFrameNanos|withFrameNanos(kotlin.Function1<kotlin.Long,0:0>){0§<kotlin.Any?>}[0]
}
// Targets: [js]
final const val app.cash.redwood.compose/app_cash_redwood_compose_WindowAnimationFrameClock$stableprop // app.cash.redwood.compose/app_cash_redwood_compose_WindowAnimationFrameClock$stableprop|#static{}app_cash_redwood_compose_WindowAnimationFrameClock$stableprop[0]
// Targets: [js]
final object app.cash.redwood.compose/WindowAnimationFrameClock : androidx.compose.runtime/MonotonicFrameClock { // app.cash.redwood.compose/WindowAnimationFrameClock|null[0]
final suspend fun <#A1: kotlin/Any?> withFrameNanos(kotlin/Function1<kotlin/Long, #A1>): #A1 // app.cash.redwood.compose/WindowAnimationFrameClock.withFrameNanos|withFrameNanos(kotlin.Function1<kotlin.Long,0:0>){0§<kotlin.Any?>}[0]
}
10 changes: 10 additions & 0 deletions redwood-composeui/api/redwood-composeui.klib.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Klib ABI Dump
// Targets: [iosArm64, iosSimulatorArm64, iosX64, macosArm64, macosX64]
// Rendering settings:
// - Signature version: 2
// - Show manifest properties: true
// - Show declarations: true

// Library unique name: <app.cash.redwood:redwood-composeui>
final fun app.cash.redwood.composeui/RedwoodContent(app.cash.redwood.widget/WidgetSystem<kotlin/Function2<androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>>, androidx.compose.ui/Modifier?, kotlin/Function2<androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // app.cash.redwood.composeui/RedwoodContent|RedwoodContent(app.cash.redwood.widget.WidgetSystem<kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>>;androidx.compose.ui.Modifier?;kotlin.Function2<androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun app.cash.redwood.composeui/safeAreaInsets(androidx.compose.runtime/Composer?, kotlin/Int): app.cash.redwood.ui/Margin // app.cash.redwood.composeui/safeAreaInsets|safeAreaInsets(androidx.compose.runtime.Composer?;kotlin.Int){}[0]
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,9 @@ public abstract class RedwoodGeneratorPlugin(
it.classpath.from(schemaConfiguration)
}

project.afterEvaluate {
check(project.plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
"Redwood schema plugin requires the Kotlin multiplatform plugin to be applied."
}

val schemaProject = extension.source.get()
project.dependencies.add(schemaConfiguration.name, schemaProject)
var hasMpp = false
project.plugins.withId("org.jetbrains.kotlin.multiplatform") {
hasMpp = true

val kotlin = project.extensions.getByType(KotlinMultiplatformExtension::class.java)
kotlin.sourceSets.getByName(COMMON_MAIN_SOURCE_SET_NAME) { sourceSet ->
Expand All @@ -129,5 +125,14 @@ public abstract class RedwoodGeneratorPlugin(
}
}
}

project.afterEvaluate {
check(hasMpp) {
"Redwood schema plugin requires the Kotlin multiplatform plugin to be applied."
}

val schemaProject = extension.source.get()
project.dependencies.add(schemaConfiguration.name, schemaProject)
}
}
}
Loading