Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 3be7b71

Browse files
authored
Enable M88 android build. (#504)
1 parent d6384fd commit 3be7b71

File tree

4 files changed

+196
-3
lines changed

4 files changed

+196
-3
lines changed

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ deps = {
331331
Var('chromium_git') + '/infra/luci/client-py.git' + '@' + Var('swarming_revision'),
332332
# WebRTC-only dependencies (not present in Chromium).
333333
'src/third_party/webrtc':
334-
Var('deps_webrtc_git') + '/owt-deps-webrtc' + '@' + '51f552a0d00e3a25e2642582a1f0ac7373013804',
334+
Var('deps_webrtc_git') + '/owt-deps-webrtc' + '@' + '38d5304b91bba755a00b973ae411d50e268cdfd7',
335335
'src/third_party/accessibility_test_framework': {
336336
'packages': [
337337
{
@@ -459,7 +459,7 @@ deps = {
459459
'version': 'YMUu9EHNZ__2Xcxl-KsaSf-dI5TMt_P62IseUVsxktMC',
460460
},
461461
{
462-
'package': 'chromium/third_party/android_sdk/public/sources/android-30',
462+
'package': 'chromium/third_party/android_sdk/public/sources/android-29',
463463
'version': '4gxhM8E62bvZpQs7Q3d0DinQaW0RLCIefhXrQBFkNy8C',
464464
},
465465
{

scripts/prepare_dev.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
('0009-Export-WebRTC-symbols-on-iOS.patch', BUILD_PATH),
4141
('0010-Restore-is_ash-for-backward-compatible.patch', BUILD_PATH),
4242
('0013-Remove-unused-gni-for-av1-build.patch', THIRD_PARTY_PATH),
43-
('0014-Fix-missing-ffmpeg-configure-item-for-msvc-build.patch', FFMPEG_PATH)
43+
('0014-Fix-missing-ffmpeg-configure-item-for-msvc-build.patch', FFMPEG_PATH),
44+
('0015-Remove-custom-d8-dependency.patch', BUILD_PATH),
45+
('0016-Remove-deprecated-create_srcjar-property.patch', THIRD_PARTY_PATH)
4446
]
4547

4648
def _patch(ignoreFailures=False):
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
From 0c52a2cf2a39da0f534a7b0106fe42077bec75d8 Mon Sep 17 00:00:00 2001
2+
From: Qiu Jianlin <[email protected]>
3+
Date: Wed, 7 Apr 2021 14:08:10 +0800
4+
Subject: [PATCH] Remove custom d8 dependency
5+
6+
---
7+
android/gyp/dex.py | 31 +++++--------------------------
8+
config/android/internal_rules.gni | 24 ------------------------
9+
2 files changed, 5 insertions(+), 50 deletions(-)
10+
11+
diff --git a/android/gyp/dex.py b/android/gyp/dex.py
12+
index 0f05009b5..2b95c06a2 100755
13+
--- a/android/gyp/dex.py
14+
+++ b/android/gyp/dex.py
15+
@@ -71,11 +71,6 @@ def _ParseArgs(args):
16+
action='store_true',
17+
help='Allow numerous dex files within output.')
18+
parser.add_argument('--r8-jar-path', required=True, help='Path to R8 jar.')
19+
- parser.add_argument('--custom-d8-jar-path',
20+
- required=True,
21+
- help='Path to our customized d8 jar.')
22+
- parser.add_argument('--desugar-dependencies',
23+
- help='Path to store desugar dependencies.')
24+
parser.add_argument('--desugar', action='store_true')
25+
parser.add_argument(
26+
'--bootclasspath',
27+
@@ -502,8 +497,6 @@ def _CreateIntermediateDexFiles(changes, options, tmp_dir, dex_cmd):
28+
if class_files:
29+
# Dex necessary classes into intermediate dex files.
30+
dex_cmd = dex_cmd + ['--intermediate', '--file-per-class-file']
31+
- if options.desugar_dependencies:
32+
- dex_cmd += ['--file-tmp-prefix', tmp_extract_dir]
33+
_RunD8(dex_cmd, class_files, options.incremental_dir,
34+
options.warnings_as_errors,
35+
options.show_desugar_default_interface_warnings)
36+
@@ -545,7 +538,6 @@ def main(args):
37+
38+
input_paths = options.class_inputs + options.dex_inputs
39+
input_paths.append(options.r8_jar_path)
40+
- input_paths.append(options.custom_d8_jar_path)
41+
if options.main_dex_rules_path:
42+
input_paths.extend(options.main_dex_rules_path)
43+
44+
@@ -565,8 +557,8 @@ def main(args):
45+
46+
dex_cmd = build_utils.JavaCmd(options.warnings_as_errors) + [
47+
'-cp',
48+
- '{}:{}'.format(options.r8_jar_path, options.custom_d8_jar_path),
49+
- 'org.chromium.build.CustomD8',
50+
+ options.r8_jar_path,
51+
+ 'com.android.tools.r8.D8',
52+
]
53+
if options.release:
54+
dex_cmd += ['--release']
55+
@@ -576,25 +568,12 @@ def main(args):
56+
if not options.desugar:
57+
dex_cmd += ['--no-desugaring']
58+
elif options.classpath:
59+
- # The classpath is used by D8 to for interface desugaring.
60+
- if options.desugar_dependencies:
61+
- dex_cmd += ['--desugar-dependencies', options.desugar_dependencies]
62+
- if track_subpaths_allowlist:
63+
- track_subpaths_allowlist += options.classpath
64+
- depfile_deps += options.classpath
65+
- input_paths += options.classpath
66+
- # Still pass the entire classpath in case a new dependency is needed by
67+
- # desugar, so that desugar_dependencies will be updated for the next build.
68+
- for path in options.classpath:
69+
- dex_cmd += ['--classpath', path]
70+
-
71+
- if options.classpath or options.main_dex_rules_path:
72+
- # --main-dex-rules requires bootclasspath.
73+
+ # --main-dex-rules requires bootclasspath.
74+
dex_cmd += ['--lib', build_utils.JAVA_HOME]
75+
- for path in options.bootclasspath:
76+
+ for path in options.classpath:
77+
dex_cmd += ['--lib', path]
78+
depfile_deps += options.bootclasspath
79+
- input_paths += options.bootclasspath
80+
+ input_paths += options.classpath
81+
82+
83+
if options.desugar_jdk_libs_json:
84+
diff --git a/config/android/internal_rules.gni b/config/android/internal_rules.gni
85+
index ca50d6a26..36adc2ca9 100644
86+
--- a/config/android/internal_rules.gni
87+
+++ b/config/android/internal_rules.gni
88+
@@ -82,7 +82,6 @@ _java_library_patterns = [
89+
java_target_patterns = _java_library_patterns + _java_resource_patterns
90+
91+
_r8_path = "//third_party/r8/lib/r8.jar"
92+
-_custom_d8_path = "//third_party/r8/custom_d8.jar"
93+
_desugar_jdk_libs_json = "//third_party/r8/desugar_jdk_libs.json"
94+
_desugar_jdk_libs_jar = "//third_party/android_deps/libs/com_android_tools_desugar_jdk_libs/desugar_jdk_libs-1.0.10.jar"
95+
_desugar_jdk_libs_configuration_jar = "//third_party/android_deps/libs/com_android_tools_desugar_jdk_libs_configuration/desugar_jdk_libs_configuration-1.0.10.jar"
96+
@@ -1572,7 +1571,6 @@ if (enable_java_templates) {
97+
outputs = [ invoker.output ]
98+
inputs = [
99+
_r8_path,
100+
- _custom_d8_path,
101+
]
102+
103+
if (!_is_library) {
104+
@@ -1592,8 +1590,6 @@ if (enable_java_templates) {
105+
"--min-api=$_min_sdk_version",
106+
"--r8-jar-path",
107+
rebase_path(_r8_path, root_build_dir),
108+
- "--custom-d8-jar-path",
109+
- rebase_path(_custom_d8_path, root_build_dir),
110+
]
111+
if (treat_warnings_as_errors) {
112+
args += [ "--warnings-as-errors" ]
113+
@@ -1689,11 +1685,7 @@ if (enable_java_templates) {
114+
}
115+
}
116+
if (_desugar_needs_classpath) {
117+
- _desugar_dependencies_path =
118+
- "$target_gen_dir/$target_name.desugardeps"
119+
args += [
120+
- "--desugar-dependencies",
121+
- rebase_path(_desugar_dependencies_path, root_build_dir),
122+
"--bootclasspath=@FileArg($_rebased_build_config:android:sdk_jars)",
123+
124+
# Pass the full classpath to find new dependencies that are not in
125+
@@ -3185,21 +3177,6 @@ if (enable_java_templates) {
126+
args += [ "--jar-info-exclude-globs=${invoker.jar_excluded_patterns}" ]
127+
}
128+
129+
- if (invoker.enable_errorprone) {
130+
- # Our custom plugin pulls in the main errorprone dep transitively.
131+
- _errorprone_dep = "//tools/android/errorprone_plugin:errorprone_plugin"
132+
- deps += [ _errorprone_dep ]
133+
- _dep_gen_dir = get_label_info(_errorprone_dep, "target_gen_dir")
134+
- _dep_name = get_label_info(_errorprone_dep, "name")
135+
- _rebased_errorprone_buildconfig =
136+
- rebase_path("$_dep_gen_dir/$_dep_name.build_config", root_build_dir)
137+
- _target_label = get_label_info(target_name, "dir")
138+
- args += [
139+
- "--target-name=${_target_label}",
140+
- "--processorpath=@FileArg($_rebased_errorprone_buildconfig:deps_info:host_classpath)",
141+
- "--enable-errorprone",
142+
- ]
143+
- }
144+
foreach(e, _processor_args) {
145+
args += [ "--processor-arg=" + e ]
146+
}
147+
@@ -4014,7 +3991,6 @@ if (enable_java_templates) {
148+
])
149+
input_class_jars = [ _device_processed_jar_path ]
150+
enable_desugar = _enable_desugar
151+
- ignore_desugar_missing_deps = !_enable_bytecode_checks
152+
153+
# There's no value in per-class dexing prebuilts since they never
154+
# change just one class at a time.
155+
--
156+
2.17.1
157+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From 6e42d746ec234f9a4aa1e809cb6fa9756334bd5a Mon Sep 17 00:00:00 2001
2+
From: Qiu Jianlin <[email protected]>
3+
Date: Wed, 7 Apr 2021 14:13:14 +0800
4+
Subject: [PATCH] Remove deprecated create_srcjar property
5+
6+
---
7+
android_deps/BUILD.gn | 4 ++--
8+
1 file changed, 2 insertions(+), 2 deletions(-)
9+
10+
diff --git a/android_deps/BUILD.gn b/android_deps/BUILD.gn
11+
index 7e26e07797f..7dcd787fc97 100644
12+
--- a/android_deps/BUILD.gn
13+
+++ b/android_deps/BUILD.gn
14+
@@ -803,7 +803,7 @@ android_aar_prebuilt("androidx_vectordrawable_vectordrawable_java") {
15+
":androidx_core_core_java",
16+
]
17+
resource_overlay = true
18+
- create_srcjar = false
19+
+ #create_srcjar = false
20+
}
21+
22+
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
23+
@@ -2209,7 +2209,7 @@ android_aar_prebuilt("com_android_support_support_vector_drawable_java") {
24+
":com_android_support_support_compat_java",
25+
]
26+
resource_overlay = true
27+
- create_srcjar = false
28+
+ #create_srcjar = false
29+
}
30+
31+
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
32+
--
33+
2.17.1
34+

0 commit comments

Comments
 (0)