From 37069e06f3910fad1312879e7d66170374489a9e Mon Sep 17 00:00:00 2001 From: rougsig Date: Sun, 21 Aug 2022 14:36:22 +0300 Subject: [PATCH 1/2] Add generated proto sources to source set Before this change generated proto sources was injected directly to compile tasks --- .../groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy b/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy index b04d12e6..de8da9e7 100644 --- a/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy +++ b/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy @@ -252,6 +252,8 @@ class ProtobufPlugin implements Plugin { generateProtoTask.doneInitializing() generateProtoTask.builtins.maybeCreate("java") + sourceSet.java.source(generateProtoTask.getOutputSourceDirectorySet()) + setupExtractProtosTask(generateProtoTask, sourceSet.name) setupExtractIncludeProtosTask(generateProtoTask, sourceSet.name) @@ -262,10 +264,6 @@ class ProtobufPlugin implements Plugin { processResourcesTask.from(generateProtoTask.sourceDirs) { CopySpec it -> it.include '**/*.proto' } - - SUPPORTED_LANGUAGES.each { String lang -> - linkGenerateProtoTasksToTaskName(sourceSet.getCompileTaskName(lang), generateProtoTask) - } } /** From b6808f33e8e159782ff307655db28e25dd08dd22 Mon Sep 17 00:00:00 2001 From: rougsig Date: Mon, 29 Aug 2022 01:32:31 +0300 Subject: [PATCH 2/2] Fix codenarc issues --- .../groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy b/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy index de8da9e7..a9efdcae 100644 --- a/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy +++ b/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy @@ -68,11 +68,6 @@ class ProtobufPlugin implements Plugin { 'android-library', ] - private static final List SUPPORTED_LANGUAGES = [ - 'java', - 'kotlin', - ] - private Project project private ProtobufExtension protobufExtension private boolean wasApplied = false