Skip to content
This repository has been archived by the owner on Jan 26, 2018. It is now read-only.

Commit

Permalink
Only build common protos with --grpc option for LRO.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian J. Watson committed Sep 7, 2016
1 parent 5a4b086 commit 1755918
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/common_protos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ packages:
version: ''

# semver is the semantic version of the common protos package.
semver: 1.3.2
semver: 1.3.3
2 changes: 1 addition & 1 deletion config/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protobuf:

googleapis_common_protos:
python:
version: '1.3.2'
version: '1.3.3'
ruby:
version: '1.2.0'

Expand Down
16 changes: 11 additions & 5 deletions lib/api_repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ var DEFAULT_PROTO_COMPILER = 'protoc';
// Python builds using grpcio-tools.
var NO_PROTOC_PLUGIN = ['nodejs', 'java', 'python'];

// common protos for which we build gRPC service methods
var COMMON_GRPC_PROTOS = ['operations.proto'];

// the default include path, where install the protobuf runtime installs its
// protos.
var DEFAULT_INCLUDE_PATH = Object.freeze(['/usr/local/include']);
Expand Down Expand Up @@ -1018,11 +1021,14 @@ ApiRepo.prototype._makeProtocFunc = function _makeProtocFunc(opts, language) {
pluginOption = '--plugin=';
} else {
args.push('--' + language + '_out=' + outDir);
if (language === 'python') {
// required per https://github.com/grpc/grpc/issues/7857
args.push('--grpc_python_out=' + outDir);
} else {
args.push('--grpc_out=' + outDir);
if (!opts.buildCommonProtos ||
_.includes(COMMON_GRPC_PROTOS, protoPath)) {
if (language === 'python') {
// required per https://github.com/grpc/grpc/issues/7857
args.push('--grpc_python_out=' + outDir);
} else {
args.push('--grpc_out=' + outDir);
}
}
}
if (!_.includes(NO_PROTOC_PLUGIN, language)) {
Expand Down

0 comments on commit 1755918

Please sign in to comment.