Commit b4a06a45 authored by Samuel Huang's avatar Samuel Huang Committed by Commit Bot

[Bundles] Add Upstream 64-bit Trichrome Chrome Bundles.

This CL adds the following targets for 64-bit biulds:
  trichrome_64_32_chrome_bundle
  trichrome_64_chrome_bundle

These complemnent existing Monochrome targets.

Also rename template monochrome_public_bundle_tmpl to
monochrome_or_trichrome_public_bundle_tmpl.

Change-Id: I1773085c82e2dbf068c9bfbd1ca03a7175fee1c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1553913Reviewed-by: default avatarChristopher Grant <cjgrant@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#648671}
parent 0ccf7d2a
......@@ -113,11 +113,11 @@ e.g. 64_32 is 64-bit chrome with 32-bit webview.
"""
ARCH64_APK_VARIANTS = {
'64_32': {
'PACKAGES': frozenset(['MONOCHROME']),
'PACKAGES': frozenset(['MONOCHROME', 'TRICHROME']),
'MODIFIER': 10
},
'64': {
'PACKAGES': frozenset(['MONOCHROME']),
'PACKAGES': frozenset(['MONOCHROME', 'TRICHROME']),
'MODIFIER': 20
}
}
......
......@@ -172,9 +172,13 @@ class _VersionTest(unittest.TestCase):
self.EXAMPLE_VERSION_VALUES, arch='arm64', is_next_build=False)
arch_monochrome_64_32_version_code = output['MONOCHROME_64_32_VERSION_CODE']
arch_monochrome_64_version_code = output['MONOCHROME_64_VERSION_CODE']
arch_trichrome_64_32_version_code = output['TRICHROME_64_32_VERSION_CODE']
arch_trichrome_64_version_code = output['TRICHROME_64_VERSION_CODE']
self.assertEqual(arch_monochrome_64_32_version_code, '372000042')
self.assertEqual(arch_monochrome_64_version_code, '372000052')
self.assertEqual(arch_trichrome_64_32_version_code, '372000043')
self.assertEqual(arch_trichrome_64_version_code, '372000053')
def testGenerateVersionCodesAndroidArchX64(self):
"""Assert it handles different architectures correctly.
......@@ -200,9 +204,13 @@ class _VersionTest(unittest.TestCase):
self.EXAMPLE_VERSION_VALUES, arch='x64', is_next_build=False)
arch_monochrome_64_32_version_code = output['MONOCHROME_64_32_VERSION_CODE']
arch_monochrome_64_version_code = output['MONOCHROME_64_VERSION_CODE']
arch_trichrome_64_32_version_code = output['TRICHROME_64_32_VERSION_CODE']
arch_trichrome_64_version_code = output['TRICHROME_64_VERSION_CODE']
self.assertEqual(arch_monochrome_64_32_version_code, '372000072')
self.assertEqual(arch_monochrome_64_version_code, '372000082')
self.assertEqual(arch_trichrome_64_32_version_code, '372000073')
self.assertEqual(arch_trichrome_64_version_code, '372000083')
def testGenerateVersionCodesAndroidArchOrderArm(self):
"""Assert it handles different architectures correctly.
......
......@@ -51,7 +51,9 @@ if (target_os == "mac") {
if (target_cpu == "arm64" || target_cpu == "x64") {
_version_dictionary_template +=
"monochrome_64_32_version_code = \"@MONOCHROME_64_32_VERSION_CODE@\" " +
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" "
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" " +
"trichrome_64_32_version_code = \"@TRICHROME_64_32_VERSION_CODE@\" " +
"trichrome_64_version_code = \"@TRICHROME_64_VERSION_CODE@\" "
}
_script_arguments += [
......@@ -96,16 +98,18 @@ if (target_os == "mac") {
} else if (target_os == "android") {
forward_variables_from(_result,
[
"chrome_version_code",
"chrome_modern_version_code",
"chrome_version_code",
"monochrome_64_32_version_code",
"monochrome_64_version_code",
"monochrome_version_code",
"trichrome_version_code",
"notouch_chrome_version_code",
"webview_stable_version_code",
"trichrome_64_32_version_code",
"trichrome_64_version_code",
"trichrome_version_code",
"webview_beta_version_code",
"webview_dev_version_code",
"monochrome_64_32_version_code",
"monochrome_64_version_code",
"webview_stable_version_code",
])
chrome_version_name = chrome_version_full
......@@ -126,6 +130,8 @@ if (target_os == "mac") {
lines_to_write += [
"Monochrome_64_32=$monochrome_64_32_version_code",
"Monochrome_64=$monochrome_64_version_code",
"TrichromeChrome_64_32=$trichrome_64_32_version_code",
"TrichromeChrome_64=$trichrome_64_version_code",
]
}
......
......@@ -120,7 +120,9 @@ class _VersionTest(unittest.TestCase):
new_template = (
self._EXAMPLE_ANDROID_TEMPLATE +
"monochrome_64_32_version_code = \"@MONOCHROME_64_32_VERSION_CODE@\" "
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" ")
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" "
"trichrome_64_32_version_code = \"@TRICHROME_64_32_VERSION_CODE@\" "
"trichrome_64_version_code = \"@TRICHROME_64_VERSION_CODE@\" ")
args_with_template = _ReplaceArgs(self._EXAMPLE_ANDROID_ARGS,
['-t', new_template])
new_args = _ReplaceArgs(args_with_template, ['-a', 'arm64'])
......@@ -131,13 +133,19 @@ class _VersionTest(unittest.TestCase):
r'\bmonochrome_64_32_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\bmonochrome_64_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\btrichrome_64_32_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\btrichrome_64_version_code = "\d+"\s')
def testBuildOutputAndroidArchVariantsX64(self):
"""Assert 64-bit-specific version codes"""
new_template = (
self._EXAMPLE_ANDROID_TEMPLATE +
"monochrome_64_32_version_code = \"@MONOCHROME_64_32_VERSION_CODE@\" "
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" ")
"monochrome_64_version_code = \"@MONOCHROME_64_VERSION_CODE@\" "
"trichrome_64_32_version_code = \"@TRICHROME_64_32_VERSION_CODE@\" "
"trichrome_64_version_code = \"@TRICHROME_64_VERSION_CODE@\" ")
args_with_template = _ReplaceArgs(self._EXAMPLE_ANDROID_ARGS,
['-t', new_template])
new_args = _ReplaceArgs(args_with_template, ['-a', 'x64'])
......@@ -148,6 +156,10 @@ class _VersionTest(unittest.TestCase):
r'\bmonochrome_64_32_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\bmonochrome_64_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\btrichrome_64_32_version_code = "\d+"\s')
self.assertRegexpMatches(contents,
r'\btrichrome_64_version_code = "\d+"\s')
def testBuildOutputAndroidChromeArchInput(self):
"""Assert it raises an exception when using an invalid architecture input"""
......
......@@ -2054,7 +2054,7 @@ if (is_official_build) {
}
}
template("monochrome_public_bundle_tmpl") {
template("monochrome_or_trichrome_public_bundle_tmpl") {
_base_module_target_name = "${invoker.target_name}__base_bundle_module"
_is_trichrome =
defined(invoker.use_trichrome_library) && invoker.use_trichrome_library
......@@ -2067,15 +2067,25 @@ template("monochrome_public_bundle_tmpl") {
}
if (_is_trichrome) {
_version_code = trichrome_version_code
} else if (defined(invoker.is_64_bit_browser) && invoker.is_64_bit_browser) {
if (invoker.build_apk_secondary_abi && invoker.include_32_bit_webview) {
_version_code = monochrome_64_32_version_code
if (defined(invoker.is_64_bit_browser) && invoker.is_64_bit_browser) {
if (invoker.build_apk_secondary_abi && invoker.include_32_bit_webview) {
_version_code = trichrome_64_32_version_code
} else {
_version_code = trichrome_64_version_code
}
} else {
_version_code = monochrome_64_version_code
_version_code = trichrome_version_code
}
} else {
_version_code = monochrome_version_code
if (defined(invoker.is_64_bit_browser) && invoker.is_64_bit_browser) {
if (invoker.build_apk_secondary_abi && invoker.include_32_bit_webview) {
_version_code = monochrome_64_32_version_code
} else {
_version_code = monochrome_64_version_code
}
} else {
_version_code = monochrome_version_code
}
}
_version_name = chrome_version_name
......@@ -2173,7 +2183,7 @@ template("monochrome_public_bundle_tmpl") {
}
}
monochrome_public_bundle_tmpl("monochrome_public_bundle") {
monochrome_or_trichrome_public_bundle_tmpl("monochrome_public_bundle") {
bundle_suffix = ""
}
......@@ -2187,8 +2197,13 @@ if (is_official_build) {
}
}
monochrome_or_trichrome_public_bundle_tmpl("trichrome_chrome_bundle") {
bundle_suffix = ""
use_trichrome_library = true
}
if (android_64bit_target_cpu) {
monochrome_public_bundle_tmpl("monochrome_64_public_bundle") {
monochrome_or_trichrome_public_bundle_tmpl("monochrome_64_public_bundle") {
bundle_suffix = "64"
is_64_bit_browser = true
if (build_apk_secondary_abi) {
......@@ -2196,18 +2211,31 @@ if (android_64bit_target_cpu) {
}
}
monochrome_public_bundle_tmpl("monochrome_64_32_public_bundle") {
monochrome_or_trichrome_public_bundle_tmpl("monochrome_64_32_public_bundle") {
bundle_suffix = "6432"
is_64_bit_browser = true
if (build_apk_secondary_abi) {
include_32_bit_webview = true
}
}
}
monochrome_public_bundle_tmpl("trichrome_chrome_bundle") {
bundle_suffix = ""
use_trichrome_library = true
monochrome_or_trichrome_public_bundle_tmpl("trichrome_64_chrome_bundle") {
bundle_suffix = "64"
is_64_bit_browser = true
use_trichrome_library = true
if (build_apk_secondary_abi) {
include_32_bit_webview = false
}
}
monochrome_or_trichrome_public_bundle_tmpl("trichrome_64_32_chrome_bundle") {
bundle_suffix = "6432"
is_64_bit_browser = true
use_trichrome_library = true
if (build_apk_secondary_abi) {
include_32_bit_webview = true
}
}
}
generate_jni("chrome_jni_headers") {
......
......@@ -366,7 +366,9 @@ template("monochrome_public_common_apk_or_module_tmpl") {
# depend on their respective versions of the shared library APK even
# though they're functionally the same.
native_lib_placeholders = [ "libdummy.so" ]
if (android_64bit_target_cpu && build_apk_secondary_abi) {
if (android_64bit_target_cpu && build_apk_secondary_abi &&
(!defined(invoker.is_64_bit_browser) || !invoker.is_64_bit_browser ||
invoker.include_32_bit_webview)) {
secondary_native_lib_placeholders = [ "libdummy.so" ]
}
_pak_prefix = "trichrome_chrome"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment