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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import argparse
6 import os
7 import re
8 import shutil
9 import sys
10 import xml.etree.ElementTree
11
12 from xml.dom import minidom
13
14 from util import build_utils
15
16 DECONSTRUCTED_APPLICATION = 'org.chromium.deconstructed.DeconstructedApplication '
17
18 def main(args):
19 parser = argparse.ArgumentParser()
20 parser.add_argument('--in-manifest')
21 parser.add_argument('--out-manifest')
22 parser.add_argument('--out-data')
23 options = parser.parse_args(args)
24
25 manifest_xml = xml.etree.ElementTree.parse(options.in_manifest)
26 manifest = manifest_xml.getroot()
27 app_list = manifest.findall('application')
28 if len(app_list) != 1:
29 return 1
30 app_node = app_list[0]
31
32 name_key = '{http://schemas.android.com/apk/res/android}name'
33 old_application = app_node.get(name_key)
34 app_node.set(name_key, DECONSTRUCTED_APPLICATION)
35 package = manifest.get('package')
36
37 manifest_xml.write(options.out_manifest)
38 with open(options.out_data, 'w') as outfile:
39 outfile.write('\n'.join([package, old_application]))
40
41
42 if __name__ == "__main__":
43 main(sys.argv[1:])
44
OLDNEW
« 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