Simplify nano flag to codegen to just 'nano' from 'nano=true'

'nano=true' still works, but any value is now ignored. This is to align
with our lite flag, but also just because It's Cleaner.

Note that this is counter to what javanano does. Javanano requires all
flags have a value and uses true/false for many values.
This commit is contained in:
Eric Anderson 2016-03-29 16:16:21 -07:00
parent 877e1e11eb
commit 0a01b3cf42
5 changed files with 5 additions and 5 deletions

View File

@ -47,7 +47,7 @@ protobuf {
task.plugins {
grpc {
// Options added to --grpc_out
option 'nano=true'
option 'nano'
}
}
}

View File

@ -40,7 +40,7 @@ $ protoc --plugin=protoc-gen-grpc-java=build/binaries/java_pluginExecutable/prot
To generate Java interfaces with protobuf nano:
```
$ protoc --plugin=protoc-gen-grpc-java=build/binaries/java_pluginExecutable/protoc-gen-grpc-java \
--grpc-java_out=nano=true:"$OUTPUT_FILE" --proto_path="$DIR_OF_PROTO_FILE" "$PROTO_FILE"
--grpc-java_out=nano:"$OUTPUT_FILE" --proto_path="$DIR_OF_PROTO_FILE" "$PROTO_FILE"
```
## Installing the codegen to Maven local repository

View File

@ -168,7 +168,7 @@ protobuf {
}
task.plugins {
grpc {
option 'nano=true'
option 'nano'
}
}
}

View File

@ -38,7 +38,7 @@ class JavaGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
java_grpc_generator::ProtoFlavor flavor =
java_grpc_generator::ProtoFlavor::NORMAL;
for (int i = 0; i < options.size(); i++) {
if (options[i].first == "nano" && options[i].second == "true") {
if (options[i].first == "nano") {
flavor = java_grpc_generator::ProtoFlavor::NANO;
} else if (options[i].first == "lite") {
flavor = java_grpc_generator::ProtoFlavor::LITE;

View File

@ -46,7 +46,7 @@ protobuf {
task.plugins {
grpc {
// Options added to --grpc_out
option 'nano=true'
option 'nano'
}
}
}