diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-06 12:48:11 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:33:43 +0000 |
commit | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (patch) | |
tree | fa14ba0ca8d2683ba2efdabd246dc9b18a1229c6 /chromium/build/protoc_java.py | |
parent | 79b4f909db1049fca459c07cca55af56a9b54fe3 (diff) | |
download | qtwebengine-chromium-7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3.tar.gz |
BASELINE: Update Chromium to 84.0.4147.141
Change-Id: Ib85eb4cfa1cbe2b2b81e5022c8cad5c493969535
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/build/protoc_java.py')
-rwxr-xr-x | chromium/build/protoc_java.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/chromium/build/protoc_java.py b/chromium/build/protoc_java.py index f5db3b83808..62b012e2861 100755 --- a/chromium/build/protoc_java.py +++ b/chromium/build/protoc_java.py @@ -37,6 +37,8 @@ def main(argv): parser.add_option("--stamp", help="File to touch on success.") parser.add_option("--nano", help="Use to generate nano protos.", action='store_true') + parser.add_option("--protoc-javalite-plugin-dir", + help="Path to protoc java lite plugin directory.") parser.add_option("--import-dir", action="append", default=[], help="Extra import directory for protos, can be repeated.") options, args = parser.parse_args(argv) @@ -57,16 +59,26 @@ def main(argv): 'store_unknown_fields=true'] out_arg = '--javanano_out=' + ','.join(generator_args) + ':' + temp_dir else: - out_arg = '--java_out=lite:' + temp_dir + out_arg = '--javalite_out=' + temp_dir + + custom_env = os.environ.copy() + if options.protoc_javalite_plugin_dir: + # If we are generating lite protos, then the lite plugin needs to be in + # the path when protoc is called. See + # https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md + custom_env['PATH'] = '{}:{}'.format( + os.path.abspath(options.protoc_javalite_plugin_dir), + custom_env['PATH']) # Generate Java files using protoc. build_utils.CheckOutput( [options.protoc] + proto_path_args + [out_arg] + args, + env=custom_env, # protoc generates superfluous warnings about LITE_RUNTIME deprecation # even though we are using the new non-deprecated method. - stderr_filter=lambda output: - build_utils.FilterLines(output, - '|'.join([r'optimize_for = LITE_RUNTIME', r'java/lite\.md']))) + stderr_filter=lambda output: build_utils.FilterLines( + output, '|'.join([r'optimize_for = LITE_RUNTIME', r'java/lite\.md']) + )) if options.java_out_dir: build_utils.DeleteDirectory(options.java_out_dir) |