summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscheib <scheib@chromium.org>2015-07-13 16:45:42 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-13 23:46:34 +0000
commit6ceefd2e4a8a04218995580534479a0dbd328404 (patch)
treee1fad104f788ea66713f4809ce5d234850bdaa7b
parentc148a71cb902192f696da7930e4200e6147e9b7b (diff)
downloadchromium_src-6ceefd2e4a8a04218995580534479a0dbd328404.zip
chromium_src-6ceefd2e4a8a04218995580534479a0dbd328404.tar.gz
chromium_src-6ceefd2e4a8a04218995580534479a0dbd328404.tar.bz2
bluetooth: android: Strings included in Chrome build.
Upcoming patch https://codereview.chromium.org/1215303006/ produces BluetoothDevices which may have empty names. Cross platform code BluetoothDevice::GetAddressWithLocalizedDeviceTypeName() generates names for devices that do not advertise a name and requires string resources. This patch packs bluetooth strings on all platforms except IOS (previously this was guarded by "enable_extensions"). Bluetooth string pak files in GN build are also made consistent with the GYP build (in a strings sub directory), as it was noticed that bluetooth was the only module inconsistent when comparing with: diff \ <(find outandroid/Debug -name "*pak" | sort) \ <(find outandroidgn/Debug/ -name "*pak" | sed s/gn// | sort) BUG=488579 Review URL: https://codereview.chromium.org/1224273008 Cr-Commit-Position: refs/heads/master@{#338595}
-rw-r--r--chrome/chrome_repack_locales.gni9
-rw-r--r--chrome/chrome_resources.gyp18
-rwxr-xr-xchrome/tools/build/repack_locales.py10
-rw-r--r--device/bluetooth/BUILD.gn65
-rw-r--r--device/bluetooth/strings/BUILD.gn67
-rw-r--r--device/bluetooth/strings/OWNERS2
6 files changed, 87 insertions, 84 deletions
diff --git a/chrome/chrome_repack_locales.gni b/chrome/chrome_repack_locales.gni
index d19888c..d9a6e90 100644
--- a/chrome/chrome_repack_locales.gni
+++ b/chrome/chrome_repack_locales.gni
@@ -54,11 +54,13 @@ template("_repack_one_locale") {
if (!is_ios) {
sources += [
"${root_gen_dir}/content/app/strings/content_strings_${locale}.pak",
+ "${root_gen_dir}/device/bluetooth/strings/device_bluetooth_strings_${locale}.pak",
"${root_gen_dir}/ui/strings/app_locale_settings_${locale}.pak",
"${root_gen_dir}/ui/strings/ui_strings_${locale}.pak",
]
deps += [
"//content/app/strings",
+ "//device/bluetooth/strings",
"//ui/strings:ui_strings",
"//ui/strings:app_locale_settings",
]
@@ -69,16 +71,11 @@ template("_repack_one_locale") {
}
if (enable_extensions) {
sources += [
- "${root_gen_dir}/device/bluetooth/device_bluetooth_strings_${locale}.pak",
-
# TODO(jamescook): When Android stops building extensions code move
# this to the OS != 'ios' and OS != 'android' section.
"${root_gen_dir}/extensions/strings/extensions_strings_${locale}.pak",
]
- deps += [
- "//device/bluetooth:strings",
- "//extensions/strings",
- ]
+ deps += [ "//extensions/strings" ]
}
if (is_chrome_branded) {
diff --git a/chrome/chrome_resources.gyp b/chrome/chrome_resources.gyp
index 910e6a3b..98f6434 100644
--- a/chrome/chrome_resources.gyp
+++ b/chrome/chrome_resources.gyp
@@ -402,7 +402,7 @@
# GN version: //chrome:packed_resources
'target_name': 'packed_resources',
'type': 'none',
- 'dependencies': [
+ 'dependencies': [ # Update duplicate logic in repack_locales.py
# MSVS needs the dependencies explictly named, Make is able to
# derive the dependencies from the output files.
'chrome_resources',
@@ -444,15 +444,16 @@
'includes': ['chrome_repack_chrome_material_200_percent.gypi']
},
],
- 'conditions': [
+ 'conditions': [ # GN version: chrome_repack_locales.gni template("_repack_one_locale")
['OS != "ios"', {
- 'dependencies': [
+ 'dependencies': [ # Update duplicate logic in repack_locales.py
'<(DEPTH)/content/app/resources/content_resources.gyp:content_resources',
'<(DEPTH)/content/app/strings/content_strings.gyp:content_strings',
+ '<(DEPTH)/device/bluetooth/bluetooth_strings.gyp:device_bluetooth_strings',
'<(DEPTH)/third_party/WebKit/public/blink_resources.gyp:blink_resources',
],
}, { # else
- 'dependencies': [
+ 'dependencies': [ # Update duplicate logic in repack_locales.py
'<(DEPTH)/ios/chrome/ios_chrome_resources.gyp:ios_strings_resources_gen',
],
'actions': [
@@ -462,7 +463,7 @@
],
}],
['use_ash==1', {
- 'dependencies': [
+ 'dependencies': [ # Update duplicate logic in repack_locales.py
'<(DEPTH)/ash/ash_resources.gyp:ash_resources',
'<(DEPTH)/ash/ash_strings.gyp:ash_strings',
],
@@ -473,20 +474,19 @@
],
}],
['chromeos==1', {
- 'dependencies': [
+ 'dependencies': [ # Update duplicate logic in repack_locales.py
'<(DEPTH)/remoting/remoting.gyp:remoting_resources',
'<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos_resources',
'<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings',
],
}],
['enable_autofill_dialog==1 and OS!="android"', {
- 'dependencies': [
+ 'dependencies': [ # Update duplicate logic in repack_locales.py
'<(DEPTH)/third_party/libaddressinput/libaddressinput.gyp:libaddressinput_strings',
],
}],
['enable_extensions==1', {
- 'dependencies': [
- '<(DEPTH)/device/bluetooth/bluetooth_strings.gyp:device_bluetooth_strings',
+ 'dependencies': [ # Update duplicate logic in repack_locales.py
'<(DEPTH)/extensions/extensions_strings.gyp:extensions_strings',
],
}],
diff --git a/chrome/tools/build/repack_locales.py b/chrome/tools/build/repack_locales.py
index b953bb8..8dc3eaa 100755
--- a/chrome/tools/build/repack_locales.py
+++ b/chrome/tools/build/repack_locales.py
@@ -100,6 +100,11 @@ def calc_inputs(locale):
inputs.append(os.path.join(SHARE_INT_DIR, 'content', 'app', 'strings',
'content_strings_%s.pak' % locale))
+ #e.g. '<(SHARED_INTERMEDIATE_DIR)/device/bluetooth/strings/
+ # device_bluetooth_strings_da.pak',
+ inputs.append(os.path.join(SHARE_INT_DIR, 'device', 'bluetooth', 'strings',
+ 'device_bluetooth_strings_%s.pak' % locale))
+
#e.g. '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_da.pak',
inputs.append(os.path.join(SHARE_INT_DIR, 'ui', 'strings',
'ui_strings_%s.pak' % locale))
@@ -120,11 +125,6 @@ def calc_inputs(locale):
'address_input_strings_%s.pak' % locale))
if ENABLE_EXTENSIONS:
- #e.g. '<(SHARED_INTERMEDIATE_DIR)/device/bluetooth/strings/
- # device_bluetooth_strings_da.pak',
- inputs.append(os.path.join(SHARE_INT_DIR, 'device', 'bluetooth', 'strings',
- 'device_bluetooth_strings_%s.pak' % locale))
-
# For example:
# '<(SHARED_INTERMEDIATE_DIR)/extensions/strings/extensions_strings_da.pak
# TODO(jamescook): When Android stops building extensions code move this
diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn
index 5307231..1c416c0 100644
--- a/device/bluetooth/BUILD.gn
+++ b/device/bluetooth/BUILD.gn
@@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import("//tools/grit/grit_rule.gni")
-
if (is_android) {
import("//build/config/android/rules.gni") # For generate_jni().
}
@@ -128,7 +126,7 @@ component("bluetooth") {
all_dependent_configs = [ ":bluetooth_config" ]
deps = [
- ":strings",
+ "strings",
"uribeacon",
"//base",
"//net",
@@ -155,67 +153,6 @@ component("bluetooth") {
}
}
-grit("strings") {
- source = "bluetooth_strings.grd"
- outputs = [
- "grit/device_bluetooth_strings.h",
- "device_bluetooth_strings_am.pak",
- "device_bluetooth_strings_ar.pak",
- "device_bluetooth_strings_bg.pak",
- "device_bluetooth_strings_bn.pak",
- "device_bluetooth_strings_ca.pak",
- "device_bluetooth_strings_cs.pak",
- "device_bluetooth_strings_da.pak",
- "device_bluetooth_strings_de.pak",
- "device_bluetooth_strings_el.pak",
- "device_bluetooth_strings_en-GB.pak",
- "device_bluetooth_strings_en-US.pak",
- "device_bluetooth_strings_es.pak",
- "device_bluetooth_strings_es-419.pak",
- "device_bluetooth_strings_et.pak",
- "device_bluetooth_strings_fa.pak",
- "device_bluetooth_strings_fake-bidi.pak",
- "device_bluetooth_strings_fi.pak",
- "device_bluetooth_strings_fil.pak",
- "device_bluetooth_strings_fr.pak",
- "device_bluetooth_strings_gu.pak",
- "device_bluetooth_strings_he.pak",
- "device_bluetooth_strings_hi.pak",
- "device_bluetooth_strings_hr.pak",
- "device_bluetooth_strings_hu.pak",
- "device_bluetooth_strings_id.pak",
- "device_bluetooth_strings_it.pak",
- "device_bluetooth_strings_ja.pak",
- "device_bluetooth_strings_kn.pak",
- "device_bluetooth_strings_ko.pak",
- "device_bluetooth_strings_lt.pak",
- "device_bluetooth_strings_lv.pak",
- "device_bluetooth_strings_ml.pak",
- "device_bluetooth_strings_mr.pak",
- "device_bluetooth_strings_ms.pak",
- "device_bluetooth_strings_nl.pak",
- "device_bluetooth_strings_nb.pak",
- "device_bluetooth_strings_pl.pak",
- "device_bluetooth_strings_pt-BR.pak",
- "device_bluetooth_strings_pt-PT.pak",
- "device_bluetooth_strings_ro.pak",
- "device_bluetooth_strings_ru.pak",
- "device_bluetooth_strings_sk.pak",
- "device_bluetooth_strings_sl.pak",
- "device_bluetooth_strings_sr.pak",
- "device_bluetooth_strings_sv.pak",
- "device_bluetooth_strings_sw.pak",
- "device_bluetooth_strings_ta.pak",
- "device_bluetooth_strings_te.pak",
- "device_bluetooth_strings_th.pak",
- "device_bluetooth_strings_tr.pak",
- "device_bluetooth_strings_uk.pak",
- "device_bluetooth_strings_vi.pak",
- "device_bluetooth_strings_zh-CN.pak",
- "device_bluetooth_strings_zh-TW.pak",
- ]
-}
-
static_library("mocks") {
testonly = true
sources = [
diff --git a/device/bluetooth/strings/BUILD.gn b/device/bluetooth/strings/BUILD.gn
new file mode 100644
index 0000000..d607c6c
--- /dev/null
+++ b/device/bluetooth/strings/BUILD.gn
@@ -0,0 +1,67 @@
+# Copyright 2015 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("//tools/grit/grit_rule.gni")
+
+# GYP version: device/bluetooth/bluetooth_strings.gyp:device_bluetooth_strings
+grit("strings") {
+ source = "../bluetooth_strings.grd"
+ outputs = [
+ "grit/device_bluetooth_strings.h",
+ "device_bluetooth_strings_am.pak",
+ "device_bluetooth_strings_ar.pak",
+ "device_bluetooth_strings_bg.pak",
+ "device_bluetooth_strings_bn.pak",
+ "device_bluetooth_strings_ca.pak",
+ "device_bluetooth_strings_cs.pak",
+ "device_bluetooth_strings_da.pak",
+ "device_bluetooth_strings_de.pak",
+ "device_bluetooth_strings_el.pak",
+ "device_bluetooth_strings_en-GB.pak",
+ "device_bluetooth_strings_en-US.pak",
+ "device_bluetooth_strings_es.pak",
+ "device_bluetooth_strings_es-419.pak",
+ "device_bluetooth_strings_et.pak",
+ "device_bluetooth_strings_fa.pak",
+ "device_bluetooth_strings_fake-bidi.pak",
+ "device_bluetooth_strings_fi.pak",
+ "device_bluetooth_strings_fil.pak",
+ "device_bluetooth_strings_fr.pak",
+ "device_bluetooth_strings_gu.pak",
+ "device_bluetooth_strings_he.pak",
+ "device_bluetooth_strings_hi.pak",
+ "device_bluetooth_strings_hr.pak",
+ "device_bluetooth_strings_hu.pak",
+ "device_bluetooth_strings_id.pak",
+ "device_bluetooth_strings_it.pak",
+ "device_bluetooth_strings_ja.pak",
+ "device_bluetooth_strings_kn.pak",
+ "device_bluetooth_strings_ko.pak",
+ "device_bluetooth_strings_lt.pak",
+ "device_bluetooth_strings_lv.pak",
+ "device_bluetooth_strings_ml.pak",
+ "device_bluetooth_strings_mr.pak",
+ "device_bluetooth_strings_ms.pak",
+ "device_bluetooth_strings_nl.pak",
+ "device_bluetooth_strings_nb.pak",
+ "device_bluetooth_strings_pl.pak",
+ "device_bluetooth_strings_pt-BR.pak",
+ "device_bluetooth_strings_pt-PT.pak",
+ "device_bluetooth_strings_ro.pak",
+ "device_bluetooth_strings_ru.pak",
+ "device_bluetooth_strings_sk.pak",
+ "device_bluetooth_strings_sl.pak",
+ "device_bluetooth_strings_sr.pak",
+ "device_bluetooth_strings_sv.pak",
+ "device_bluetooth_strings_sw.pak",
+ "device_bluetooth_strings_ta.pak",
+ "device_bluetooth_strings_te.pak",
+ "device_bluetooth_strings_th.pak",
+ "device_bluetooth_strings_tr.pak",
+ "device_bluetooth_strings_uk.pak",
+ "device_bluetooth_strings_vi.pak",
+ "device_bluetooth_strings_zh-CN.pak",
+ "device_bluetooth_strings_zh-TW.pak",
+ ]
+}
diff --git a/device/bluetooth/strings/OWNERS b/device/bluetooth/strings/OWNERS
new file mode 100644
index 0000000..b1598b5
--- /dev/null
+++ b/device/bluetooth/strings/OWNERS
@@ -0,0 +1,2 @@
+per-file *.gyp*=*
+per-file BUILD.gn=*