diff --git a/libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/entrypoints.kt b/libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/entrypoints.kt index 4c279034daa..7ca8a550623 100644 --- a/libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/entrypoints.kt +++ b/libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/entrypoints.kt @@ -5,15 +5,12 @@ import com.apollographql.apollo.compiler.codegen.SchemaAndOperationsLayout import com.apollographql.apollo.compiler.codegen.writeTo import com.apollographql.apollo.compiler.internal.DefaultApolloCompilerRegistry import com.apollographql.apollo.compiler.internal.GradleCompilerPluginLogger -import com.apollographql.apollo.compiler.operationoutput.OperationDescriptor -import com.apollographql.apollo.compiler.operationoutput.OperationId -import com.apollographql.apollo.compiler.operationoutput.OperationOutput import java.io.File import java.util.ServiceLoader import java.util.function.Consumer /** - * EntryPoints contains code that is called using reflection from the Gradle plugin. + * EntryPoints contains code called using reflection from the Gradle plugin. * This is so that the classloader can be isolated, and we can use our preferred version of * Kotlin and other dependencies without risking conflicts. * @@ -160,22 +157,6 @@ class EntryPoints { } } -@Suppress("DEPRECATION") -internal fun ApolloCompilerPlugin.toOperationOutputGenerator(): OperationOutputGenerator { - return object : OperationOutputGenerator { - override fun generate(operationDescriptorList: Collection): OperationOutput { - var operationIds = operationIds(operationDescriptorList.toList()) - if (operationIds == null) { - operationIds = operationDescriptorList.map { OperationId(OperationIdGenerator.Sha256.apply(it.source, it.name), it.name) } - } - return operationDescriptorList.associateBy { descriptor -> - val operationId = operationIds.firstOrNull { it.name == descriptor.name } ?: error("No id found for operation ${descriptor.name}") - operationId.id - } - } - } -} - internal fun Consumer.toLogger(): ApolloCompiler.Logger { return object : ApolloCompiler.Logger { override fun warning(message: String) { diff --git a/libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/internal/legacy.kt b/libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/internal/legacy.kt index 8875c1c88c1..aa650a5bcfd 100644 --- a/libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/internal/legacy.kt +++ b/libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/internal/legacy.kt @@ -13,7 +13,7 @@ import com.apollographql.apollo.compiler.operationoutput.OperationId internal class LegacyOperationIdsGenerator(private val plugin: ApolloCompilerPlugin) : OperationIdsGenerator { override fun generate(operationDescriptors: List): List { @Suppress("DEPRECATION") - val operationIds = plugin.operationIds(operationDescriptors.toList()) + val operationIds = plugin.operationIds(operationDescriptors) if (operationIds != null) { println("Apollo: using ApolloCompiler.operationIds() is deprecated. Please use registry.registerOperationIdsGenerator() from beforeCompilationStep() instead.") return operationIds