diff options
-rw-r--r-- | BUILD.gn | 1 | ||||
-rw-r--r-- | build/config/android/internal_rules.gni | 10 | ||||
-rw-r--r-- | build/config/android/rules.gni | 5 | ||||
-rw-r--r-- | build/gn_migration.gypi | 1 | ||||
-rw-r--r-- | build/secondary/third_party/android_tools/BUILD.gn | 8 | ||||
-rw-r--r-- | third_party/custom_tabs_client/BUILD.gn | 49 | ||||
-rw-r--r-- | tools/android/BUILD.gn | 7 | ||||
-rw-r--r-- | tools/android/customtabs_benchmark/BUILD.gn | 14 |
8 files changed, 89 insertions, 6 deletions
@@ -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", + ] +} |