Index: components/cronet/tools/jar_src.py |
diff --git a/components/cronet/tools/jar_src.py b/components/cronet/tools/jar_src.py |
index 0cda4a894d8b8f25ebceb36cff9412cf589ad710..2b941d59e9837809989929ab90ac2340d6c5df22 100755 |
--- a/components/cronet/tools/jar_src.py |
+++ b/components/cronet/tools/jar_src.py |
@@ -32,6 +32,7 @@ def JarSources(src_dir, jar_path): |
def main(): |
parser = optparse.OptionParser() |
+ build_utils.AddDepfileOption(parser) |
parser.add_option('--src-dir', action="append", |
help='Directory containing .java files.') |
parser.add_option('--jar-path', help='Jar output path.') |
@@ -39,13 +40,24 @@ def main(): |
options, _ = parser.parse_args() |
+ src_dirs = [] |
for src_dir in options.src_dir: |
+ src_dirs.extend(build_utils.ParseGypList(src_dir)) |
+ |
+ for src_dir in src_dirs: |
JarSources(src_dir, options.jar_path) |
+ if options.depfile: |
+ input_paths = [] |
+ for src_dir in src_dirs: |
+ for root, _, filenames in os.walk(src_dir): |
+ input_paths.extend(os.path.join(root, f) for f in filenames) |
+ build_utils.WriteDepfile(options.depfile, |
+ input_paths + build_utils.GetPythonDependencies()) |
+ |
if options.stamp: |
build_utils.Touch(options.stamp) |
- |
if __name__ == '__main__': |
sys.exit(main()) |