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

Side by Side Diff: build/android/gyp/find_sun_tools_jar.py

Issue 2336173003: Fix android depfiles to always list GN's outputs[0] (Closed)
Patch Set: fix cronet_package Created 4 years, 3 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 | « build/android/gyp/emma_instr.py ('k') | build/android/gyp/gcc_preprocess.py » ('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 """This finds the java distribution's tools.jar and copies it somewhere. 7 """This finds the java distribution's tools.jar and copies it somewhere.
8 """ 8 """
9 9
10 import argparse 10 import argparse
(...skipping 17 matching lines...) Expand all
28 sun_tools_jar_path = FindSunToolsJarPath() 28 sun_tools_jar_path = FindSunToolsJarPath()
29 29
30 if sun_tools_jar_path is None: 30 if sun_tools_jar_path is None:
31 raise Exception("Couldn\'t find tools.jar") 31 raise Exception("Couldn\'t find tools.jar")
32 32
33 # Using copyfile instead of copy() because copy() calls copymode() 33 # Using copyfile instead of copy() because copy() calls copymode()
34 # We don't want the locked mode because we may copy over this file again 34 # We don't want the locked mode because we may copy over this file again
35 shutil.copyfile(sun_tools_jar_path, args.output) 35 shutil.copyfile(sun_tools_jar_path, args.output)
36 36
37 if args.depfile: 37 if args.depfile:
38 build_utils.WriteDepfile( 38 build_utils.WriteDepfile(args.depfile, args.output, [sun_tools_jar_path])
39 args.depfile,
40 [sun_tools_jar_path] + build_utils.GetPythonDependencies())
41 39
42 40
43 def FindSunToolsJarPath(): 41 def FindSunToolsJarPath():
44 # This works with at least openjdk 1.6, 1.7 and sun java 1.6, 1.7 42 # This works with at least openjdk 1.6, 1.7 and sun java 1.6, 1.7
45 stdout = build_utils.CheckOutput( 43 stdout = build_utils.CheckOutput(
46 ["java", "-verbose", "-version"], print_stderr=False) 44 ["java", "-verbose", "-version"], print_stderr=False)
47 for ln in stdout.splitlines(): 45 for ln in stdout.splitlines():
48 match = RT_JAR_FINDER.match(ln) 46 match = RT_JAR_FINDER.match(ln)
49 if match: 47 if match:
50 return os.path.join(match.group(1), 'lib', 'tools.jar') 48 return os.path.join(match.group(1), 'lib', 'tools.jar')
51 49
52 return None 50 return None
53 51
54 52
55 if __name__ == '__main__': 53 if __name__ == '__main__':
56 sys.exit(main()) 54 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/gyp/emma_instr.py ('k') | build/android/gyp/gcc_preprocess.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698