OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 """Creates an AndroidManifest.xml for an APK split. | 6 """Creates an AndroidManifest.xml for an APK split. |
7 | 7 |
8 Given the manifest file for the main APK, generates an AndroidManifest.xml with | 8 Given the manifest file for the main APK, generates an AndroidManifest.xml with |
9 the value required for a Split APK (package, versionCode, etc). | 9 the value required for a Split APK (package, versionCode, etc). |
10 """ | 10 """ |
11 | 11 |
12 import lxml.etree | 12 import lxml.etree |
13 import optparse | 13 import optparse |
14 | 14 |
15 from util import build_utils | 15 from util import build_utils |
16 | 16 |
17 MANIFEST_TEMPLATE = """<?xml version="1.0" encoding="utf-8"?> | 17 MANIFEST_TEMPLATE = """<?xml version="1.0" encoding="utf-8"?> |
18 <manifest | 18 <manifest |
19 xmlns:android="http://schemas.android.com/apk/res/android" | 19 xmlns:android="http://schemas.android.com/apk/res/android" |
20 package="%(package)s" | 20 package="%(package)s" |
21 split="%(split)s"> | 21 split="%(split)s"> |
| 22 <uses-sdk android:minSdkVersion="21" /> |
22 <application android:hasCode="%(has_code)s"> | 23 <application android:hasCode="%(has_code)s"> |
23 </application> | 24 </application> |
24 </manifest> | 25 </manifest> |
25 """ | 26 """ |
26 | 27 |
27 def ParseArgs(): | 28 def ParseArgs(): |
28 """Parses command line options. | 29 """Parses command line options. |
29 | 30 |
30 Returns: | 31 Returns: |
31 An options object as from optparse.OptionsParser.parse_args() | 32 An options object as from optparse.OptionsParser.parse_args() |
(...skipping 55 matching lines...) Loading... |
87 f.write(split_manifest) | 88 f.write(split_manifest) |
88 | 89 |
89 if options.depfile: | 90 if options.depfile: |
90 build_utils.WriteDepfile( | 91 build_utils.WriteDepfile( |
91 options.depfile, | 92 options.depfile, |
92 [main_manifest] + build_utils.GetPythonDependencies()) | 93 [main_manifest] + build_utils.GetPythonDependencies()) |
93 | 94 |
94 | 95 |
95 if __name__ == '__main__': | 96 if __name__ == '__main__': |
96 main() | 97 main() |
OLD | NEW |