From f0406445d631f24f7c0171c8664ebc430146a582 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Thu, 13 Aug 2015 14:15:10 -0700 Subject: [PATCH] 0.7.0 release --- README.md | 27 +++++++++++++++++++++++---- build.gradle | 2 +- testProject/build.gradle | 3 ++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ea8be1fc..6f02bc88 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ For more information about the Protobuf Compiler, please refer to [Google Developers Site](https://developers.google.com/protocol-buffers/docs/reference/java-generated?csw=1). ## Latest Version -The latest version is ``0.6.1``. It is available on Maven Central. To add +The latest version is ``0.7.0``. It is available on Maven Central. To add dependency to it: ```gradle buildscript { @@ -19,7 +19,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.6.1' + classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.0' } } ``` @@ -33,7 +33,7 @@ buildscript { } } dependencies { - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.6.2-SNAPSHOT' + classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.1-SNAPSHOT' } } ``` @@ -47,7 +47,7 @@ buildscript { mavenLocal() } dependencies { - classpath 'com.google.protobuf:protobuf-gradle-plugin:0.6.1-SNAPSHOT' + classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.1-SNAPSHOT' } } ``` @@ -311,6 +311,8 @@ The task also provides following options: } ``` +#### Change where the generated files are + By default generated Java files are under ``$generatedFilesBaseDir/$sourceSet/$builtinPluginName``, where ``$generatedFilesBaseDir`` is ``$buildDir/generated/source/proto`` by default, @@ -323,6 +325,23 @@ protobuf { } ``` +The subdirectory name, which is by default ``$builtinPluginName``, can also be +changed by setting the ``outputSubDir`` property in the ``builtins`` or +``plugins`` block of a task configuration within ``generateProtoTasks`` block +(see previous section). E.g., + +```gradle +{ task -> + task.plugins { + grpc { + // Write the generated files under + // "$generatedFilesBaseDir/$sourceSet/grpcjava" + outputSubDir = 'grpcjava' + } + } +} +``` + ### Protos in dependencies If a Java project contains proto files, they will be packaged in the jar files diff --git a/build.gradle b/build.gradle index c1668887..6fc915b4 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ apply plugin: "com.gradle.plugin-publish" apply plugin: 'signing' group = 'com.google.protobuf' -version = '0.6.2-SNAPSHOT' +version = '0.7.0' ext.isReleaseVersion = !version.endsWith("SNAPSHOT") diff --git a/testProject/build.gradle b/testProject/build.gradle index 895fe4b8..f4d3f5ab 100644 --- a/testProject/build.gradle +++ b/testProject/build.gradle @@ -79,6 +79,7 @@ protobuf { task.plugins { grpc { option 'nano=true' + outputSubDir = 'grpcjavanano' } } task.generateDescriptorSet = true @@ -122,7 +123,7 @@ test.doLast { assertJavaCompileHasProtoGeneratedDir('test', ['java']) assertJavaCompileHasProtoGeneratedDir('nano', ['javanano']) assertJavaCompileHasProtoGeneratedDir('grpc', ['java', 'grpc']) - assertJavaCompileHasProtoGeneratedDir('grpc_nano', ['javanano', 'grpc']) + assertJavaCompileHasProtoGeneratedDir('grpc_nano', ['javanano', 'grpcjavanano']) // Check generateDescriptorSet option has been honored ['main', 'test', 'nano', 'grpc'].each { sourceSet ->