forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These changes let the errorprone compiler find problems when building Android. A global flag disabled Errorprone by default. When enabled, code problems will be shown with suggestions on how to fix them. BUG=485599 Review URL: https://codereview.chromium.org/1136573002 Cr-Commit-Position: refs/heads/master@{#335509}
- Loading branch information
raywilliams
authored and
Commit bot
committed
Jun 22, 2015
1 parent
50f6a89
commit 6ffb117
Showing
17 changed files
with
587 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2014 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("//build/config/android/rules.gni") | ||
|
||
sun_tools_jar_path = "$root_gen_dir/sun_tools_jar/tools.jar" | ||
|
||
action("find_sun_tools_jar") { | ||
script = "//build/android/gyp/find_sun_tools_jar.py" | ||
depfile = "$target_gen_dir/$target_name.d" | ||
outputs = [ | ||
depfile, | ||
sun_tools_jar_path, | ||
] | ||
args = [ | ||
"--depfile", | ||
rebase_path(depfile, root_build_dir), | ||
"--output", | ||
rebase_path(sun_tools_jar_path, root_build_dir), | ||
] | ||
} | ||
|
||
java_prebuilt("sun_tools_java") { | ||
jar_path = sun_tools_jar_path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Copyright 2014 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
"""This finds the java distribution's tools.jar and copies it somewhere. | ||
""" | ||
|
||
import argparse | ||
import os | ||
import re | ||
import shutil | ||
import sys | ||
|
||
from util import build_utils | ||
|
||
RT_JAR_FINDER = re.compile(r'\[Opened (.*)/jre/lib/rt.jar\]') | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Find Sun Tools Jar') | ||
parser.add_argument('--depfile', | ||
help='Path to depfile. This must be specified as the ' | ||
'action\'s first output.') | ||
parser.add_argument('--output', required=True) | ||
args = parser.parse_args() | ||
|
||
sun_tools_jar_path = FindSunToolsJarPath() | ||
|
||
if sun_tools_jar_path is None: | ||
raise Exception("Couldn\'t find tools.jar") | ||
|
||
# Using copyfile instead of copy() because copy() calls copymode() | ||
# We don't want the locked mode because we may copy over this file again | ||
shutil.copyfile(sun_tools_jar_path, args.output) | ||
|
||
if args.depfile: | ||
build_utils.WriteDepfile( | ||
args.depfile, | ||
[sun_tools_jar_path] + build_utils.GetPythonDependencies()) | ||
|
||
|
||
def FindSunToolsJarPath(): | ||
# This works with at least openjdk 1.6, 1.7 and sun java 1.6, 1.7 | ||
stdout = build_utils.CheckOutput( | ||
["java", "-verbose", "-version"], print_stderr=False) | ||
for ln in stdout.splitlines(): | ||
match = RT_JAR_FINDER.match(ln) | ||
if match: | ||
return os.path.join(match.group(1), 'lib', 'tools.jar') | ||
|
||
return None | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.