Commit bd0d9e57 authored by Ben Joyce's avatar Ben Joyce Committed by Commit Bot

Third-party: Add androidx.concurrent-futures and guava listenablefutures.

This is necessary for androidx.browser.
Androidx.browser provides the Android APIs that allow us to support Custom Tabs and
Trusted Web Activities - it's basically the new version of custom_tabs_client. Since
androidx.browser is an Android API, it must adhere to their API guidelines,
which involves using ListenableFuture instead of accepting Callbacks(see b/138381050)

Bug: 1016484
Change-Id: I1f0dde3533b6b03c5976ea85397d25e509600917
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872642Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: benjamin joyce <bjoyce@google.com>
Cr-Commit-Position: refs/heads/master@{#714412}
parent 8db3c502
......@@ -1733,6 +1733,17 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/androidx_concurrent_concurrent_futures': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/androidx_concurrent_concurrent_futures',
'version': 'version:1.0.0-cr0',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/androidx_coordinatorlayout_coordinatorlayout': {
'packages': [
{
......@@ -2965,6 +2976,17 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_google_guava_listenablefuture': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_guava_listenablefuture',
'version': 'version:1.0-cr0',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_google_j2objc_j2objc_annotations': {
'packages': [
{
......
......@@ -162,6 +162,18 @@ java_prebuilt("androidx_collection_collection_java") {
]
}
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
java_prebuilt("androidx_concurrent_concurrent_futures_java") {
jar_path =
"libs/androidx_concurrent_concurrent_futures/concurrent-futures-1.0.0.jar"
output_name = "androidx_concurrent_concurrent_futures"
supports_android = true
deps = [
":androidx_annotation_annotation_java",
":com_google_guava_listenablefuture_java",
]
}
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
android_aar_prebuilt("androidx_coordinatorlayout_coordinatorlayout_java") {
aar_path = "libs/androidx_coordinatorlayout_coordinatorlayout/coordinatorlayout-1.0.0.aar"
......@@ -1063,6 +1075,13 @@ java_prebuilt("com_google_dagger_dagger_compiler_java") {
]
}
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
java_prebuilt("com_google_guava_listenablefuture_java") {
jar_path = "libs/com_google_guava_listenablefuture/listenablefuture-1.0.jar"
output_name = "com_google_guava_listenablefuture"
supports_android = true
}
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
java_prebuilt("com_google_protobuf_protobuf_lite_java") {
jar_path = "libs/com_google_protobuf_protobuf_lite/protobuf-lite-3.0.1.jar"
......@@ -1794,6 +1813,8 @@ java_prebuilt("com_google_guava_guava_java") {
":org_checkerframework_checker_compat_qual_java",
":org_codehaus_mojo_animal_sniffer_annotations_java",
]
deps += [ ":com_google_guava_listenablefuture_java" ]
jar_excluded_patterns = [ "*/ListenableFuture.class" ]
}
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
......
......@@ -14,6 +14,7 @@
"libs/androidx_asynclayoutinflater_asynclayoutinflater",
"libs/androidx_cardview_cardview",
"libs/androidx_collection_collection",
"libs/androidx_concurrent_concurrent_futures",
"libs/androidx_coordinatorlayout_coordinatorlayout",
"libs/androidx_core_core",
"libs/androidx_cursoradapter_cursoradapter",
......@@ -126,6 +127,7 @@
"libs/com_google_errorprone_javac_shaded",
"libs/com_google_googlejavaformat_google_java_format",
"libs/com_google_guava_guava",
"libs/com_google_guava_listenablefuture",
"libs/com_google_j2objc_j2objc_annotations",
"libs/com_google_protobuf_protobuf_lite",
"libs/com_squareup_javapoet",
......
file://third_party/android_deps/OWNERS
\ No newline at end of file
Name: AndroidX Futures
Short Name: concurrent-futures
URL: https://developer.android.com/topic/libraries/architecture/index.html
Version: 1.0.0
License: Apache Version 2.0
License File: LICENSE
Security Critical: yes
Description:
Androidx implementation of Guava's ListenableFuture
Local Modifications:
No modifications.
# Copyright 2018 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.
# To create CIPD package run the following command.
# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0
package: chromium/third_party/android_deps/libs/androidx_concurrent_concurrent_futures
description: "AndroidX Futures"
data:
- file: concurrent-futures-1.0.0.jar
......@@ -2,7 +2,7 @@ Name: Error Prone shaded javac
Short Name: javac-shaded
URL: https://github.com/google/error-prone-javac
Version: 9-dev-r4023-3
License: GNU General Public License, version 2, with the Classpath Exception
License: GPL v2 with the classpath exception
License File: NOT_SHIPPED
Security Critical: no
......
file://third_party/android_deps/OWNERS
\ No newline at end of file
Name: Guava ListenableFuture only
Short Name: listenablefuture
URL: https://github.com/google/guava
Version: 1.0
License: Apache 2.0
License File: LICENSE
Security Critical: yes
Description:
Contains Guava's com.google.common.util.concurrent.ListenableFuture class, without any of its other classes -- but is also available in a second "version" that omits the class to avoid conflicts with the copy in Guava itself. The idea is: - If users want only ListenableFuture, they depend on listenablefuture-1.0. - If users want all of Guava, they depend on guava, which, as of Guava 27.0, depends on listenablefuture-9999.0-empty-to-avoid-conflict-with-guava. The 9999.0-... version number is enough for some build systems (notably, Gradle) to select that empty artifact over the "real" listenablefuture-1.0 -- avoiding a conflict with the copy of ListenableFuture in guava itself. If users are using an older version of Guava or a build system other than Gradle, they may see class conflicts. If so, they can solve them by manually excluding the listenablefuture artifact or manually forcing their build systems to use 9999.0-....
Local Modifications:
No modifications.
# Copyright 2018 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.
# To create CIPD package run the following command.
# cipd create --pkg-def cipd.yaml -tag version:1.0-cr0
package: chromium/third_party/android_deps/libs/com_google_guava_listenablefuture
description: "Guava ListenableFuture only"
data:
- file: listenablefuture-1.0.jar
......@@ -15,6 +15,14 @@ android_java_prebuilt("guava_android_java") {
# Avoids dependency cycle.
no_build_hooks = true
# Depend on this to replace excluded ListenableFuture.class
deps = [
"//third_party/android_deps:com_google_guava_listenablefuture_java",
]
# Avoid class conflict in com_google_guava_listenablefuture.
jar_excluded_patterns = [ "*/ListenableFuture.class" ]
}
java_prebuilt("guava_java") {
......
......@@ -32,6 +32,7 @@ dependencies {
compile "androidx.appcompat:appcompat:${androidXSupportLibVersion}"
compile "androidx.asynclayoutinflater:asynclayoutinflater:${androidXSupportLibVersion}"
compile "androidx.cardview:cardview:${androidXSupportLibVersion}"
compile "androidx.concurrent:concurrent-futures:${androidXSupportLibVersion}"
compile "androidx.collection:collection:${androidXSupportLibVersion}"
compile "androidx.coordinatorlayout:coordinatorlayout:${androidXSupportLibVersion}"
compile "androidx.customview:customview:${androidXSupportLibVersion}"
......@@ -126,6 +127,9 @@ dependencies {
// Matches version depended on by Dagger.
buildCompile "com.squareup:javapoet:1.11.0"
compile "com.google.guava:listenablefuture:1.0"
compile "com.google.protobuf:protobuf-lite:3.0.1"
// testCompile targets have test_only = true.
testCompile "androidx.test:core:1.0.0"
testCompile "androidx.test:monitor:1.1.0"
......
......@@ -308,6 +308,12 @@ class BuildConfigGenerator extends DefaultTask {
// and android_aar_prebuilt template will fail if it's not set explictly.
sb.append(' extract_native_libraries = true\n')
break
case 'com_google_guava_guava':
// Need to exclude class and replace it with class library as
// com_google_guava_listenablefuture has support_androids=true.
sb.append(' deps += [":com_google_guava_listenablefuture_java"]\n')
sb.append(' jar_excluded_patterns = ["*/ListenableFuture.class"]\n')
break
case 'androidx_test_rules':
// Target needs Android SDK deps which exist in third_party/android_sdk.
sb.append("""\
......
......@@ -36,6 +36,10 @@ class ChromiumDepGraph {
url: "https://github.com/google/guava",
licenseUrl: "https://www.apache.org/licenses/LICENSE-2.0.txt",
licenseName: "Apache 2.0"),
'com_google_guava_listenablefuture': new PropertyOverride(
url: "https://github.com/google/guava",
licenseUrl: "https://www.apache.org/licenses/LICENSE-2.0.txt",
licenseName: "Apache 2.0"),
'org_codehaus_mojo_animal_sniffer_annotations': new PropertyOverride(
url: "http://www.mojohaus.org/animal-sniffer/animal-sniffer-annotations/",
licenseUrl: "https://raw.githubusercontent.com/mojohaus/animal-sniffer/master/animal-sniffer-annotations/pom.xml",
......
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