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 import optparse | 7 import optparse |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 import tempfile | 10 import tempfile |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 unzipped_jar_path = tempfile.mkdtemp(dir=os.path.dirname(options.jar_path)) | 56 unzipped_jar_path = tempfile.mkdtemp(dir=os.path.dirname(options.jar_path)) |
57 jar_list = [] | 57 jar_list = [] |
58 for gn_list in options.src_jars: | 58 for gn_list in options.src_jars: |
59 jar_list.extend(build_utils.ParseGnList(gn_list)) | 59 jar_list.extend(build_utils.ParseGnList(gn_list)) |
60 | 60 |
61 for jar in jar_list: | 61 for jar in jar_list: |
62 UnzipSourceJar(jar, unzipped_jar_path) | 62 UnzipSourceJar(jar, unzipped_jar_path) |
63 | 63 |
64 src_dirs = [] | 64 src_dirs = [] |
65 for src_dir in options.src_dir: | 65 for src_dir in options.src_dir: |
66 src_dirs.extend(build_utils.ParseGypList(src_dir)) | 66 src_dirs.extend(build_utils.ParseGnList(src_dir)) |
67 if unzipped_jar_path: | 67 if unzipped_jar_path: |
68 src_dirs += [unzipped_jar_path] | 68 src_dirs += [unzipped_jar_path] |
69 | 69 |
70 for src_dir in src_dirs: | 70 for src_dir in src_dirs: |
71 JarSources(src_dir, options.jar_path) | 71 JarSources(src_dir, options.jar_path) |
72 | 72 |
73 if options.depfile: | 73 if options.depfile: |
74 input_paths = [] | 74 input_paths = [] |
75 for src_dir in src_dirs: | 75 for src_dir in src_dirs: |
76 for root, _, filenames in os.walk(src_dir): | 76 for root, _, filenames in os.walk(src_dir): |
77 input_paths.extend(os.path.join(root, f) for f in filenames) | 77 input_paths.extend(os.path.join(root, f) for f in filenames) |
78 build_utils.WriteDepfile(options.depfile, | 78 build_utils.WriteDepfile(options.depfile, |
79 input_paths + build_utils.GetPythonDependencies()) | 79 input_paths + build_utils.GetPythonDependencies()) |
80 # Clean up temporary output directory. | 80 # Clean up temporary output directory. |
81 if unzipped_jar_path: | 81 if unzipped_jar_path: |
82 build_utils.DeleteDirectory(unzipped_jar_path) | 82 build_utils.DeleteDirectory(unzipped_jar_path) |
83 | 83 |
84 if options.stamp: | 84 if options.stamp: |
85 build_utils.Touch(options.stamp) | 85 build_utils.Touch(options.stamp) |
86 | 86 |
87 if __name__ == '__main__': | 87 if __name__ == '__main__': |
88 sys.exit(main()) | 88 sys.exit(main()) |
89 | 89 |
OLD | NEW |