From fdd803842864ea0e189f63de4542c3290cbd1bf9 Mon Sep 17 00:00:00 2001 From: Himanshu Jaju Date: Thu, 4 Jun 2020 20:19:58 +0100 Subject: [PATCH] Fix oss.py script - Adds newline fix from release branch - Adds transformation for MessageLite from google3 to open source Change-Id: Ie6c3f5263417fbbccc67835eb22fbe568a249125 --- script/oss.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/oss.py b/script/oss.py index bcc1673d..e05dcc1b 100755 --- a/script/oss.py +++ b/script/oss.py @@ -88,6 +88,7 @@ def post_process_oss_files(path, args): else: top_dirs = ["cpp", "proto"] transforms = ( + ("::google3_proto_compat::MessageLite", "::google::protobuf::MessageLite"), ("third_party/webrtc/files/stable/", ""), ("webrtc/files/stable/", ""), ("third_party/", ""), @@ -154,8 +155,9 @@ def post_process_oss_files(path, args): continue if add_proto_lite_runtime and line.startswith("option "): - lines.append("option optimize_for = LITE_RUNTIME;") - modified = True + if not line.startswith("option optimize_for = LITE_RUNTIME"): + lines.append("option optimize_for = LITE_RUNTIME;\n") + modified = True # LITE_RUNTIME should be added only once per file. add_proto_lite_runtime = False