summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkotwicz <pkotwicz@chromium.org>2015-10-06 09:29:05 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-06 16:30:19 +0000
commit0a2255e0c2f960fc29c467d1b6a1ecc0dd49e14b (patch)
treebd30872af624d56d85f3ee9b584db376bd8d7b95
parent6f6386e617f754b9fdcca61992aece41f5be6c5b (diff)
downloadchromium_src-0a2255e0c2f960fc29c467d1b6a1ecc0dd49e14b.zip
chromium_src-0a2255e0c2f960fc29c467d1b6a1ecc0dd49e14b.tar.gz
chromium_src-0a2255e0c2f960fc29c467d1b6a1ecc0dd49e14b.tar.bz2
Port custom_tabs_client from GYP to GN
BUG=535071 TEST=None Review URL: https://codereview.chromium.org/1358243006 Cr-Commit-Position: refs/heads/master@{#352617}
-rw-r--r--BUILD.gn1
-rw-r--r--build/config/android/internal_rules.gni10
-rw-r--r--build/config/android/rules.gni5
-rw-r--r--build/gn_migration.gypi1
-rw-r--r--build/secondary/third_party/android_tools/BUILD.gn8
-rw-r--r--third_party/custom_tabs_client/BUILD.gn49
-rw-r--r--tools/android/BUILD.gn7
-rw-r--r--tools/android/customtabs_benchmark/BUILD.gn14
8 files changed, 89 insertions, 6 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 29f8de7..04f54da 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -317,6 +317,7 @@ group("both_gn_and_gyp") {
"//chrome/android:chrome_public_apk",
"//chrome/android:chrome_public_test_apk",
"//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk",
+ "//third_party/custom_tabs_client:custom_tabs_client_example_apk",
]
}
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index bf905ae..ca71105 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -1194,6 +1194,11 @@ template("java_library_impl") {
_requires_android =
defined(invoker.requires_android) && invoker.requires_android
assert(_requires_android || true) # Mark as used.
+ _android_manifest = "//build/android/AndroidManifest.xml"
+ if (defined(invoker.android_manifest)) {
+ _android_manifest = invoker.android_manifest
+ }
+ assert(_android_manifest != "") # Mark as used.
_run_findbugs = defined(invoker.run_findbugs) && invoker.run_findbugs
assert(_run_findbugs || true) # Mark as used.
@@ -1318,11 +1323,6 @@ template("java_library_impl") {
if (_supports_android) {
if (defined(invoker.chromium_code) && invoker.chromium_code) {
- _android_manifest = "//build/android/AndroidManifest.xml"
- if (defined(invoker.android_manifest)) {
- _android_manifest = invoker.android_manifest
- }
-
_final_datadeps += [ ":${_template_name}__lint" ]
android_lint("${_template_name}__lint") {
android_manifest = _android_manifest
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index 16796b6..6c52844 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -1108,6 +1108,7 @@ template("android_java_prebuilt") {
# Variables
# android_manifest: Path to AndroidManifest.xml.
# android_manifest_dep: Target that generates AndroidManifest (if applicable)
+# chromium_code: If true, extra analysis warning/errors will be enabled.
# data_deps: List of dependencies needed at runtime. These will be built but
# won't change the generated .apk in any way (in fact they may be built
# after the .apk is).
@@ -1386,6 +1387,10 @@ template("android_apk") {
android_manifest = _android_manifest
chromium_code = true
+ if (defined(invoker.chromium_code)) {
+ chromium_code = invoker.chromium_code
+ }
+
if (defined(invoker.java_files)) {
java_files = invoker.java_files
} else if (defined(invoker.DEPRECATED_java_in_dir)) {
diff --git a/build/gn_migration.gypi b/build/gn_migration.gypi
index 609f431..4f5a5f6 100644
--- a/build/gn_migration.gypi
+++ b/build/gn_migration.gypi
@@ -357,6 +357,7 @@
'../chrome/chrome.gyp:chrome_public_apk',
'../chrome/chrome.gyp:chrome_public_test_apk',
'../chrome/chrome.gyp:chromedriver_webview_shell_apk',
+ '../third_party/custom_tabs_client/custom_tabs_client.gyp:custom_tabs_client_example_apk',
],
}],
['OS=="android" or OS=="linux"', {
diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/third_party/android_tools/BUILD.gn
index 175409b..e906290 100644
--- a/build/secondary/third_party/android_tools/BUILD.gn
+++ b/build/secondary/third_party/android_tools/BUILD.gn
@@ -49,6 +49,10 @@ android_java_prebuilt("android_support_design_java") {
jar_path = "$android_sdk_root/extras/android/support/design/libs/android-support-design.jar"
}
+android_java_prebuilt("android_support_annotations_javalib") {
+ jar_path = "$android_sdk_root/extras/android/support/annotations/android-support-annotations.jar"
+}
+
java_prebuilt("android_support_multidex_java") {
supports_android = true
jar_path = "$android_sdk_root/extras/android/support/multidex/library/libs/android-support-multidex.jar"
@@ -126,7 +130,9 @@ android_java_prebuilt("google_play_services_default_java") {
# TODO(dgn) deps should not complain about having a custom action here
# Currently, there is no guarantee that the data_deps actions will complete before the current one runs
- data_deps = [ ":check_sdk_extras_version" ]
+ data_deps = [
+ ":check_sdk_extras_version",
+ ]
jar_path = "$android_sdk_root/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar"
}
diff --git a/third_party/custom_tabs_client/BUILD.gn b/third_party/custom_tabs_client/BUILD.gn
new file mode 100644
index 0000000..830c70a8
--- /dev/null
+++ b/third_party/custom_tabs_client/BUILD.gn
@@ -0,0 +1,49 @@
+# 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("//build/config/android/rules.gni")
+
+android_resources("chrome_tabs_client_example_apk_resources") {
+ resource_dirs = [ "src/Application/src/main/res" ]
+ android_manifest = "src/Application/src/main/AndroidManifest.xml"
+ custom_package = "org.chromium.customtabsclient"
+}
+
+android_apk("custom_tabs_client_example_apk") {
+ DEPRECATED_java_in_dir = "src/Application/src/main/java"
+ android_manifest = "src/Application/src/main/AndroidManifest.xml"
+ apk_name = "CustomTabsClientExample"
+ deps = [
+ ":chrome_tabs_client_example_apk_resources",
+ ":custom_tabs_support_lib",
+ ":custom_tabs_client_shared_lib",
+ ]
+ chromium_code = false
+}
+
+android_library("custom_tabs_client_shared_lib") {
+ DEPRECATED_java_in_dir =
+ "src/shared/src/main/java/org/chromium/customtabsclient/shared"
+ deps = [
+ ":custom_tabs_support_lib",
+ ]
+}
+
+android_library("custom_tabs_support_lib") {
+ DEPRECATED_java_in_dir = "src/customtabs/src"
+ deps = [
+ "//third_party/android_tools:android_support_annotations_javalib",
+ ]
+ srcjar_deps = [ ":chrome_custom_tabs_service_aidl" ]
+}
+
+android_aidl("chrome_custom_tabs_service_aidl") {
+ interface_file = "common.aidl"
+
+ java_in_dir = "src/customtabs/src/android/support/customtabs"
+ sources = [
+ "$java_in_dir/ICustomTabsCallback.aidl",
+ "$java_in_dir/ICustomTabsService.aidl",
+ ]
+}
diff --git a/tools/android/BUILD.gn b/tools/android/BUILD.gn
index 0804c19..8f4d085 100644
--- a/tools/android/BUILD.gn
+++ b/tools/android/BUILD.gn
@@ -38,3 +38,10 @@ group("ps_ext") {
"//tools/android/ps_ext",
]
}
+
+# GYP: //tools/android/android_tools.gyp:customtabs_benchmark
+group("customtabs_benchmark") {
+ deps = [
+ "//tools/android/customtabs_benchmark:customtabs_benchmark_apk",
+ ]
+}
diff --git a/tools/android/customtabs_benchmark/BUILD.gn b/tools/android/customtabs_benchmark/BUILD.gn
new file mode 100644
index 0000000..41fb5e2
--- /dev/null
+++ b/tools/android/customtabs_benchmark/BUILD.gn
@@ -0,0 +1,14 @@
+# 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("//build/config/android/rules.gni")
+
+android_apk("customtabs_benchmark_apk") {
+ DEPRECATED_java_in_dir = "java/src"
+ android_manifest = "java/AndroidManifest.xml"
+ apk_name = "CustomTabsBenchmark"
+ deps = [
+ "//third_party/custom_tabs_client:custom_tabs_support_lib",
+ ]
+}