Skip to content

Commit 8a34478

Browse files
authored
Remove execution code (moved to apollo-kotlin-execution) (#5992)
1 parent 1ad2c62 commit 8a34478

File tree

9 files changed

+1
-484
lines changed

9 files changed

+1
-484
lines changed

libraries/apollo-compiler/api/apollo-compiler.api

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ public final class com/apollographql/apollo3/compiler/AdapterInitializer$Compani
99
public final class com/apollographql/apollo3/compiler/ApolloCompiler {
1010
public static final field INSTANCE Lcom/apollographql/apollo3/compiler/ApolloCompiler;
1111
public final fun buildCodegenSchema (Ljava/util/List;Lcom/apollographql/apollo3/compiler/ApolloCompiler$Logger;Lcom/apollographql/apollo3/compiler/CodegenSchemaOptions;)Lcom/apollographql/apollo3/compiler/CodegenSchema;
12-
public final fun buildExecutableSchemaSources (Lcom/apollographql/apollo3/compiler/CodegenSchema;Lcom/apollographql/apollo3/compiler/CodegenMetadata;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)Lcom/apollographql/apollo3/compiler/codegen/SourceOutput;
1312
public final fun buildIrOperations (Lcom/apollographql/apollo3/compiler/CodegenSchema;Ljava/util/List;Ljava/util/List;Ljava/util/List;Lcom/apollographql/apollo3/compiler/IrOptions;Lcom/apollographql/apollo3/compiler/DocumentTransform;Lcom/apollographql/apollo3/compiler/ApolloCompiler$Logger;)Lcom/apollographql/apollo3/compiler/ir/IrOperations;
1413
public final fun buildSchemaAndOperationsSources (Ljava/util/List;Ljava/util/List;Lcom/apollographql/apollo3/compiler/CodegenSchemaOptions;Lcom/apollographql/apollo3/compiler/IrOptions;Lcom/apollographql/apollo3/compiler/CodegenOptions;Lcom/apollographql/apollo3/compiler/LayoutFactory;Lcom/apollographql/apollo3/compiler/OperationOutputGenerator;Lcom/apollographql/apollo3/compiler/Transform;Lcom/apollographql/apollo3/compiler/Transform;Lcom/apollographql/apollo3/compiler/Transform;Lcom/apollographql/apollo3/compiler/DocumentTransform;Lcom/apollographql/apollo3/compiler/ApolloCompiler$Logger;Ljava/io/File;)Lcom/apollographql/apollo3/compiler/codegen/SourceOutput;
1514
public final fun buildSchemaAndOperationsSourcesFromIr (Lcom/apollographql/apollo3/compiler/CodegenSchema;Lcom/apollographql/apollo3/compiler/ir/IrOperations;Lcom/apollographql/apollo3/compiler/UsedCoordinates;Ljava/util/List;Lcom/apollographql/apollo3/compiler/CodegenOptions;Lcom/apollographql/apollo3/compiler/codegen/SchemaAndOperationsLayout;Lcom/apollographql/apollo3/compiler/OperationOutputGenerator;Lcom/apollographql/apollo3/compiler/Transform;Lcom/apollographql/apollo3/compiler/Transform;Lcom/apollographql/apollo3/compiler/Transform;Ljava/io/File;)Lcom/apollographql/apollo3/compiler/codegen/SourceOutput;
@@ -463,9 +462,6 @@ public abstract interface class com/apollographql/apollo3/compiler/codegen/Commo
463462
public abstract fun propertyName (Ljava/lang/String;)Ljava/lang/String;
464463
}
465464

466-
public abstract interface class com/apollographql/apollo3/compiler/codegen/ExecutableSchemaLayout : com/apollographql/apollo3/compiler/codegen/SchemaLayout {
467-
}
468-
469465
public final class com/apollographql/apollo3/compiler/codegen/LayoutImplKt {
470466
public static final fun SchemaAndOperationsLayout (Lcom/apollographql/apollo3/compiler/CodegenSchema;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;)Lcom/apollographql/apollo3/compiler/codegen/SchemaAndOperationsLayout;
471467
}

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloCompiler.kt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -514,31 +514,6 @@ object ApolloCompiler {
514514

515515
return sourceOutput
516516
}
517-
518-
fun buildExecutableSchemaSources(
519-
codegenSchema: CodegenSchema,
520-
codegenMetadata: CodegenMetadata,
521-
irTargetObjects: List<IrTargetObject>,
522-
packageName: String,
523-
serviceName: String,
524-
): SourceOutput {
525-
@Suppress("DEPRECATION")
526-
val layout = LayoutImpl(
527-
codegenSchema = codegenSchema,
528-
packageNameGenerator = PackageNameGenerator.Flat(packageName),
529-
useSemanticNaming = null,
530-
decapitalizeFields = null,
531-
generatedSchemaName = null,
532-
)
533-
534-
return KotlinCodegen.buildExecutableSchema(
535-
codegenSchema = codegenSchema,
536-
codegenMetadata = codegenMetadata,
537-
irTargetObjects = irTargetObjects,
538-
layout = layout,
539-
serviceName = serviceName
540-
).toSourceOutput()
541-
}
542517
}
543518

544519
private enum class Severity {

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/LayoutImpl.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal class LayoutImpl(
3333
useSemanticNaming: Boolean?,
3434
decapitalizeFields: Boolean?,
3535
generatedSchemaName: String?
36-
) : SchemaAndOperationsLayout, ExecutableSchemaLayout {
36+
) : SchemaAndOperationsLayout {
3737
private val schemaPackageName = executableDocumentPackageName(codegenSchema.normalizedPath)
3838
private val useSemanticNaming: Boolean = useSemanticNaming ?: defaultUseSemanticNaming
3939
private val decapitalizeFields: Boolean = decapitalizeFields ?: defaultDecapitalizeFields
@@ -161,8 +161,6 @@ internal fun SchemaLayout.schemaSubPackageName() = "${schemaPackageName()}.schem
161161
internal fun SchemaLayout.javaOptionalAdapterClassName() = "OptionalAdapter"
162162
internal fun SchemaLayout.javaOptionalAdaptersClassName() = "OptionalAdapters"
163163

164-
internal fun ExecutableSchemaLayout.executionPackageName() = "${schemaPackageName()}.execution"
165-
166164
internal fun OperationsLayout.operationAdapterPackageName(filePath: String) = "${executableDocumentPackageName(filePath)}.adapter"
167165
internal fun OperationsLayout.operationResponseFieldsPackageName(filePath: String) = "${executableDocumentPackageName(filePath)}.selections"
168166

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/SchemaAndOperationsLayout.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ interface OperationsLayout: CommonLayout {
2020
}
2121

2222
interface SchemaAndOperationsLayout : SchemaLayout, OperationsLayout
23-
interface ExecutableSchemaLayout : SchemaLayout

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinCodegen.kt

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ import com.apollographql.apollo3.compiler.KotlinOperationsCodegenOptions
77
import com.apollographql.apollo3.compiler.KotlinSchemaCodegenOptions
88
import com.apollographql.apollo3.compiler.TargetLanguage
99
import com.apollographql.apollo3.compiler.Transform
10-
import com.apollographql.apollo3.compiler.codegen.ExecutableSchemaLayout
1110
import com.apollographql.apollo3.compiler.codegen.OperationsLayout
1211
import com.apollographql.apollo3.compiler.codegen.ResolverKey
1312
import com.apollographql.apollo3.compiler.codegen.ResolverKeyKind
1413
import com.apollographql.apollo3.compiler.codegen.SchemaLayout
15-
import com.apollographql.apollo3.compiler.codegen.kotlin.executableschema.AdapterRegistryBuilder
16-
import com.apollographql.apollo3.compiler.codegen.kotlin.executableschema.ExecutableSchemaBuilderBuilder
17-
import com.apollographql.apollo3.compiler.codegen.kotlin.executableschema.MainResolverBuilder
1814
import com.apollographql.apollo3.compiler.codegen.kotlin.helpers.addInternal
1915
import com.apollographql.apollo3.compiler.codegen.kotlin.operations.FragmentBuilder
2016
import com.apollographql.apollo3.compiler.codegen.kotlin.operations.FragmentModelsBuilder
@@ -314,55 +310,5 @@ internal object KotlinCodegen {
314310
}
315311
}
316312
}
317-
318-
fun buildExecutableSchema(
319-
codegenSchema: CodegenSchema,
320-
codegenMetadata: CodegenMetadata,
321-
irTargetObjects: List<IrTargetObject>,
322-
layout: ExecutableSchemaLayout,
323-
serviceName: String,
324-
): KotlinOutput {
325-
val targetLanguage = TargetLanguage.KOTLIN_1_9
326-
return buildOutput(
327-
codegenSchema,
328-
listOf(codegenMetadata),
329-
null,
330-
targetLanguage,
331-
null,
332-
true,
333-
) { resolver ->
334-
val context = KotlinExecutableSchemaContext(
335-
generateMethods = emptyList(),
336-
jsExport = false,
337-
layout = layout,
338-
resolver = resolver,
339-
targetLanguage = targetLanguage,
340-
)
341-
342-
val mainResolverBuilder = MainResolverBuilder(
343-
context = context,
344-
serviceName = serviceName,
345-
irTargetObjects = irTargetObjects
346-
)
347-
builders.add(mainResolverBuilder)
348-
349-
val adapterRegistryBuilder = AdapterRegistryBuilder(
350-
context = context,
351-
serviceName = serviceName,
352-
codegenSchema = codegenSchema
353-
)
354-
builders.add(adapterRegistryBuilder)
355-
356-
builders.add(
357-
ExecutableSchemaBuilderBuilder(
358-
context = context,
359-
serviceName = serviceName,
360-
mainResolver = mainResolverBuilder.className,
361-
adapterRegistry = adapterRegistryBuilder.memberName,
362-
irTargetObjects = irTargetObjects
363-
)
364-
)
365-
}
366-
}
367313
}
368314

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinContext.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.apollographql.apollo3.compiler.codegen.kotlin
33
import com.apollographql.apollo3.compiler.GeneratedMethod
44
import com.apollographql.apollo3.compiler.TargetLanguage
55
import com.apollographql.apollo3.compiler.codegen.CommonLayout
6-
import com.apollographql.apollo3.compiler.codegen.ExecutableSchemaLayout
76
import com.apollographql.apollo3.compiler.codegen.OperationsLayout
87
import com.apollographql.apollo3.compiler.codegen.SchemaLayout
98

@@ -34,11 +33,3 @@ internal class KotlinOperationsContext(
3433
override val resolver: KotlinResolver,
3534
override val targetLanguage: TargetLanguage,
3635
): KotlinContext
37-
38-
internal class KotlinExecutableSchemaContext(
39-
override val layout: ExecutableSchemaLayout,
40-
override val generateMethods: List<GeneratedMethod>,
41-
override val jsExport: Boolean,
42-
override val resolver: KotlinResolver,
43-
override val targetLanguage: TargetLanguage,
44-
): KotlinContext

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/executableschema/AdapterRegistryBuilder.kt

Lines changed: 0 additions & 84 deletions
This file was deleted.

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/executableschema/ExecutableSchemaBuilderBuilder.kt

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)