Skip to content

Commit

Permalink
0.7.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangkun83 committed Aug 13, 2015
1 parent f95985e commit f040644
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ 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 {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.6.1'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.0'
}
}
```
Expand All @@ -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'
}
}
```
Expand All @@ -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'
}
}
```
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
3 changes: 2 additions & 1 deletion testProject/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ protobuf {
task.plugins {
grpc {
option 'nano=true'
outputSubDir = 'grpcjavanano'
}
}
task.generateDescriptorSet = true
Expand Down Expand Up @@ -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 ->
Expand Down

0 comments on commit f040644

Please sign in to comment.