Skip to content

Commit 0a01b3c

Browse files
committed
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.
1 parent 877e1e1 commit 0a01b3c

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

android-interop-testing/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protobuf {
4747
task.plugins {
4848
grpc {
4949
// Options added to --grpc_out
50-
option 'nano=true'
50+
option 'nano'
5151
}
5252
}
5353
}

compiler/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ $ protoc --plugin=protoc-gen-grpc-java=build/binaries/java_pluginExecutable/prot
4040
To generate Java interfaces with protobuf nano:
4141
```
4242
$ protoc --plugin=protoc-gen-grpc-java=build/binaries/java_pluginExecutable/protoc-gen-grpc-java \
43-
--grpc-java_out=nano=true:"$OUTPUT_FILE" --proto_path="$DIR_OF_PROTO_FILE" "$PROTO_FILE"
43+
--grpc-java_out=nano:"$OUTPUT_FILE" --proto_path="$DIR_OF_PROTO_FILE" "$PROTO_FILE"
4444
```
4545

4646
## Installing the codegen to Maven local repository

compiler/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protobuf {
168168
}
169169
task.plugins {
170170
grpc {
171-
option 'nano=true'
171+
option 'nano'
172172
}
173173
}
174174
}

compiler/src/java_plugin/cpp/java_plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class JavaGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
3838
java_grpc_generator::ProtoFlavor flavor =
3939
java_grpc_generator::ProtoFlavor::NORMAL;
4040
for (int i = 0; i < options.size(); i++) {
41-
if (options[i].first == "nano" && options[i].second == "true") {
41+
if (options[i].first == "nano") {
4242
flavor = java_grpc_generator::ProtoFlavor::NANO;
4343
} else if (options[i].first == "lite") {
4444
flavor = java_grpc_generator::ProtoFlavor::LITE;

examples/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protobuf {
4646
task.plugins {
4747
grpc {
4848
// Options added to --grpc_out
49-
option 'nano=true'
49+
option 'nano'
5050
}
5151
}
5252
}

0 commit comments

Comments
 (0)