diff --git a/build-logic/chameleon/chameleon-compiler-plugin/src/main/kotlin/io/github/reactivecircus/chameleon/compiler/ChameleonCompilerPluginRegistrar.kt b/build-logic/chameleon/chameleon-compiler-plugin/src/main/kotlin/io/github/reactivecircus/chameleon/compiler/ChameleonCompilerPluginRegistrar.kt index 38cdc5c7..89631952 100644 --- a/build-logic/chameleon/chameleon-compiler-plugin/src/main/kotlin/io/github/reactivecircus/chameleon/compiler/ChameleonCompilerPluginRegistrar.kt +++ b/build-logic/chameleon/chameleon-compiler-plugin/src/main/kotlin/io/github/reactivecircus/chameleon/compiler/ChameleonCompilerPluginRegistrar.kt @@ -7,6 +7,7 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar import org.jetbrains.kotlin.config.CommonConfigurationKeys import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.config.MessageCollectorAccess import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter import org.jetbrains.kotlin.name.ClassId @@ -26,6 +27,7 @@ public class ChameleonCompilerPluginRegistrar : CompilerPluginRegistrar() { ) val themeVariantClassId = ClassId.fromString(themeVariantEnumString) + @OptIn(MessageCollectorAccess::class) val messageCollector = configuration[CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE] FirExtensionRegistrarAdapter.registerExtension(ChameleonFirExtensionRegistrar) diff --git a/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/Basic.fir.ir.txt b/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/Basic.ir.txt similarity index 100% rename from build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/Basic.fir.ir.txt rename to build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/Basic.ir.txt diff --git a/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/ExistingThemeVariantProperty.fir.ir.txt b/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/ExistingThemeVariantProperty.ir.txt similarity index 100% rename from build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/ExistingThemeVariantProperty.fir.ir.txt rename to build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/ExistingThemeVariantProperty.ir.txt diff --git a/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/NoSnapshotFunctionCalls.fir.ir.txt b/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/NoSnapshotFunctionCalls.ir.txt similarity index 100% rename from build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/NoSnapshotFunctionCalls.fir.ir.txt rename to build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/NoSnapshotFunctionCalls.ir.txt diff --git a/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/ThemeVariantArgumentProvided.fir.ir.txt b/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/ThemeVariantArgumentProvided.ir.txt similarity index 100% rename from build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/ThemeVariantArgumentProvided.fir.ir.txt rename to build-logic/chameleon/chameleon-compiler-plugin/src/test/data/box/ThemeVariantArgumentProvided.ir.txt diff --git a/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/diagnostic/fir/RedundantBurstAnnotation.diag.txt b/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/diagnostic/fir/RedundantBurstAnnotation.diag.txt new file mode 100644 index 00000000..fa3e8d29 --- /dev/null +++ b/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/diagnostic/fir/RedundantBurstAnnotation.diag.txt @@ -0,0 +1 @@ +/RedundantBurstAnnotation.kt:7:1: error: `@Burst` annotation is redundant on classes annotated with `@Chameleon`. diff --git a/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/diagnostic/fir/RedundantBurstAnnotation.fir.diag.txt b/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/diagnostic/fir/RedundantBurstAnnotation.fir.diag.txt deleted file mode 100644 index 5eed5def..00000000 --- a/build-logic/chameleon/chameleon-compiler-plugin/src/test/data/diagnostic/fir/RedundantBurstAnnotation.fir.diag.txt +++ /dev/null @@ -1 +0,0 @@ -/RedundantBurstAnnotation.kt:(174,180): error: `@Burst` annotation is redundant on classes annotated with `@Chameleon`. diff --git a/build-logic/chameleon/chameleon-compiler-plugin/src/test/kotlin/io/github/reactivecircus/chameleon/compiler/ChameleonExtensionRegistrarConfigurator.kt b/build-logic/chameleon/chameleon-compiler-plugin/src/test/kotlin/io/github/reactivecircus/chameleon/compiler/ChameleonExtensionRegistrarConfigurator.kt index fb4fc98b..4847c06c 100644 --- a/build-logic/chameleon/chameleon-compiler-plugin/src/test/kotlin/io/github/reactivecircus/chameleon/compiler/ChameleonExtensionRegistrarConfigurator.kt +++ b/build-logic/chameleon/chameleon-compiler-plugin/src/test/kotlin/io/github/reactivecircus/chameleon/compiler/ChameleonExtensionRegistrarConfigurator.kt @@ -8,6 +8,7 @@ import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoots import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar import org.jetbrains.kotlin.config.CommonConfigurationKeys import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.config.MessageCollectorAccess import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder @@ -40,15 +41,13 @@ private class ChameleonExtensionRegistrarConfigurator( FirExtensionRegistrarAdapter.registerExtension(ChameleonFirExtensionRegistrar) + @OptIn(MessageCollectorAccess::class) IrGenerationExtension.registerExtension( ChameleonIrGenerationExtension( chameleonAnnotationId = ClassIds.Chameleon.Annotation, snapshotFunctionId = snapshotFunctionString.toMemberCallableId(), themeVariantEnumId = ClassId.fromString(themeVariantEnumString), - messageCollector = configuration.get( - CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY, - MessageCollector.NONE, - ), + messageCollector = configuration[CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE], ), ) } diff --git a/build-logic/kstreamlined-build-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/internal/metroBuildLogic.kt b/build-logic/kstreamlined-build-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/internal/metroBuildLogic.kt index 2931f5c1..7164fa83 100644 --- a/build-logic/kstreamlined-build-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/internal/metroBuildLogic.kt +++ b/build-logic/kstreamlined-build-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/internal/metroBuildLogic.kt @@ -2,6 +2,7 @@ package io.github.reactivecircus.kstreamlined.gradle.internal import com.android.build.api.variant.ApplicationAndroidComponentsExtension import dev.zacsweers.metro.gradle.DelicateMetroGradleApi +import dev.zacsweers.metro.gradle.ExperimentalMetroGradleApi import dev.zacsweers.metro.gradle.MetroPluginExtension import org.gradle.api.DefaultTask import org.gradle.api.Project @@ -23,6 +24,8 @@ internal fun Project.configureMetro() { pluginManager.apply("dev.zacsweers.metro") extensions.configure(MetroPluginExtension::class.java) { it.generateContributionProviders.set(true) + @OptIn(ExperimentalMetroGradleApi::class) + it.generateClassesInIr.set(false) // TODO re-enable once supported by RouteBinding if (providers.gradleProperty("enableMetroCompilerReports").orNull == "true") { it.reportsDestination.set(layout.buildDirectory.dir("metro_reports")) } diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/RouteBindingCompilerPluginRegistrar.kt b/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/RouteBindingCompilerPluginRegistrar.kt index 34e503fc..b2f8967d 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/RouteBindingCompilerPluginRegistrar.kt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/RouteBindingCompilerPluginRegistrar.kt @@ -7,6 +7,7 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar import org.jetbrains.kotlin.config.CommonConfigurationKeys import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.config.MessageCollectorAccess import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter public class RouteBindingCompilerPluginRegistrar : CompilerPluginRegistrar() { @@ -15,6 +16,7 @@ public class RouteBindingCompilerPluginRegistrar : CompilerPluginRegistrar() { override val supportsK2: Boolean get() = true override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) { + @OptIn(MessageCollectorAccess::class) val messageCollector = configuration[CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE] FirExtensionRegistrarAdapter.registerExtension(RouteBindingFirExtensionRegistrar) diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/fir/diagnostics/RouteBindingFirAdditionalCheckersExtension.kt b/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/fir/diagnostics/RouteBindingFirAdditionalCheckersExtension.kt index 0d97880f..5c3131a3 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/fir/diagnostics/RouteBindingFirAdditionalCheckersExtension.kt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/fir/diagnostics/RouteBindingFirAdditionalCheckersExtension.kt @@ -2,14 +2,14 @@ package io.github.reactivecircus.routebinding.compiler.fir.diagnostics import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.analysis.checkers.declaration.DeclarationCheckers -import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirSimpleFunctionChecker +import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirNamedFunctionChecker import org.jetbrains.kotlin.fir.analysis.extensions.FirAdditionalCheckersExtension internal class RouteBindingFirAdditionalCheckersExtension( session: FirSession, ) : FirAdditionalCheckersExtension(session) { override val declarationCheckers: DeclarationCheckers = object : DeclarationCheckers() { - override val simpleFunctionCheckers: Set + override val namedFunctionCheckers: Set get() = setOf(RouteBindingFunctionChecker) } } diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/fir/diagnostics/RouteBindingFunctionChecker.kt b/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/fir/diagnostics/RouteBindingFunctionChecker.kt index 3923596b..0836b25c 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/fir/diagnostics/RouteBindingFunctionChecker.kt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/compiler/fir/diagnostics/RouteBindingFunctionChecker.kt @@ -9,7 +9,7 @@ import org.jetbrains.kotlin.diagnostics.reportOn import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext -import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirSimpleFunctionChecker +import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirNamedFunctionChecker import org.jetbrains.kotlin.fir.declarations.FirFunction import org.jetbrains.kotlin.fir.declarations.FirNamedFunction import org.jetbrains.kotlin.fir.declarations.FirValueParameter @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.fir.types.isSubtypeOf import org.jetbrains.kotlin.fir.types.renderReadable import org.jetbrains.kotlin.name.Name -internal object RouteBindingFunctionChecker : FirSimpleFunctionChecker(MppCheckerKind.Common) { +internal object RouteBindingFunctionChecker : FirNamedFunctionChecker(MppCheckerKind.Common) { context(context: CheckerContext, reporter: DiagnosticReporter) override fun check(declaration: FirNamedFunction) { if (!declaration.hasAnnotation(ClassIds.RouteBinding.Annotation, context.session)) return diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/DuplicateParameterType.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/DuplicateParameterType.diag.txt new file mode 100644 index 00000000..b7c4de28 --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/DuplicateParameterType.diag.txt @@ -0,0 +1,5 @@ +/DuplicateParameterType.kt:13:5: error: `@RouteBinding` function `DuplicateNavKeySubtype` has multiple parameters of type `NavKey`. Only one parameter per supported type is allowed. + +/DuplicateParameterType.kt:22:5: error: `@RouteBinding` function `DuplicateSharedTransitionScope` has multiple parameters of type `SharedTransitionScope`. Only one parameter per supported type is allowed. + +/DuplicateParameterType.kt:31:5: error: `@RouteBinding` function `DuplicateNavBackStack` has multiple parameters of type `NavBackStack`. Only one parameter per supported type is allowed. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/DuplicateParameterType.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/DuplicateParameterType.fir.diag.txt deleted file mode 100644 index 4da5afdb..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/DuplicateParameterType.fir.diag.txt +++ /dev/null @@ -1,5 +0,0 @@ -/DuplicateParameterType.kt:(454,473): error: `@RouteBinding` function `DuplicateNavKeySubtype` has multiple parameters of type `NavKey`. Only one parameter per supported type is allowed. - -/DuplicateParameterType.kt:(694,739): error: `@RouteBinding` function `DuplicateSharedTransitionScope` has multiple parameters of type `SharedTransitionScope`. Only one parameter per supported type is allowed. - -/DuplicateParameterType.kt:(915,947): error: `@RouteBinding` function `DuplicateNavBackStack` has multiple parameters of type `NavBackStack`. Only one parameter per supported type is allowed. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonComposableFunction.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonComposableFunction.diag.txt new file mode 100644 index 00000000..cb6e9922 --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonComposableFunction.diag.txt @@ -0,0 +1 @@ +/NonComposableFunction.kt:5:14: error: `@RouteBinding` function `DummyScreen` must be a `@Composable` function. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonComposableFunction.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonComposableFunction.fir.diag.txt deleted file mode 100644 index 91ff0056..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonComposableFunction.fir.diag.txt +++ /dev/null @@ -1 +0,0 @@ -/NonComposableFunction.kt:(145,156): error: `@RouteBinding` function `DummyScreen` must be a `@Composable` function. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonObjectMetadataProvider.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonObjectMetadataProvider.diag.txt new file mode 100644 index 00000000..98322838 --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonObjectMetadataProvider.diag.txt @@ -0,0 +1,3 @@ +/NonObjectMetadataProvider.kt:10:53: error: `ClassMetadataProvider` is not an object declaration. `metadataProvider` must be an `object` implementing `RouteMetadataProvider`. + +/NonObjectMetadataProvider.kt:15:53: error: `RouteMetadataProvider` is not an object declaration. `metadataProvider` must be an `object` implementing `RouteMetadataProvider`. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonObjectMetadataProvider.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonObjectMetadataProvider.fir.diag.txt deleted file mode 100644 index 012a90e3..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonObjectMetadataProvider.fir.diag.txt +++ /dev/null @@ -1,3 +0,0 @@ -/NonObjectMetadataProvider.kt:(408,436): error: `ClassMetadataProvider` is not an object declaration. `metadataProvider` must be an `object` implementing `RouteMetadataProvider`. - -/NonObjectMetadataProvider.kt:(530,558): error: `RouteMetadataProvider` is not an object declaration. `metadataProvider` must be an `object` implementing `RouteMetadataProvider`. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonTopLevelFunction.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonTopLevelFunction.diag.txt new file mode 100644 index 00000000..f8e140ce --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonTopLevelFunction.diag.txt @@ -0,0 +1 @@ +/NonTopLevelFunction.kt:8:18: error: `@RouteBinding` function `DummyScreen` must be top level function. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonTopLevelFunction.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonTopLevelFunction.fir.diag.txt deleted file mode 100644 index 4c796d4c..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/NonTopLevelFunction.fir.diag.txt +++ /dev/null @@ -1 +0,0 @@ -/NonTopLevelFunction.kt:(230,241): error: `@RouteBinding` function `DummyScreen` must be top level function. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PrivateFunction.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PrivateFunction.diag.txt new file mode 100644 index 00000000..11e566d9 --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PrivateFunction.diag.txt @@ -0,0 +1 @@ +/PrivateFunction.kt:7:1: error: `@RouteBinding` function `DummyScreen` cannot be private. Change the visibility of the function to internal instead. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PrivateFunction.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PrivateFunction.fir.diag.txt deleted file mode 100644 index 4457853a..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PrivateFunction.fir.diag.txt +++ /dev/null @@ -1 +0,0 @@ -/PrivateFunction.kt:(187,194): error: `@RouteBinding` function `DummyScreen` cannot be private. Change the visibility of the function to internal instead. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PublicFunction.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PublicFunction.diag.txt new file mode 100644 index 00000000..c02725c4 --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PublicFunction.diag.txt @@ -0,0 +1 @@ +/PublicFunction.kt:7:1: warning: `@RouteBinding` function `DummyScreen` does not need to be visible to other modules. Consider changing its visibility to internal. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PublicFunction.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PublicFunction.fir.diag.txt deleted file mode 100644 index 7fb089a5..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/PublicFunction.fir.diag.txt +++ /dev/null @@ -1 +0,0 @@ -/PublicFunction.kt:(187,193): warning: `@RouteBinding` function `DummyScreen` does not need to be visible to other modules. Consider changing its visibility to internal. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/RouteParameterTypeMismatch.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/RouteParameterTypeMismatch.diag.txt new file mode 100644 index 00000000..c8899804 --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/RouteParameterTypeMismatch.diag.txt @@ -0,0 +1,5 @@ +/RouteParameterTypeMismatch.kt:19:5: error: Parameter type `AnotherRoute` does not match `@RouteBinding` route type `DummyRoute` in function `MismatchedValueParam`. + +/RouteParameterTypeMismatch.kt:26:9: error: Parameter type `AnotherRoute` does not match `@RouteBinding` route type `DummyRoute` in function `MismatchedContextParam`. + +/RouteParameterTypeMismatch.kt:33:14: error: Parameter type `AnotherRoute` does not match `@RouteBinding` route type `DummyRoute` in function `MismatchedReceiver`. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/RouteParameterTypeMismatch.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/RouteParameterTypeMismatch.fir.diag.txt deleted file mode 100644 index ed038d29..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/RouteParameterTypeMismatch.fir.diag.txt +++ /dev/null @@ -1,5 +0,0 @@ -/RouteParameterTypeMismatch.kt:(465,484): error: Parameter type `AnotherRoute` does not match `@RouteBinding` route type `DummyRoute` in function `MismatchedValueParam`. - -/RouteParameterTypeMismatch.kt:(588,607): error: Parameter type `AnotherRoute` does not match `@RouteBinding` route type `DummyRoute` in function `MismatchedContextParam`. - -/RouteParameterTypeMismatch.kt:(747,759): error: Parameter type `AnotherRoute` does not match `@RouteBinding` route type `DummyRoute` in function `MismatchedReceiver`. diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedContextParameter.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedContextParameter.diag.txt new file mode 100644 index 00000000..f415e1da --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedContextParameter.diag.txt @@ -0,0 +1,4 @@ +/UnsupportedContextParameter.kt:7:55: error: Context parameter `foo` of `@RouteBinding` function `Foo` has unsupported type `String`. Supported types are: + • `SharedTransitionScope` + • `NavBackStack` + • subtype of `NavKey` diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedContextParameter.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedContextParameter.fir.diag.txt deleted file mode 100644 index 2d7feac9..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedContextParameter.fir.diag.txt +++ /dev/null @@ -1,4 +0,0 @@ -/UnsupportedContextParameter.kt:(265,276): error: Context parameter `foo` of `@RouteBinding` function `Foo` has unsupported type `String`. Supported types are: - • `SharedTransitionScope` - • `NavBackStack` - • subtype of `NavKey` diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedReceiverType.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedReceiverType.diag.txt new file mode 100644 index 00000000..88f630dd --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedReceiverType.diag.txt @@ -0,0 +1,4 @@ +/UnsupportedReceiverType.kt:6:14: error: Extension receiver of `@RouteBinding` function `UnsupportedReceiverScreen` has unsupported type `String`. Supported types are: + • `SharedTransitionScope` + • `NavBackStack` + • subtype of `NavKey` diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedReceiverType.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedReceiverType.fir.diag.txt deleted file mode 100644 index 63ad27dd..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedReceiverType.fir.diag.txt +++ /dev/null @@ -1,4 +0,0 @@ -/UnsupportedReceiverType.kt:(168,174): error: Extension receiver of `@RouteBinding` function `UnsupportedReceiverScreen` has unsupported type `String`. Supported types are: - • `SharedTransitionScope` - • `NavBackStack` - • subtype of `NavKey` diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedValueParameter.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedValueParameter.diag.txt new file mode 100644 index 00000000..15cddd03 --- /dev/null +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedValueParameter.diag.txt @@ -0,0 +1,5 @@ +/UnsupportedValueParameter.kt:8:5: error: Parameter `foo` of `@RouteBinding` function `FooScreen` has unsupported type `String`. Supported types are: + • `SharedTransitionScope` + • `NavBackStack` + • subtype of `NavKey` + • anything with a default value diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedValueParameter.fir.diag.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedValueParameter.fir.diag.txt deleted file mode 100644 index f3ee7eb4..00000000 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/diagnostic/UnsupportedValueParameter.fir.diag.txt +++ /dev/null @@ -1,5 +0,0 @@ -/UnsupportedValueParameter.kt:(206,217): error: Parameter `foo` of `@RouteBinding` function `FooScreen` has unsupported type `String`. Supported types are: - • `SharedTransitionScope` - • `NavBackStack` - • subtype of `NavKey` - • anything with a default value diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.fir.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.fir.txt index 7d6954f5..c9d86180 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.fir.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.fir.txt @@ -31,7 +31,7 @@ FILE: /FooScreen_NavEntryInstaller.kt } } -FILE: metro/hints/fooScreen_NavEntryInstallerAppScope.kt +FILE: metro/hints/fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints - @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun dev_zacsweers_metro_AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.fir.kt.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.kt.txt similarity index 89% rename from build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.fir.kt.txt rename to build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.kt.txt index e6fa73ce..83a20e72 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.fir.kt.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/NoReceiverAndParams.kt.txt @@ -56,7 +56,9 @@ class FooScreen_NavEntryInstaller : NavEntryInstaller { @Binds @IntoSet @CallableMetadata(callableName = "bindIntoSetAsNavEntryInstaller", propertyName = "", startOffset = -1, endOffset = -1) - abstract fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller + fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller { + return error(message = "Never called") + } } @@ -94,10 +96,10 @@ fun box(): String { return "OK" } -// FILE: fooScreen_NavEntryInstallerAppScope.kt +// FILE: fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints @Deprecated(message = "This synthesized declaration should not be used directly", level = DeprecationLevel.HIDDEN) -fun AppScope(contributed: FooScreen_NavEntryInstaller) { +fun dev_zacsweers_metro_AppScope(contributed: FooScreen_NavEntryInstaller) { return error(message = "Never called") } diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.fir.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.fir.txt index 60099afb..a0249227 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.fir.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.fir.txt @@ -31,7 +31,7 @@ FILE: /FooScreen_NavEntryInstaller.kt } } -FILE: metro/hints/fooScreen_NavEntryInstallerAppScope.kt +FILE: metro/hints/fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints - @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun dev_zacsweers_metro_AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.fir.kt.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.kt.txt similarity index 90% rename from build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.fir.kt.txt rename to build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.kt.txt index d5350676..67c34142 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.fir.kt.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/Standard.kt.txt @@ -56,7 +56,9 @@ class FooScreen_NavEntryInstaller : NavEntryInstaller { @Binds @IntoSet @CallableMetadata(callableName = "bindIntoSetAsNavEntryInstaller", propertyName = "", startOffset = -1, endOffset = -1) - abstract fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller + fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller { + return error(message = "Never called") + } } @@ -94,10 +96,10 @@ fun box(): String { return "OK" } -// FILE: fooScreen_NavEntryInstallerAppScope.kt +// FILE: fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints @Deprecated(message = "This synthesized declaration should not be used directly", level = DeprecationLevel.HIDDEN) -fun AppScope(contributed: FooScreen_NavEntryInstaller) { +fun dev_zacsweers_metro_AppScope(contributed: FooScreen_NavEntryInstaller) { return error(message = "Never called") } diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.fir.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.fir.txt index 5f7286e4..03590dda 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.fir.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.fir.txt @@ -31,7 +31,7 @@ FILE: /FooScreen_NavEntryInstaller.kt } } -FILE: metro/hints/fooScreen_NavEntryInstallerAppScope.kt +FILE: metro/hints/fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints - @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun dev_zacsweers_metro_AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.fir.kt.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.kt.txt similarity index 89% rename from build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.fir.kt.txt rename to build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.kt.txt index bb703681..e9324f78 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.fir.kt.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithBackStackParamOnly.kt.txt @@ -56,7 +56,9 @@ class FooScreen_NavEntryInstaller : NavEntryInstaller { @Binds @IntoSet @CallableMetadata(callableName = "bindIntoSetAsNavEntryInstaller", propertyName = "", startOffset = -1, endOffset = -1) - abstract fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller + fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller { + return error(message = "Never called") + } } @@ -94,10 +96,10 @@ fun box(): String { return "OK" } -// FILE: fooScreen_NavEntryInstallerAppScope.kt +// FILE: fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints @Deprecated(message = "This synthesized declaration should not be used directly", level = DeprecationLevel.HIDDEN) -fun AppScope(contributed: FooScreen_NavEntryInstaller) { +fun dev_zacsweers_metro_AppScope(contributed: FooScreen_NavEntryInstaller) { return error(message = "Never called") } diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.fir.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.fir.txt index feeb3329..459717c1 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.fir.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.fir.txt @@ -41,7 +41,7 @@ FILE: /FooScreen_NavEntryInstaller.kt } } -FILE: metro/hints/fooScreen_NavEntryInstallerAppScope.kt +FILE: metro/hints/fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints - @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun dev_zacsweers_metro_AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.fir.kt.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.kt.txt similarity index 91% rename from build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.fir.kt.txt rename to build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.kt.txt index 38704a8c..f1c2ff02 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.fir.kt.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithMetadataProvider.kt.txt @@ -56,7 +56,9 @@ class FooScreen_NavEntryInstaller : NavEntryInstaller { @Binds @IntoSet @CallableMetadata(callableName = "bindIntoSetAsNavEntryInstaller", propertyName = "", startOffset = -1, endOffset = -1) - abstract fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller + fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller { + return error(message = "Never called") + } } @@ -107,10 +109,10 @@ fun box(): String { return "OK" } -// FILE: fooScreen_NavEntryInstallerAppScope.kt +// FILE: fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints @Deprecated(message = "This synthesized declaration should not be used directly", level = DeprecationLevel.HIDDEN) -fun AppScope(contributed: FooScreen_NavEntryInstaller) { +fun dev_zacsweers_metro_AppScope(contributed: FooScreen_NavEntryInstaller) { return error(message = "Never called") } diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.fir.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.fir.txt index 8f58edf1..9da502fc 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.fir.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.fir.txt @@ -31,7 +31,7 @@ FILE: /FooScreen_NavEntryInstaller.kt } } -FILE: metro/hints/fooScreen_NavEntryInstallerAppScope.kt +FILE: metro/hints/fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints - @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun dev_zacsweers_metro_AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.fir.kt.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.kt.txt similarity index 90% rename from build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.fir.kt.txt rename to build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.kt.txt index 86730da3..387150ad 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.fir.kt.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithParamWithDefaultValue.kt.txt @@ -56,7 +56,9 @@ class FooScreen_NavEntryInstaller : NavEntryInstaller { @Binds @IntoSet @CallableMetadata(callableName = "bindIntoSetAsNavEntryInstaller", propertyName = "", startOffset = -1, endOffset = -1) - abstract fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller + fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller { + return error(message = "Never called") + } } @@ -94,10 +96,10 @@ fun box(): String { return "OK" } -// FILE: fooScreen_NavEntryInstallerAppScope.kt +// FILE: fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints @Deprecated(message = "This synthesized declaration should not be used directly", level = DeprecationLevel.HIDDEN) -fun AppScope(contributed: FooScreen_NavEntryInstaller) { +fun dev_zacsweers_metro_AppScope(contributed: FooScreen_NavEntryInstaller) { return error(message = "Never called") } diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.fir.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.fir.txt index 81dba387..18646914 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.fir.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.fir.txt @@ -31,7 +31,7 @@ FILE: /FooScreen_NavEntryInstaller.kt } } -FILE: metro/hints/fooScreen_NavEntryInstallerAppScope.kt +FILE: metro/hints/fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints - @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun dev_zacsweers_metro_AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.fir.kt.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.kt.txt similarity index 89% rename from build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.fir.kt.txt rename to build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.kt.txt index fa7c8500..7e68a2b7 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.fir.kt.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithRouteParamOnly.kt.txt @@ -56,7 +56,9 @@ class FooScreen_NavEntryInstaller : NavEntryInstaller { @Binds @IntoSet @CallableMetadata(callableName = "bindIntoSetAsNavEntryInstaller", propertyName = "", startOffset = -1, endOffset = -1) - abstract fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller + fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller { + return error(message = "Never called") + } } @@ -94,10 +96,10 @@ fun box(): String { return "OK" } -// FILE: fooScreen_NavEntryInstallerAppScope.kt +// FILE: fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints @Deprecated(message = "This synthesized declaration should not be used directly", level = DeprecationLevel.HIDDEN) -fun AppScope(contributed: FooScreen_NavEntryInstaller) { +fun dev_zacsweers_metro_AppScope(contributed: FooScreen_NavEntryInstaller) { return error(message = "Never called") } diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.fir.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.fir.txt index 3ca1a3e3..ca55cdce 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.fir.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.fir.txt @@ -32,7 +32,7 @@ FILE: /FooScreen_NavEntryInstaller.kt } } -FILE: metro/hints/fooScreen_NavEntryInstallerAppScope.kt +FILE: metro/hints/fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints - @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun dev_zacsweers_metro_AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.fir.kt.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.kt.txt similarity index 90% rename from build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.fir.kt.txt rename to build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.kt.txt index c7c02dcf..249161c1 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.fir.kt.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsContextParam.kt.txt @@ -56,7 +56,9 @@ class FooScreen_NavEntryInstaller : NavEntryInstaller { @Binds @IntoSet @CallableMetadata(callableName = "bindIntoSetAsNavEntryInstaller", propertyName = "", startOffset = -1, endOffset = -1) - abstract fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller + fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller { + return error(message = "Never called") + } } @@ -95,10 +97,10 @@ fun box(): String { return "OK" } -// FILE: fooScreen_NavEntryInstallerAppScope.kt +// FILE: fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints @Deprecated(message = "This synthesized declaration should not be used directly", level = DeprecationLevel.HIDDEN) -fun AppScope(contributed: FooScreen_NavEntryInstaller) { +fun dev_zacsweers_metro_AppScope(contributed: FooScreen_NavEntryInstaller) { return error(message = "Never called") } diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.fir.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.fir.txt index 95bc17df..7acb41bc 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.fir.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.fir.txt @@ -31,7 +31,7 @@ FILE: /FooScreen_NavEntryInstaller.kt } } -FILE: metro/hints/fooScreen_NavEntryInstallerAppScope.kt +FILE: metro/hints/fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints - @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final fun dev_zacsweers_metro_AppScope(contributed: R|FooScreen_NavEntryInstaller|): R|kotlin/Unit| diff --git a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.fir.kt.txt b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.kt.txt similarity index 90% rename from build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.fir.kt.txt rename to build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.kt.txt index 21a99eb7..a92a0766 100644 --- a/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.fir.kt.txt +++ b/build-logic/routebinding/routebinding-compiler-plugin/src/test/data/dump/WithSharedTransitionScopeAsValueParam.kt.txt @@ -56,7 +56,9 @@ class FooScreen_NavEntryInstaller : NavEntryInstaller { @Binds @IntoSet @CallableMetadata(callableName = "bindIntoSetAsNavEntryInstaller", propertyName = "", startOffset = -1, endOffset = -1) - abstract fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller + fun bindIntoSetAsNavEntryInstaller_intoset(instance: FooScreen_NavEntryInstaller): NavEntryInstaller { + return error(message = "Never called") + } } @@ -94,10 +96,10 @@ fun box(): String { return "OK" } -// FILE: fooScreen_NavEntryInstallerAppScope.kt +// FILE: fooScreen_NavEntryInstallerDev_zacsweers_metro_AppScope.kt package metro.hints @Deprecated(message = "This synthesized declaration should not be used directly", level = DeprecationLevel.HIDDEN) -fun AppScope(contributed: FooScreen_NavEntryInstaller) { +fun dev_zacsweers_metro_AppScope(contributed: FooScreen_NavEntryInstaller) { return error(message = "Never called") } diff --git a/build-logic/routebinding/routebinding-gradle-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/gradle/RouteBindingGradlePlugin.kt b/build-logic/routebinding/routebinding-gradle-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/gradle/RouteBindingGradlePlugin.kt index 8cbcd009..d90202b2 100644 --- a/build-logic/routebinding/routebinding-gradle-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/gradle/RouteBindingGradlePlugin.kt +++ b/build-logic/routebinding/routebinding-gradle-plugin/src/main/kotlin/io/github/reactivecircus/routebinding/gradle/RouteBindingGradlePlugin.kt @@ -53,4 +53,5 @@ public class RouteBindingGradlePlugin : KotlinCompilerPluginSupportPlugin { } private const val RouteBindingCompilerPluginId = "io.github.reactivecircus.routebinding.compiler" +private const val MetroCompilerPluginId = "dev.zacsweers.metro.compiler" private const val ComposeCompilerPluginId = "androidx.compose.compiler.plugins.kotlin" diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts index 01045af0..f6267ca2 100644 --- a/build-logic/settings.gradle.kts +++ b/build-logic/settings.gradle.kts @@ -15,6 +15,12 @@ pluginManagement { } } mavenCentral() + // TODO remove once upgraded to Metro 1.3.0. + maven("https://central.sonatype.com/repository/maven-snapshots/") { + content { + includeGroup("dev.zacsweers.metro") + } + } } val gradleToolchainsResolverVersion = file("../gradle/libs.versions.toml") @@ -40,6 +46,12 @@ dependencyResolutionManagement { } } mavenCentral() + // TODO remove once upgraded to Metro 1.3.0. + maven("https://central.sonatype.com/repository/maven-snapshots/") { + content { + includeGroup("dev.zacsweers.metro") + } + } } versionCatalogs { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ac804f32..fda5ecfd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -kotlin = "2.4.0" +kotlin = "2.4.20-Beta1" androidGradlePlugin = "9.4.0-alpha01" gradle-develocityPlugin = "4.4.0" gradle-toolchainsResolverPlugin = "1.0.0" @@ -17,7 +17,7 @@ detekt = "2.0.0-alpha.5" androidPublisher = "4.0.0" kotlinpoet = "2.3.0" leakcanary = "2.14" -metro = "1.2.1" +metro = "1.3.0-SNAPSHOT" kotlinx-coroutines = "1.11.0" kotlinx-datetime = "0.8.0" kotlinx-serialization = "1.11.0" diff --git a/settings.gradle.kts b/settings.gradle.kts index 04a08700..5961d872 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,6 +17,12 @@ pluginManagement { } } mavenCentral() + // TODO remove once upgraded to Metro 1.3.0. + maven("https://central.sonatype.com/repository/maven-snapshots/") { + content { + includeGroup("dev.zacsweers.metro") + } + } } fun extractVersionFromCatalog(key: String) = file("$rootDir/gradle/libs.versions.toml") @@ -46,6 +52,12 @@ dependencyResolutionManagement { } } mavenCentral() + // TODO remove once upgraded to Metro 1.3.0. + maven("https://central.sonatype.com/repository/maven-snapshots/") { + content { + includeGroup("dev.zacsweers.metro") + } + } } }