File tree Expand file tree Collapse file tree 2 files changed +4
-15
lines changed
gradle-plugin/src/main/kotlin/kotlinx/rpc Expand file tree Collapse file tree 2 files changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ internal open class DefaultGrpcExtension @Inject constructor(
5959
6060 createDefaultProtocPlugins()
6161
62- project.configureProtoExtensions { _, protoSourceSet ->
62+ project.protoSourceSets.forEach { protoSourceSet ->
6363 protoSourceSet.protocPlugin(protocPlugins.protobufJava)
6464 protoSourceSet.protocPlugin(protocPlugins.grpcJava)
6565 protoSourceSet.protocPlugin(protocPlugins.grpcKotlin)
@@ -310,7 +310,7 @@ internal open class DefaultGrpcExtension @Inject constructor(
310310 }
311311
312312 name.lowercase().endsWith(" test" ) -> {
313- project.protoSourceSets.getByName (correspondingMainName()) as DefaultProtoSourceSet
313+ project.protoSourceSets.findByName (correspondingMainName()) as ? DefaultProtoSourceSet
314314 }
315315
316316 else -> {
Original file line number Diff line number Diff line change @@ -62,12 +62,7 @@ internal open class DefaultProtoSourceSet @Inject constructor(
6262 }
6363}
6464
65- internal fun Project.configureProtoExtensions (
66- configure : Project .(
67- languageSourceSet: Any ,
68- protoSourceSet: DefaultProtoSourceSet ,
69- ) -> Unit
70- ) {
65+ internal fun Project.createProtoExtensions () {
7166 fun findOrCreateAndConfigure (languageSourceSetName : String , languageSourceSet : Any ) {
7267 val container = project.findOrCreate(PROTO_SOURCE_SETS ) {
7368 val container = objects.domainObjectContainer(
@@ -82,7 +77,7 @@ internal fun Project.configureProtoExtensions(
8277
8378 val protoSourceSet = container.maybeCreate(languageSourceSetName) as DefaultProtoSourceSet
8479
85- configure (languageSourceSet, protoSourceSet )
80+ protoSourceSet.languageSourceSets.add (languageSourceSet)
8681 }
8782
8883 project.withKotlinJvmExtension {
@@ -110,12 +105,6 @@ internal fun Project.configureProtoExtensions(
110105 }
111106}
112107
113- internal fun Project.createProtoExtensions () {
114- configureProtoExtensions { languageSourceSet, sourceSet ->
115- sourceSet.initExtension(languageSourceSet)
116- }
117- }
118-
119108private fun DefaultProtoSourceSet.initExtension (languageSourceSet : Any ) {
120109 this .languageSourceSets.add(languageSourceSet)
121110}
You can’t perform that action at this time.
0 commit comments