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

Unified Diff: build/android/gyp/rewrite_deconstruct_manifest.py

Issue 949803002: Deconstructed APK prototyping Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/android/gyp/deconstruct_apk.py ('k') | build/android/gyp/util/build_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/rewrite_deconstruct_manifest.py
diff --git a/build/android/gyp/rewrite_deconstruct_manifest.py b/build/android/gyp/rewrite_deconstruct_manifest.py
new file mode 100644
index 0000000000000000000000000000000000000000..fed0181965c22d95f8af0eb5456d9d22cbb0f08f
--- /dev/null
+++ b/build/android/gyp/rewrite_deconstruct_manifest.py
@@ -0,0 +1,44 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import argparse
+import os
+import re
+import shutil
+import sys
+import xml.etree.ElementTree
+
+from xml.dom import minidom
+
+from util import build_utils
+
+DECONSTRUCTED_APPLICATION = 'org.chromium.deconstructed.DeconstructedApplication'
+
+def main(args):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--in-manifest')
+ parser.add_argument('--out-manifest')
+ parser.add_argument('--out-data')
+ options = parser.parse_args(args)
+
+ manifest_xml = xml.etree.ElementTree.parse(options.in_manifest)
+ manifest = manifest_xml.getroot()
+ app_list = manifest.findall('application')
+ if len(app_list) != 1:
+ return 1
+ app_node = app_list[0]
+
+ name_key = '{http://schemas.android.com/apk/res/android}name'
+ old_application = app_node.get(name_key)
+ app_node.set(name_key, DECONSTRUCTED_APPLICATION)
+ package = manifest.get('package')
+
+ manifest_xml.write(options.out_manifest)
+ with open(options.out_data, 'w') as outfile:
+ outfile.write('\n'.join([package, old_application]))
+
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
+
« no previous file with comments | « build/android/gyp/deconstruct_apk.py ('k') | build/android/gyp/util/build_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698