summaryrefslogtreecommitdiff
path: root/chromium/build/protoc_java.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-15 10:20:33 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-15 10:28:57 +0000
commitd17ea114e5ef69ad5d5d7413280a13e6428098aa (patch)
tree2c01a75df69f30d27b1432467cfe7c1467a498da /chromium/build/protoc_java.py
parent8c5c43c7b138c9b4b0bf56d946e61d3bbc111bec (diff)
downloadqtwebengine-chromium-d17ea114e5ef69ad5d5d7413280a13e6428098aa.tar.gz
BASELINE: Update Chromium to 67.0.3396.47
Change-Id: Idcb1341782e417561a2473eeecc82642dafda5b7 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/build/protoc_java.py')
-rwxr-xr-xchromium/build/protoc_java.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/chromium/build/protoc_java.py b/chromium/build/protoc_java.py
index 426d684a1fe..2addb8210fe 100755
--- a/chromium/build/protoc_java.py
+++ b/chromium/build/protoc_java.py
@@ -33,8 +33,8 @@ def main(argv):
help="Path to output directory for java files.")
parser.add_option("--srcjar", help="Path to output srcjar.")
parser.add_option("--stamp", help="File to touch on success.")
- parser.add_option("--lite",
- help="Use to generate lite protos.", action='store_true')
+ parser.add_option("--nano",
+ help="Use to generate nano protos.", action='store_true')
options, args = parser.parse_args(argv)
build_utils.CheckOptions(options, parser, ['protoc', 'proto_path'])
@@ -43,22 +43,25 @@ def main(argv):
return 1
with build_utils.TempDir() as temp_dir:
- if options.lite:
+ if options.nano:
+ # Specify arguments to the generator.
+ generator_args = ['optional_field_style=reftypes',
+ 'store_unknown_fields=true']
+ out_arg = '--javanano_out=' + ','.join(generator_args) + ':' + temp_dir
+ else:
out_arg = '--java_out=' + temp_dir
# Check if all proto files (which are listed in the args) are opting to
# use the lite runtime, otherwise we'd have to include the much heavier
# regular proto runtime in Chrome.
+ # TODO(jkrcal): Replace this check by '--java_lite_out=' for the out_arg
+ # above once this works on the master branch of the protobuf library,
+ # expected in version 4.0 (see https://crbug.com/800281).
for proto_file in args:
if not 'LITE_RUNTIME' in open(proto_file).read():
raise Exception(
'Chrome only supports lite protos. Please add "optimize_for = '
'LITE_RUNTIME" to your proto file to enable the lite runtime.')
- else:
- # Specify arguments to the generator.
- generator_args = ['optional_field_style=reftypes',
- 'store_unknown_fields=true']
- out_arg = '--javanano_out=' + ','.join(generator_args) + ':' + temp_dir
# Generate Java files using protoc.
build_utils.CheckOutput(
[options.protoc, '--proto_path', options.proto_path, out_arg]