| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 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 """Writes dependency ordered list of native libraries. | 7 """Writes dependency ordered list of native libraries. |
| 8 | 8 |
| 9 The list excludes any Android system libraries, as those are not bundled with | 9 The list excludes any Android system libraries, as those are not bundled with |
| 10 the APK. | 10 the APK. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 else: | 89 else: |
| 90 assert len(binaries) == 1 | 90 assert len(binaries) == 1 |
| 91 all_deps = GetDependencies(binaries[0]) | 91 all_deps = GetDependencies(binaries[0]) |
| 92 libraries = [lib for lib in all_deps if not IsSystemLibrary(lib)] | 92 libraries = [lib for lib in all_deps if not IsSystemLibrary(lib)] |
| 93 | 93 |
| 94 return GetSortedTransitiveDependencies(libraries) | 94 return GetSortedTransitiveDependencies(libraries) |
| 95 | 95 |
| 96 | 96 |
| 97 def main(): | 97 def main(): |
| 98 parser = optparse.OptionParser() | 98 parser = optparse.OptionParser() |
| 99 build_utils.AddDepfileOption(parser) |
| 99 | 100 |
| 100 parser.add_option('--input-libraries', | 101 parser.add_option('--input-libraries', |
| 101 help='A list of top-level input libraries.') | 102 help='A list of top-level input libraries.') |
| 102 parser.add_option('--libraries-dir', | 103 parser.add_option('--libraries-dir', |
| 103 help='The directory which contains shared libraries.') | 104 help='The directory which contains shared libraries.') |
| 104 parser.add_option('--readelf', help='Path to the readelf binary.') | 105 parser.add_option('--readelf', help='Path to the readelf binary.') |
| 105 parser.add_option('--output', help='Path to the generated .json file.') | 106 parser.add_option('--output', help='Path to the generated .json file.') |
| 106 parser.add_option('--stamp', help='Path to touch on success.') | 107 parser.add_option('--stamp', help='Path to touch on success.') |
| 107 | 108 |
| 108 options, _ = parser.parse_args() | 109 options, _ = parser.parse_args() |
| (...skipping 10 matching lines...) Expand all Loading... |
| 119 '{%s}' % ','.join(['"%s"' % s[3:-3] for s in libraries])) | 120 '{%s}' % ','.join(['"%s"' % s[3:-3] for s in libraries])) |
| 120 | 121 |
| 121 build_utils.WriteJson( | 122 build_utils.WriteJson( |
| 122 {'libraries': libraries, 'java_libraries_list': java_libraries_list}, | 123 {'libraries': libraries, 'java_libraries_list': java_libraries_list}, |
| 123 options.output, | 124 options.output, |
| 124 only_if_changed=True) | 125 only_if_changed=True) |
| 125 | 126 |
| 126 if options.stamp: | 127 if options.stamp: |
| 127 build_utils.Touch(options.stamp) | 128 build_utils.Touch(options.stamp) |
| 128 | 129 |
| 130 if options.depfile: |
| 131 print libraries |
| 132 build_utils.WriteDepfile( |
| 133 options.depfile, |
| 134 libraries + build_utils.GetPythonDependencies()) |
| 135 |
| 129 | 136 |
| 130 if __name__ == '__main__': | 137 if __name__ == '__main__': |
| 131 sys.exit(main()) | 138 sys.exit(main()) |
| 132 | 139 |
| 133 | 140 |
| OLD | NEW |