summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlizeb <lizeb@chromium.org>2016-09-21 09:27:45 (GMT)
committerCommit bot <commit-bot@chromium.org>2016-09-21 09:31:03 (GMT)
commitcb8045c8f3889b84f3d36e3280763018328a5f17 (patch)
tree5109849aa37b7ba4b10568507849ec72a993c393
parent5e5f2f83e084fd34138ed1bf96bf9e39c3f83be2 (diff)
downloadchromium-cb8045c8f3889b84f3d36e3280763018328a5f17.tar.gz
chromium-cb8045c8f3889b84f3d36e3280763018328a5f17.tar.xz
Revert of Create Monochrome-specific repack() targets (patchset #5 id:80001 of https://codereview.chromium.org/2354803002/ )HEADmaster
Reason for revert: Breaks ARM64 downstream bot (crbug.com/648878). Original issue's description: > Create Monochrome-specific repack() targets > > This allows Monochrome.apk's .pak files to properly contain the > union of Chrome and WebView's .pak files. It also allows it to use > a target-specific resource whitelist. > > This change applies to resources.pak and chrome_100_percent.pak. A > change to language .pak files will come as a follow-up. > > BUG=641032,634358 > CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation > > Committed: https://crrev.com/a5d84d504167c0fb7452dec22c7f024f8fcde072 > Cr-Commit-Position: refs/heads/master@{#419960} TBR=michaelbai@chromium.org,brettw@chromium.org,agrieve@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=641032,634358,648878 Review-Url: https://codereview.chromium.org/2353553004 Cr-Commit-Position: refs/heads/master@{#420021}
-rw-r--r--build/config/android/internal_rules.gni1
-rw-r--r--chrome/BUILD.gn24
-rw-r--r--chrome/android/BUILD.gn68
-rw-r--r--chrome/browser/resources/chromeos/chromevox/BUILD.gn1
-rw-r--r--chrome/chrome_paks.gni167
-rw-r--r--chrome/test/BUILD.gn29
6 files changed, 114 insertions, 176 deletions
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 67e84c0..314adcd 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -61,6 +61,7 @@ _java_target_whitelist = [
# Targets that match the whitelist but are not actually java targets.
_java_target_blacklist = [
+ "//chrome:packed_extra_resources",
"//chrome:packed_resources",
"//remoting/android:remoting_android_raw_resources",
"*:*_unpack_aar",
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 268328b..3487192 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -16,6 +16,7 @@ import("//chrome/common/features.gni")
import("//chrome/process_version_rc_template.gni")
import("//third_party/widevine/cdm/widevine.gni")
import("//tools/resources/generate_resource_whitelist.gni")
+import("//ui/base/ui_features.gni")
import("//v8/gni/v8.gni")
if (is_android) {
@@ -252,7 +253,10 @@ if (!is_android && !is_mac) {
}
# These files are used by the installer so we need a public dep.
- public_deps += [ ":packed_resources" ]
+ public_deps += [
+ ":packed_extra_resources",
+ ":packed_resources",
+ ]
# Only ChromeOS has precompiled Flash that needs to get copied to the output
# directory. On other platforms, Flash is either component-updated only or
@@ -734,6 +738,7 @@ if (is_win) {
]
public_deps = [
+ ":packed_extra_resources",
":packed_resources",
"//chrome/app_shim:app_mode_loader",
]
@@ -1347,6 +1352,23 @@ chrome_paks("packed_resources") {
}
}
+chrome_extra_paks("packed_extra_resources") {
+ if (is_mac) {
+ output_dir = "$root_gen_dir/repack"
+ copy_data_to_bundle = true
+ } else {
+ output_dir = root_out_dir
+ }
+
+ copy_data_to_bundle = is_mac
+ if (enable_resource_whitelist_generation) {
+ repack_whitelist = chrome_resource_whitelist
+ deps = [
+ ":resource_whitelist",
+ ]
+ }
+}
+
repack("browser_tests_pak") {
sources = [
"$root_gen_dir/chrome/options_test_resources.pak",
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index 583640c..d8cd6a2 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -7,13 +7,11 @@ import("//build/config/android/rules.gni")
import("//build/util/process_version.gni")
import("//build_overrides/v8.gni")
import("//chrome/android/chrome_public_apk_tmpl.gni")
-import("//chrome/chrome_paks.gni")
import("//chrome/common/features.gni")
import("//chrome/process_version_rc_template.gni") # For branding_file_path.
import("//testing/test.gni")
import("//third_party/icu/config.gni")
import("//third_party/protobuf/proto_library.gni")
-import("//tools/resources/generate_resource_whitelist.gni")
import("channel.gni")
import("java_sources.gni")
@@ -30,11 +28,6 @@ chrome_sync_shell_jinja_variables =
default_chrome_public_jinja_variables +
[ "manifest_package=org.chromium.chrome.sync_shell" ]
-if (enable_resource_whitelist_generation) {
- monochrome_resource_whitelist =
- "$target_gen_dir/monochrome_resource_whitelist.txt"
-}
-
jinja_template("chrome_public_android_manifest") {
input = "java/AndroidManifest.xml"
output = chrome_public_android_manifest
@@ -493,23 +486,7 @@ android_resources("chrome_public_apk_resources") {
]
}
-# TODO(agrieve): Delete once downstream no longer references this target.
-java_group("chrome_public_apk_assets") {
- deps = [
- ":chrome_public_non_pak_assets",
- ":chrome_public_pak_assets",
- ]
-}
-
-java_group("chrome_public_non_pak_assets") {
- deps = [
- "//chrome/android/webapk/libs/runtime_library:runtime_library_assets",
- "//third_party/icu:icu_assets",
- "//v8:v8_external_startup_data_assets",
- ]
-}
-
-android_assets("chrome_public_pak_assets") {
+android_assets("chrome_public_apk_assets") {
sources = [
"$root_out_dir/chrome_100_percent.pak",
"$root_out_dir/resources.pak",
@@ -517,6 +494,7 @@ android_assets("chrome_public_pak_assets") {
disable_compression = true
deps = [
+ "//chrome:packed_extra_resources",
"//chrome:packed_resources",
"//chrome/android/webapk/libs/runtime_library:runtime_library_assets",
"//third_party/icu:icu_assets",
@@ -561,48 +539,6 @@ shared_library("chrome") {
public_configs = extra_chrome_shared_library_configs
}
-if (enable_resource_whitelist_generation) {
- generate_resource_whitelist("monochrome_resource_whitelist") {
- deps = [
- ":monochrome",
- ]
- input = "$root_out_dir/libmonochrome$shlib_extension.whitelist"
- output = monochrome_resource_whitelist
- }
-}
-
-chrome_paks("monochrome_paks") {
- output_dir = "$target_gen_dir/$target_name"
-
- additional_extra_paks = [ "$root_gen_dir/android_webview/aw_resources.pak" ]
- deps = [
- "//android_webview:generate_aw_resources",
- ]
-
- if (enable_resource_whitelist_generation) {
- repack_whitelist = monochrome_resource_whitelist
- deps += [ ":monochrome_resource_whitelist" ]
- }
-}
-
-java_group("monochrome_assets") {
- deps = [
- ":monochrome_pak_assets",
- "//android_webview:monochrome_webview_assets",
- ]
-}
-
-android_assets("monochrome_pak_assets") {
- sources = [
- "$target_gen_dir/monochrome_paks/chrome_100_percent.pak",
- "$target_gen_dir/monochrome_paks/resources.pak",
- ]
- deps = [
- ":monochrome_paks",
- ]
- disable_compression = true
-}
-
#
# Only 32-bit //chrome/android/monochrome is needed, beside
# being built with 32-bit default toolchain, it is also built
diff --git a/chrome/browser/resources/chromeos/chromevox/BUILD.gn b/chrome/browser/resources/chromeos/chromevox/BUILD.gn
index fc37ab8..d4e99ac 100644
--- a/chrome/browser/resources/chromeos/chromevox/BUILD.gn
+++ b/chrome/browser/resources/chromeos/chromevox/BUILD.gn
@@ -533,6 +533,7 @@ test("chromevox_tests") {
"//base:i18n",
"//base/test:test_support",
"//chrome:browser_tests_pak",
+ "//chrome:packed_extra_resources",
"//chrome:packed_resources",
"//chrome:resources",
"//chrome:strings",
diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni
index b4f86fb4..b759219 100644
--- a/chrome/chrome_paks.gni
+++ b/chrome/chrome_paks.gni
@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//build/config/locales.gni")
-import("//ui/base/ui_features.gni")
import("chrome_repack_locales.gni")
# Generates a rule to repack a set of resources, substituting a given string
@@ -76,6 +75,70 @@ template("chrome_repack_percent") {
}
}
+# Paramters:
+# output_dir:
+#
+template("chrome_paks") {
+ chrome_repack_percent("${target_name}_100_percent") {
+ percent = "100"
+ forward_variables_from(invoker,
+ [
+ "copy_data_to_bundle",
+ "deps",
+ "output_dir",
+ "repack_whitelist",
+ "visibility",
+ ])
+ }
+
+ if (invoker.enable_hidpi) {
+ chrome_repack_percent("${target_name}_200_percent") {
+ percent = "200"
+ forward_variables_from(invoker,
+ [
+ "copy_data_to_bundle",
+ "deps",
+ "output_dir",
+ "repack_whitelist",
+ "visibility",
+ ])
+ }
+ }
+
+ chrome_repack_locales("${target_name}_locales") {
+ forward_variables_from(invoker,
+ [
+ "copy_data_to_bundle",
+ "deps",
+ "repack_whitelist",
+ "visibility",
+ ])
+
+ input_locales = locales
+ output_dir = "${invoker.output_dir}/locales"
+
+ if (is_mac) {
+ output_locales = locales_as_mac_outputs
+ } else {
+ output_locales = locales
+ }
+ }
+
+ group(target_name) {
+ forward_variables_from(invoker, [ "deps" ])
+ public_deps = [
+ ":${target_name}_100_percent",
+ ":${target_name}_locales",
+ ]
+ if (invoker.enable_hidpi) {
+ public_deps += [ ":${target_name}_200_percent" ]
+ }
+ if (defined(invoker.public_deps)) {
+ public_deps += invoker.public_deps
+ }
+ }
+}
+
template("chrome_extra_paks") {
repack(target_name) {
forward_variables_from(invoker,
@@ -120,11 +183,11 @@ template("chrome_extra_paks") {
if (defined(invoker.deps)) {
deps += invoker.deps
}
- if (defined(invoker.additional_paks)) {
- sources += invoker.additional_paks
- }
- if (!is_android) {
+ if (is_android) {
+ sources += [ "$root_gen_dir/android_webview/aw_resources.pak" ]
+ deps += [ "//android_webview:generate_aw_resources" ]
+ } else { # Non-Android.
# New paks should be added here by default.
sources += [
"$root_gen_dir/blink/devtools_resources.pak",
@@ -156,97 +219,3 @@ template("chrome_extra_paks") {
}
}
}
-
-# Defines repack() targets used by Chrome. Specifically:
-# * chrome_100_percent.pak
-# * chrome_200_percent.pak (optionally)
-# * resources.pak
-# * locale .pak files
-#
-# Paramters:
-# output_dir [required]: Directory to output .pak files. Locale .pak files
-# will always be place in $output_dir/locales
-# additional_extra_paks: List of extra .pak sources for resources.pak.
-# copy_data_to_bundle:
-# deps:
-# output_dir:
-# public_deps:
-# repack_whitelist:
-# visibility:
-# Normal meanings.
-#
-template("chrome_paks") {
- chrome_repack_percent("${target_name}_100_percent") {
- percent = "100"
- forward_variables_from(invoker,
- [
- "copy_data_to_bundle",
- "deps",
- "output_dir",
- "repack_whitelist",
- "visibility",
- ])
- }
-
- if (enable_hidpi) {
- chrome_repack_percent("${target_name}_200_percent") {
- percent = "200"
- forward_variables_from(invoker,
- [
- "copy_data_to_bundle",
- "deps",
- "output_dir",
- "repack_whitelist",
- "visibility",
- ])
- }
- }
-
- chrome_extra_paks("${target_name}_extra") {
- forward_variables_from(invoker,
- [
- "copy_data_to_bundle",
- "deps",
- "output_dir",
- "repack_whitelist",
- "visibility",
- ])
- if (defined(invoker.additional_extra_paks)) {
- additional_paks = invoker.additional_extra_paks
- }
- }
-
- chrome_repack_locales("${target_name}_locales") {
- forward_variables_from(invoker,
- [
- "copy_data_to_bundle",
- "deps",
- "repack_whitelist",
- "visibility",
- ])
-
- input_locales = locales
- output_dir = "${invoker.output_dir}/locales"
-
- if (is_mac) {
- output_locales = locales_as_mac_outputs
- } else {
- output_locales = locales
- }
- }
-
- group(target_name) {
- forward_variables_from(invoker, [ "deps" ])
- public_deps = [
- ":${target_name}_100_percent",
- ":${target_name}_extra",
- ":${target_name}_locales",
- ]
- if (enable_hidpi) {
- public_deps += [ ":${target_name}_200_percent" ]
- }
- if (defined(invoker.public_deps)) {
- public_deps += invoker.public_deps
- }
- }
-}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 5446af5..be7d4db 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -454,19 +454,23 @@ if (!is_android) {
"$root_out_dir/chrome_200_percent.pak",
"$root_out_dir/locales/en-US.pak",
"$root_out_dir/locales/fr.pak",
- "$root_out_dir/resources.pak",
]
}
if (is_linux) {
data += [ "$root_out_dir/libppapi_tests.so" ]
}
+ if (!is_mac) {
+ data_deps += [ "//chrome:packed_extra_resources" ]
+ }
+
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
ldflags = []
deps = [
":test_support",
":test_support_ui",
+ "//chrome:packed_extra_resources",
"//chrome:packed_resources",
"//chrome:resources",
"//chrome:strings",
@@ -1555,8 +1559,8 @@ test("browser_tests") {
"../browser/interstitials/security_interstitial_page_test_utils.h",
"../browser/invalidation/profile_invalidation_provider_factory_browsertest.cc",
"../browser/lifetime/browser_close_manager_browsertest.cc",
- "../browser/loader/chrome_resource_dispatcher_host_delegate_browsertest.cc",
"../browser/loadtimes_extension_bindings_browsertest.cc",
+ "../browser/loader/chrome_resource_dispatcher_host_delegate_browsertest.cc",
"../browser/locale_tests_browsertest.cc",
"../browser/media/defer_background_media_browsertest.cc",
"../browser/media/encrypted_media_browsertest.cc",
@@ -1851,6 +1855,7 @@ test("browser_tests") {
"//base:i18n",
"//base/test:test_support",
"//chrome:browser_tests_pak",
+ "//chrome:packed_extra_resources",
"//chrome:packed_resources",
"//chrome:resources",
"//chrome:strings",
@@ -1952,10 +1957,8 @@ test("browser_tests") {
]
if (!is_mac) {
- data += [
- "$root_out_dir/locales/",
- "$root_out_dir/resources.pak",
- ]
+ data += [ "$root_out_dir/locales/" ]
+ data_deps += [ "//chrome:packed_extra_resources" ]
}
if (!enable_one_click_signin) {
@@ -2415,8 +2418,8 @@ test("browser_tests") {
}
}
if (is_mac) {
- # Other platforms only need .pak files, and can build this target
- # standalone much faster.
+ # Other platforms only need {packed_extra_resources,packed_resources},
+ # and can build this target standalone much faster.
deps += [
"//chrome",
"//chrome/common:app_mode_app_support",
@@ -2720,7 +2723,6 @@ if (!is_android) {
"$root_out_dir/chrome_100_percent.pak",
"$root_out_dir/chrome_200_percent.pak",
"$root_out_dir/locales/en-US.pak",
- "$root_out_dir/resources.pak",
]
}
@@ -2732,6 +2734,7 @@ if (!is_android) {
":sync_integration_test_support",
":test_support",
":test_support_ui",
+ "//chrome:packed_extra_resources",
"//chrome:packed_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2752,6 +2755,10 @@ if (!is_android) {
"//third_party/mesa:osmesa",
]
+ if (!is_mac) {
+ data_deps += [ "//chrome:packed_extra_resources" ]
+ }
+
if (is_mac) {
# Dictionary sync is disabled on Mac.
sources -= [
@@ -3357,7 +3364,6 @@ test("unit_tests") {
data += [
"$root_out_dir/chrome_100_percent.pak",
"$root_out_dir/locales/en-US.pak",
- "$root_out_dir/resources.pak",
]
}
if (is_linux || is_win) {
@@ -3445,6 +3451,8 @@ test("unit_tests") {
if (is_mac) {
data_deps += [ "//chrome:chrome_framework" ]
data += [ "$root_out_dir/Chromium Framework.framework/" ]
+ } else {
+ data_deps += [ "//chrome:packed_extra_resources" ]
}
if (is_android) {
@@ -4572,6 +4580,7 @@ test("unit_tests") {
}
if (!is_mac && !is_ios) {
deps += [
+ "//chrome:packed_extra_resources",
"//chrome:packed_resources",
"//chrome/tools/convert_dict:lib",
"//third_party/hunspell",