OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 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 | 6 |
7 # pylint: disable=C0301 | 7 # pylint: disable=C0301 |
8 """Package resources into an apk. | 8 """Package resources into an apk. |
9 | 9 |
10 See https://android.googlesource.com/platform/tools/base/+/master/legacy/ant-tas
ks/src/main/java/com/android/ant/AaptExecTask.java | 10 See https://android.googlesource.com/platform/tools/base/+/master/legacy/ant-tas
ks/src/main/java/com/android/ant/AaptExecTask.java |
11 and | 11 and |
12 https://android.googlesource.com/platform/sdk/+/master/files/ant/build.xml | 12 https://android.googlesource.com/platform/sdk/+/master/files/ant/build.xml |
13 """ | 13 """ |
14 # pylint: enable=C0301 | 14 # pylint: enable=C0301 |
15 | 15 |
16 import optparse | 16 import optparse |
17 import os | 17 import os |
18 import shutil | 18 import shutil |
19 | 19 |
20 from util import build_utils | 20 from util import build_utils |
21 | 21 |
22 def ParseArgs(): | 22 def ParseArgs(): |
23 """Parses command line options. | 23 """Parses command line options. |
24 | 24 |
25 Returns: | 25 Returns: |
26 An options object as from optparse.OptionsParser.parse_args() | 26 An options object as from optparse.OptionsParser.parse_args() |
27 """ | 27 """ |
28 parser = optparse.OptionParser() | 28 parser = optparse.OptionParser() |
| 29 build_utils.AddDepfileOption(parser) |
29 parser.add_option('--android-sdk', help='path to the Android SDK folder') | 30 parser.add_option('--android-sdk', help='path to the Android SDK folder') |
30 parser.add_option('--android-sdk-tools', | 31 parser.add_option('--android-sdk-tools', |
31 help='path to the Android SDK build tools folder') | 32 help='path to the Android SDK build tools folder') |
32 | 33 |
33 parser.add_option('--configuration-name', | 34 parser.add_option('--configuration-name', |
34 help='Gyp\'s configuration name (Debug or Release).') | 35 help='Gyp\'s configuration name (Debug or Release).') |
35 | 36 |
36 parser.add_option('--android-manifest', help='AndroidManifest.xml path') | 37 parser.add_option('--android-manifest', help='AndroidManifest.xml path') |
37 parser.add_option('--version-code', help='Version code for apk.') | 38 parser.add_option('--version-code', help='Version code for apk.') |
38 parser.add_option('--version-name', help='Version name for apk.') | 39 parser.add_option('--version-name', help='Version name for apk.') |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 build_utils.ExtractAll(z, path=subdir) | 116 build_utils.ExtractAll(z, path=subdir) |
116 MoveImagesToNonMdpiFolders(subdir) | 117 MoveImagesToNonMdpiFolders(subdir) |
117 package_command += ['-S', subdir] | 118 package_command += ['-S', subdir] |
118 | 119 |
119 if 'Debug' in options.configuration_name: | 120 if 'Debug' in options.configuration_name: |
120 package_command += ['--debug-mode'] | 121 package_command += ['--debug-mode'] |
121 | 122 |
122 build_utils.CheckOutput( | 123 build_utils.CheckOutput( |
123 package_command, print_stdout=False, print_stderr=False) | 124 package_command, print_stdout=False, print_stderr=False) |
124 | 125 |
| 126 if options.depfile: |
| 127 build_utils.WriteDepfile( |
| 128 options.depfile, |
| 129 build_utils.GetPythonDependencies()) |
| 130 |
125 | 131 |
126 if __name__ == '__main__': | 132 if __name__ == '__main__': |
127 main() | 133 main() |
OLD | NEW |