Skip to content

Commit

Permalink
Merge branch 'upstream' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavriloaie Eugen-Andrei committed Apr 17, 2020
2 parents 1a8876c + 212b25d commit 5d9a47b
Show file tree
Hide file tree
Showing 456 changed files with 20,397 additions and 16,755 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ciopfs
/android/bin
/android/binary_size/apks/**/*.apk
/args/chromeos/*.gni
/config/gclient_args.gni
/cros_cache/
/Debug
Expand Down
6 changes: 6 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[style]
based_on_style = pep8

# New directories should use a .style.yapf that does not include the following:
column_limit = 80
indent_width = 2
11 changes: 8 additions & 3 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

import("//build/buildflag_header.gni")
import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.gni")

source_set("buildflag_header_h") {
sources = [
"buildflag.h",
]
sources = [ "buildflag.h" ]
}

buildflag_header("branding_buildflags") {
Expand All @@ -26,3 +25,9 @@ buildflag_header("branding_buildflags") {
]
}
}

buildflag_header("chromecast_buildflags") {
header = "chromecast_buildflags.h"

flags = [ "IS_CHROMECAST=$is_chromecast" ]
}
3 changes: 2 additions & 1 deletion OWNERS
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Expand All @@ -19,6 +18,8 @@ per-file [email protected]
per-file [email protected]
per-file whitespace_file.txt=*
per-file OWNERS.status=*
per-file OWNERS.setnoparent=set noparent
per-file OWNERS.setnoparent=file://ENG_REVIEW_OWNERS

# gn-dev is probably a better team here, but the tooling won't let us
# have more than one team per component, and infra-dev is a catch-all
Expand Down
58 changes: 58 additions & 0 deletions OWNERS.setnoparent
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# List of OWNERS files that can be used together with "set noparent". See
# docs/code_reviews.md#owners-file-details for more details.

# Overall project governance.
file://ENG_REVIEW_OWNERS

# Third-party dependency review, see //docs/adding_to_third_party.md
file://third_party/OWNERS

# Security reviews
file://chromeos/SECURITY_OWNERS
file://content/browser/SITE_ISOLATION_OWNERS
file://fuchsia/SECURITY_OWNERS
file://ipc/SECURITY_OWNERS
file://net/base/SECURITY_OWNERS
file://sandbox/linux/OWNERS
file://sandbox/mac/OWNERS
file://sandbox/OWNERS
file://sandbox/win/OWNERS
file://third_party/blink/SECURITY_OWNERS

# Privacy reviews
file://tools/traffic_annotation/summary/TRAFFIC_ANNOTATION_OWNERS
file://tools/metrics/ukm/PRIVACY_OWNERS
file://base/metrics/OWNERS

# Blink API owners are responsible for decisions about what APIs Blink should
# expose to the open web.
file://third_party/blink/API_OWNERS

# Extension related files.
file://chrome/browser/extensions/component_extensions_whitelist/EXTENSION_WHITELIST_OWNERS
file://extensions/common/api/API_OWNERS

# This restriction is in place to avoid accidential addition to our top level
# layout files, such as add duplicated assets, or introducing new colors when
# we don't want them.
file://ui/android/java/res/LAYOUT_OWNERS

# Updating policy_templates.json can have drastic effects for systems depending
# on policy definitions (for example, Google's cloud management tools for
# Chrome and Chrome OS).
# The rules are documented at:
# https://sites.google.com/a/chromium.org/dev/developers/how-tos/enterprise/adding-new-policies
file://components/policy/resources/ENTERPRISE_POLICY_OWNERS

# This restriction is in place due to the complicated compliance regulations
# around this code.
file://chrome/android/java/src/org/chromium/chrome/browser/searchwidget/COMPLIANCE_OWNERS

# Notification channels appear in system UI and are persisted forever by
# Android, so should not be added or removed lightly, and the proper
# deprecation and versioning steps must be taken when doing so.
file://chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS

# The Weblayer API is supposed to be stable and will be used outside of the
# chromium repository.
file://weblayer/API_OWNERS
6 changes: 0 additions & 6 deletions android/.style.yapf

This file was deleted.

79 changes: 22 additions & 57 deletions android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import("//build/config/python.gni")
import("//build_overrides/build.gni")

if (enable_java_templates) {
sun_tools_jar_path = "$root_gen_dir/sun_tools_jar/tools.jar"

# Create or update the API versions cache if necessary by running a
# functionally empty lint task. This prevents racy creation of the
# cache while linting java targets in android_lint.
Expand All @@ -18,48 +16,25 @@ if (enable_java_templates) {
create_cache = true
}

action("find_sun_tools_jar") {
script = "//build/android/gyp/find_sun_tools_jar.py"
depfile = "$target_gen_dir/$target_name.d"
outputs = [
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
deps = [
":find_sun_tools_jar",
]
}

# Write to a file some GN vars that are useful to scripts that use the output
# directory. Format is chosen as easliy importable by both python and bash.
_lines = [
"android_sdk_build_tools=" +
rebase_path(android_sdk_build_tools, root_build_dir),
"android_sdk_build_tools_version=$android_sdk_build_tools_version",
"android_sdk_tools_version_suffix=$android_sdk_tools_version_suffix",
"android_sdk_root=" + rebase_path(android_sdk_root, root_build_dir),
"android_sdk_version=$android_sdk_version",
"android_ndk_root=" + rebase_path(android_ndk_root, root_build_dir),
"android_tool_prefix=" + rebase_path(android_tool_prefix, root_build_dir),
"android_configuration_failure_dir=" +
rebase_path(android_configuration_failure_dir, root_build_dir),
]
if (defined(android_secondary_abi_cpu)) {
_secondary_label_info =
get_label_info(":foo($android_secondary_abi_toolchain)", "root_out_dir")
_lines += [ "android_secondary_abi_toolchain=" +
rebase_path(_secondary_label_info, root_build_dir) ]
}
if (defined(build_apk_secondary_abi)) {
_lines += [ "build_apk_secondary_abi=$build_apk_secondary_abi" ]
}
write_file(android_build_vars, _lines)
}

Expand All @@ -86,29 +61,22 @@ python_library("test_runner_py") {
"${android_sdk_build_tools}/split-select",
"${android_sdk_root}/platform-tools/adb",
]
data_deps = [
":devil_chromium_py",
]
data_deps = [ ":devil_chromium_py" ]
if (build_with_chromium) {
data += [
"//third_party/android_build_tools/bundletool/bundletool-all-0.10.3.jar",
]
data_deps += [
"//third_party/android_platform/development/scripts:stack_py",
"//tools/android/avd:avd_py",
"//third_party/android_build_tools/bundletool/bundletool-all-0.13.3.jar",
"//tools/android/avd/proto/",
]
data_deps +=
[ "//third_party/android_platform/development/scripts:stack_py" ]
if (is_asan) {
data_deps += [ "//tools/android/asan/third_party:asan_device_setup" ]
}
} else {
pydeps_sources_assignment_filters = [ "../../tools/*" ]
}

# Proguard is needed only when using apks (rather than native executables).
if (enable_java_templates) {
deps = [
"//third_party/proguard:proguard603_java",
]
deps = [ "//build/android/stacktrace:java_deobfuscate" ]
}
}

Expand All @@ -131,26 +99,23 @@ python_library("resource_sizes_py") {
python_library("bundle_wrapper_script_py") {
pydeps_file = "gyp/create_bundle_wrapper_script.pydeps"
data = [
"//third_party/android_build_tools/bundletool/bundletool-all-0.10.3.jar",
"//third_party/android_build_tools/bundletool/bundletool-all-0.13.3.jar",
]
}

# Create wrapper scripts in out/bin that takes care of setting the
# --output-directory.
_scripts_to_wrap = [
"asan_symbolize.py",
"tombstones.py",
]
# Tools necessary for symbolizing tombstones or stack traces that are output to
# logcat.
# Hidden behind build_with_chromium because some third party repos that use
# //build don't pull in //third_party/android_platform.
if (build_with_chromium) {
group("stack_tools") {
data = [
"tombstones.py",
"pylib/symbols/",
"stacktrace/",
]

_wrapper_targets = []
foreach(script, _scripts_to_wrap) {
_target_name = get_path_info(script, "name") + "_wrapper"
_wrapper_targets += [ ":$_target_name" ]
wrapper_script(_target_name) {
target = script
data_deps =
[ "//third_party/android_platform/development/scripts:stack_py" ]
}
}

group("wrapper_scripts") {
deps = _wrapper_targets
}
4 changes: 2 additions & 2 deletions android/OWNERS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[email protected]
[email protected]
[email protected]
[email protected]
perezju@chromium.org
skyostil@chromium.org
[email protected]
[email protected]

Expand Down
66 changes: 37 additions & 29 deletions android/PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,48 @@


def CommonChecks(input_api, output_api):
output = []

build_android_dir = input_api.PresubmitLocalPath()

def J(*dirs):
"""Returns a path relative to presubmit directory."""
return input_api.os_path.join(build_android_dir, *dirs)

build_pys = [
r'gn/.*\.py$',
r'gyp/.*\.py$',
r'gn/.*\.py',
]
output.extend(input_api.canned_checks.RunPylint(
input_api,
output_api,
pylintrc='pylintrc',
black_list=build_pys,
extra_paths_list=[
J(),
J('gyp'),
J('buildbot'),
J('..', 'util', 'lib', 'common'),
J('..', '..', 'third_party', 'catapult', 'common', 'py_trace_event'),
J('..', '..', 'third_party', 'catapult', 'common', 'py_utils'),
J('..', '..', 'third_party', 'catapult', 'devil'),
J('..', '..', 'third_party', 'catapult', 'tracing'),
J('..', '..', 'third_party', 'depot_tools'),
J('..', '..', 'third_party', 'colorama', 'src'),
J('..', '..', 'third_party', 'pymock'),
]))
output.extend(input_api.canned_checks.RunPylint(
input_api,
output_api,
white_list=build_pys,
extra_paths_list=[J('gyp'), J('gn')]))
tests = []
tests.extend(
input_api.canned_checks.GetPylint(
input_api,
output_api,
pylintrc='pylintrc',
black_list=[
r'.*_pb2\.py',
] + build_pys,
extra_paths_list=[
J(),
J('gyp'),
J('buildbot'),
J('..', 'util', 'lib', 'common'),
J('..', '..', 'third_party', 'catapult', 'common',
'py_trace_event'),
J('..', '..', 'third_party', 'catapult', 'common', 'py_utils'),
J('..', '..', 'third_party', 'catapult', 'devil'),
J('..', '..', 'third_party', 'catapult', 'tracing'),
J('..', '..', 'third_party', 'depot_tools'),
J('..', '..', 'third_party', 'colorama', 'src'),
J('..', '..', 'third_party', 'pymock'),
]))
tests.extend(
input_api.canned_checks.GetPylint(
input_api,
output_api,
white_list=build_pys,
black_list=[
r'.*_pb2\.py',
],
extra_paths_list=[J('gyp'), J('gn')]))

# Disabled due to http://crbug.com/410936
#output.extend(input_api.canned_checks.RunUnitTestsInDirectory(
Expand All @@ -55,8 +62,8 @@ def J(*dirs):
'PYTHONPATH': build_android_dir,
'PYTHONDONTWRITEBYTECODE': '1',
})
output.extend(
input_api.canned_checks.RunUnitTests(
tests.extend(
input_api.canned_checks.GetUnitTests(
input_api,
output_api,
unit_tests=[
Expand All @@ -82,13 +89,14 @@ def J(*dirs):
J('pylib', 'utils', 'decorators_test.py'),
J('pylib', 'utils', 'device_dependencies_test.py'),
J('pylib', 'utils', 'dexdump_test.py'),
J('pylib', 'utils', 'gold_utils_test.py'),
J('pylib', 'utils', 'proguard_test.py'),
J('pylib', 'utils', 'test_filter_test.py'),
J('.', 'convert_dex_profile_tests.py'),
],
env=pylib_test_env))

return output
return input_api.RunTests(tests)


def CheckChangeOnUpload(input_api, output_api):
Expand Down
Loading

0 comments on commit 5d9a47b

Please sign in to comment.