Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: components/cronet/tools/jar_src.py

Issue 1553623003: Port cronet_package GYP target to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix issues Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/cronet/tools/generate_javadoc.py ('k') | url/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 fnmatch 7 import fnmatch
8 import optparse 8 import optparse
9 import os 9 import os
10 import sys 10 import sys
(...skipping 14 matching lines...) Expand all
25 if os.path.exists(jar_path): 25 if os.path.exists(jar_path):
26 jar_cmd = ['jar', 'uf', jar_path, '.'] 26 jar_cmd = ['jar', 'uf', jar_path, '.']
27 else: 27 else:
28 jar_cmd = ['jar', 'cf', jar_path, '.'] 28 jar_cmd = ['jar', 'cf', jar_path, '.']
29 29
30 build_utils.CheckOutput(jar_cmd, cwd=jar_cwd) 30 build_utils.CheckOutput(jar_cmd, cwd=jar_cwd)
31 31
32 32
33 def main(): 33 def main():
34 parser = optparse.OptionParser() 34 parser = optparse.OptionParser()
35 build_utils.AddDepfileOption(parser)
35 parser.add_option('--src-dir', action="append", 36 parser.add_option('--src-dir', action="append",
36 help='Directory containing .java files.') 37 help='Directory containing .java files.')
37 parser.add_option('--jar-path', help='Jar output path.') 38 parser.add_option('--jar-path', help='Jar output path.')
38 parser.add_option('--stamp', help='Path to touch on success.') 39 parser.add_option('--stamp', help='Path to touch on success.')
39 40
40 options, _ = parser.parse_args() 41 options, _ = parser.parse_args()
41 42
43 src_dirs = []
42 for src_dir in options.src_dir: 44 for src_dir in options.src_dir:
45 src_dirs.extend(build_utils.ParseGypList(src_dir))
46
47 for src_dir in src_dirs:
43 JarSources(src_dir, options.jar_path) 48 JarSources(src_dir, options.jar_path)
44 49
50 if options.depfile:
51 input_paths = []
52 for src_dir in src_dirs:
53 for root, _, filenames in os.walk(src_dir):
54 input_paths.extend(os.path.join(root, f) for f in filenames)
55 build_utils.WriteDepfile(options.depfile,
56 input_paths + build_utils.GetPythonDependencies())
57
45 if options.stamp: 58 if options.stamp:
46 build_utils.Touch(options.stamp) 59 build_utils.Touch(options.stamp)
47 60
48
49 if __name__ == '__main__': 61 if __name__ == '__main__':
50 sys.exit(main()) 62 sys.exit(main())
51 63
OLDNEW
« no previous file with comments | « components/cronet/tools/generate_javadoc.py ('k') | url/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698