Skip to content

Commit f040644

Browse files
committed
0.7.0 release
1 parent f95985e commit f040644

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

README.md

+23-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ For more information about the Protobuf Compiler, please refer to
1111
[Google Developers Site](https://developers.google.com/protocol-buffers/docs/reference/java-generated?csw=1).
1212

1313
## Latest Version
14-
The latest version is ``0.6.1``. It is available on Maven Central. To add
14+
The latest version is ``0.7.0``. It is available on Maven Central. To add
1515
dependency to it:
1616
```gradle
1717
buildscript {
1818
repositories {
1919
mavenCentral()
2020
}
2121
dependencies {
22-
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.6.1'
22+
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.0'
2323
}
2424
}
2525
```
@@ -33,7 +33,7 @@ buildscript {
3333
}
3434
}
3535
dependencies {
36-
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.6.2-SNAPSHOT'
36+
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.1-SNAPSHOT'
3737
}
3838
}
3939
```
@@ -47,7 +47,7 @@ buildscript {
4747
mavenLocal()
4848
}
4949
dependencies {
50-
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.6.1-SNAPSHOT'
50+
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.1-SNAPSHOT'
5151
}
5252
}
5353
```
@@ -311,6 +311,8 @@ The task also provides following options:
311311
}
312312
```
313313

314+
#### Change where the generated files are
315+
314316
By default generated Java files are under
315317
``$generatedFilesBaseDir/$sourceSet/$builtinPluginName``, where
316318
``$generatedFilesBaseDir`` is ``$buildDir/generated/source/proto`` by default,
@@ -323,6 +325,23 @@ protobuf {
323325
}
324326
```
325327

328+
The subdirectory name, which is by default ``$builtinPluginName``, can also be
329+
changed by setting the ``outputSubDir`` property in the ``builtins`` or
330+
``plugins`` block of a task configuration within ``generateProtoTasks`` block
331+
(see previous section). E.g.,
332+
333+
```gradle
334+
{ task ->
335+
task.plugins {
336+
grpc {
337+
// Write the generated files under
338+
// "$generatedFilesBaseDir/$sourceSet/grpcjava"
339+
outputSubDir = 'grpcjava'
340+
}
341+
}
342+
}
343+
```
344+
326345
### Protos in dependencies
327346

328347
If a Java project contains proto files, they will be packaged in the jar files

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ apply plugin: "com.gradle.plugin-publish"
2020
apply plugin: 'signing'
2121

2222
group = 'com.google.protobuf'
23-
version = '0.6.2-SNAPSHOT'
23+
version = '0.7.0'
2424

2525
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
2626

testProject/build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ protobuf {
7979
task.plugins {
8080
grpc {
8181
option 'nano=true'
82+
outputSubDir = 'grpcjavanano'
8283
}
8384
}
8485
task.generateDescriptorSet = true
@@ -122,7 +123,7 @@ test.doLast {
122123
assertJavaCompileHasProtoGeneratedDir('test', ['java'])
123124
assertJavaCompileHasProtoGeneratedDir('nano', ['javanano'])
124125
assertJavaCompileHasProtoGeneratedDir('grpc', ['java', 'grpc'])
125-
assertJavaCompileHasProtoGeneratedDir('grpc_nano', ['javanano', 'grpc'])
126+
assertJavaCompileHasProtoGeneratedDir('grpc_nano', ['javanano', 'grpcjavanano'])
126127

127128
// Check generateDescriptorSet option has been honored
128129
['main', 'test', 'nano', 'grpc'].each { sourceSet ->

0 commit comments

Comments
 (0)