From 4a1dc745a5d90abfb7d9e31ffbeef0a5ee424495 Mon Sep 17 00:00:00 2001 From: Ethan Hall Date: Tue, 30 Apr 2013 16:33:34 -0500 Subject: [PATCH] Added output dir as an option --- .../gradle/plugins/protobuf/ProtobufConvention.groovy | 5 +++++ .../ws/antonov/gradle/plugins/protobuf/ProtobufPlugin.groovy | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/ws/antonov/gradle/plugins/protobuf/ProtobufConvention.groovy b/src/main/groovy/ws/antonov/gradle/plugins/protobuf/ProtobufConvention.groovy index 13d03c8b..11f47104 100644 --- a/src/main/groovy/ws/antonov/gradle/plugins/protobuf/ProtobufConvention.groovy +++ b/src/main/groovy/ws/antonov/gradle/plugins/protobuf/ProtobufConvention.groovy @@ -12,4 +12,9 @@ class ProtobufConvention { * Directory to extract proto files into */ def String extractedProtosDir + + /** + * Directory to save java files to + */ + def String generatedFileDir } diff --git a/src/main/groovy/ws/antonov/gradle/plugins/protobuf/ProtobufPlugin.groovy b/src/main/groovy/ws/antonov/gradle/plugins/protobuf/ProtobufPlugin.groovy index 97009396..42149e98 100644 --- a/src/main/groovy/ws/antonov/gradle/plugins/protobuf/ProtobufPlugin.groovy +++ b/src/main/groovy/ws/antonov/gradle/plugins/protobuf/ProtobufPlugin.groovy @@ -92,9 +92,10 @@ class ProtobufPlugin implements Plugin { } private getGeneratedSourceDir(Project project, SourceSet sourceSet) { + if(project.generatedFileDir != null) + return project.generatedFileDir + def generatedSourceDir = 'generated-sources' - //if (sourceSet.name != SourceSet.MAIN_SOURCE_SET_NAME) - // generatedSourceDir = "${sourceSet.name}-generated-sources" return "${project.buildDir}/${generatedSourceDir}/${sourceSet.name}" }