Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3486)

Unified Diff: build/config/mac/gen_plist.py

Issue 1916713005: [Mac/GN] Allow the info_plist template caller to specify the plist format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-split-rules
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/mac/base_rules.gni ('k') | build/config/mac/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/mac/gen_plist.py
diff --git a/build/config/mac/gen_plist.py b/build/config/mac/gen_plist.py
index cca2ba49d8ecefb06de48b4f257462ef0b4b6aa1..e3d4f4af4804c870a07fb5cb68789f22776ecbd1 100644
--- a/build/config/mac/gen_plist.py
+++ b/build/config/mac/gen_plist.py
@@ -138,13 +138,13 @@ def LoadPList(path):
os.unlink(name)
-def SavePList(path, data):
- """Saves |data| as a Plist to |path| in binary1 format."""
+def SavePList(path, format, data):
+ """Saves |data| as a Plist to |path| in the specified |format|."""
fd, name = tempfile.mkstemp()
try:
with os.fdopen(fd, 'w') as f:
plistlib.writePlist(data, f)
- subprocess.check_call(['plutil', '-convert', 'binary1', '-o', path, name])
+ subprocess.check_call(['plutil', '-convert', format, '-o', path, name])
finally:
os.unlink(name)
@@ -190,6 +190,8 @@ def main():
help='Path to output plist file.')
parser.add_argument('-s', '--subst', action='append', default=[],
help='Substitution rule in the format "key=value".')
+ parser.add_argument('-f', '--format', required=True,
+ help='Plist format (e.g. binary1, xml1) to output.')
parser.add_argument('path', nargs="+", help='Path to input plist files.')
args = parser.parse_args()
substitutions = {}
@@ -200,7 +202,7 @@ def main():
for filename in args.path:
data = MergePList(data, LoadPList(filename))
data = Interpolate(data, substitutions)
- SavePList(args.output, data)
+ SavePList(args.output, args.format, data)
return 0
if __name__ == '__main__':
« no previous file with comments | « build/config/mac/base_rules.gni ('k') | build/config/mac/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698