Skip to content

Commit 5728c76

Browse files
authored
Simplify task wiring (#6562)
1 parent d4e166d commit 5728c76

File tree

1 file changed

+1
-15
lines changed
  • libraries/apollo-gradle-plugin-external/src/main/kotlin/com/apollographql/apollo/gradle/internal

1 file changed

+1
-15
lines changed

libraries/apollo-gradle-plugin-external/src/main/kotlin/com/apollographql/apollo/gradle/internal/AndroidPluginFacade.kt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,29 +70,15 @@ private fun Project.getTestVariants(): NamedDomainObjectContainer<BaseVariant> {
7070
return container
7171
}
7272

73-
7473
fun connectToAndroidSourceSet(
7574
project: Project,
7675
sourceSetName: String,
7776
outputDir: Provider<Directory>,
7877
taskProvider: TaskProvider<out Task>,
7978
) {
80-
val kotlinSourceSet = project.kotlinProjectExtension?.sourceSets?.getByName(sourceSetName)?.kotlin
81-
if (kotlinSourceSet != null) {
82-
kotlinSourceSet.srcDir(outputDir)
83-
}
84-
8579
project.getMainVariants().configureEach {
8680
if (it.sourceSets.any { it.name == sourceSetName }) {
87-
if (kotlinSourceSet == null) {
88-
it.registerJavaGeneratingTask(taskProvider, outputDir.get().asFile)
89-
} else {
90-
// The kotlinSourceSet carries task dependencies, calling srcDir() above is enough
91-
// to setup task dependencies
92-
// addJavaSourceFoldersToModel is still required for AS to see the sources
93-
// See https://github.com/apollographql/apollo-kotlin/issues/3351
94-
it.addJavaSourceFoldersToModel(outputDir.get().asFile)
95-
}
81+
it.registerJavaGeneratingTask(taskProvider, outputDir.get().asFile)
9682
}
9783
}
9884
}

0 commit comments

Comments
 (0)