-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android: upgrading to OkHttp from v3 to v4 (#31084)
Summary: Extends #30694 to fix tests. OkHttp v4 was released almost a year ago. Even though v3 is still receiving security and bug fixes, most of the new improvements and features are landing in v4. This PR bumps OkHttp from v3 to v4 and addresses backward-incompatible changes. Side effects of this upgrade: - OkHttp v4 depends on Kotlin's standard library, so react-native will have a transitive dependency on it. - The dex method count of test apk has exceeded the maximum, so multidexing had to be enabled for android tests. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Changed] - Bumping OkHttp from v3 to v4. Pull Request resolved: #31084 Test Plan: Automated (relying on the test suite) and manual testing. Reviewed By: fkgozali Differential Revision: D27597430 Pulled By: ShikaSD fbshipit-source-id: 967379b41c2bcd7cfd4083f65059f5da467b8a91
- Loading branch information
1 parent
0b8731d
commit 8207e97
Showing
9 changed files
with
147 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,46 @@ | ||
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") | ||
load("//tools/build_defs/oss:rn_defs.bzl", "rn_prebuilt_jar") | ||
load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_target", "rn_android_library", "rn_prebuilt_jar") | ||
|
||
rn_prebuilt_jar( | ||
rn_android_library( | ||
name = "okhttp3", | ||
binary_jar = ":okhttp3-binary.jar", | ||
autoglob = False, | ||
visibility = ["//ReactAndroid/..."], | ||
exported_deps = [ | ||
":okhttp3-binary", | ||
react_native_dep("third-party/java/okio:okio"), | ||
# Forces resolver to use OSS Kotlin version | ||
react_native_target("third-party/kotlin:kotlin-stdlib-jdk8"), | ||
], | ||
) | ||
|
||
rn_android_library( | ||
name = "okhttp3-urlconnection", | ||
autoglob = False, | ||
visibility = ["//ReactAndroid/..."], | ||
exported_deps = [ | ||
":okhttp3", | ||
":okhttp3-urlconnection-binary", | ||
], | ||
) | ||
|
||
rn_prebuilt_jar( | ||
name = "okhttp3-binary", | ||
binary_jar = ":okhttp3-binary.jar", | ||
) | ||
|
||
fb_native.remote_file( | ||
name = "okhttp3-binary.jar", | ||
sha1 = "3e6d101343c7ea687cd593e4990f73b25c878383", | ||
url = "mvn:com.squareup.okhttp3:okhttp:jar:3.14.9", | ||
sha1 = "08e17601d3bdc8cf57902c154de021931d2c27c1", | ||
url = "mvn:com.squareup.okhttp3:okhttp:jar:4.9.0", | ||
) | ||
|
||
rn_prebuilt_jar( | ||
name = "okhttp3-urlconnection", | ||
name = "okhttp3-urlconnection-binary", | ||
binary_jar = ":okhttp3-urlconnection-binary.jar", | ||
visibility = ["//ReactAndroid/..."], | ||
) | ||
|
||
fb_native.remote_file( | ||
name = "okhttp3-urlconnection-binary.jar", | ||
sha1 = "c9a3b45b815cf2982415ec8145339f5af58989c3", | ||
url = "mvn:com.squareup.okhttp3:okhttp-urlconnection:jar:3.14.9", | ||
sha1 = "94f82aaabdf53e48d7a1c515bf89ce60dcebfbeb", | ||
url = "mvn:com.squareup.okhttp3:okhttp-urlconnection:jar:4.9.0", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") | ||
load("//tools/build_defs/oss:rn_defs.bzl", "rn_prebuilt_jar") | ||
load("//tools/build_defs/oss:rn_defs.bzl", "react_native_target", "rn_android_library", "rn_prebuilt_jar") | ||
|
||
rn_prebuilt_jar( | ||
rn_android_library( | ||
name = "okio", | ||
binary_jar = ":okio-binary.jar", | ||
autoglob = False, | ||
visibility = ["//ReactAndroid/..."], | ||
exported_deps = [ | ||
":okio-binary", | ||
# Forces resolver to use OSS Kotlin version | ||
react_native_target("third-party/kotlin:kotlin-stdlib"), | ||
], | ||
) | ||
|
||
rn_prebuilt_jar( | ||
name = "okio-binary", | ||
binary_jar = ":okio-binary.jar", | ||
) | ||
|
||
fb_native.remote_file( | ||
name = "okio-binary.jar", | ||
sha1 = "34336f82f14dde1c0752fd5f0546dbf3c3225aba", | ||
url = "mvn:com.squareup.okio:okio:jar:1.17.5", | ||
sha1 = "0dcc813b08ce5933f8bdfd1dfbab4ad4bd170e7a", | ||
url = "mvn:com.squareup.okio:okio:jar:2.9.0", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native") | ||
load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_prebuilt_jar") | ||
|
||
rn_android_library( | ||
name = "kotlin-stdlib", | ||
visibility = ["PUBLIC"], | ||
exported_deps = [ | ||
":jetbrains-annotations", | ||
":kotlin-stdlib-binary", | ||
":kotlin-stdlib-common", | ||
], | ||
) | ||
|
||
rn_android_library( | ||
name = "kotlin-stdlib-jdk7", | ||
visibility = ["PUBLIC"], | ||
exported_deps = [ | ||
":kotlin-stdlib", | ||
":kotlin-stdlib-jdk7-binary", | ||
], | ||
) | ||
|
||
rn_android_library( | ||
name = "kotlin-stdlib-jdk8", | ||
visibility = ["PUBLIC"], | ||
exported_deps = [ | ||
":kotlin-stdlib", | ||
":kotlin-stdlib-jdk7", | ||
":kotlin-stdlib-jdk8-binary", | ||
], | ||
) | ||
|
||
rn_prebuilt_jar( | ||
name = "jetbrains-annotations", | ||
binary_jar = ":jetbrains-annotations.jar", | ||
visibility = ["//ReactAndroid/..."], | ||
) | ||
|
||
fb_native.remote_file( | ||
name = "jetbrains-annotations.jar", | ||
sha1 = "919f0dfe192fb4e063e7dacadee7f8bb9a2672a9", | ||
url = "mvn:org.jetbrains:annotations:jar:13.0", | ||
) | ||
|
||
rn_prebuilt_jar( | ||
name = "kotlin-stdlib-binary", | ||
binary_jar = ":kotlin-stdlib-binary.jar", | ||
visibility = ["//ReactAndroid/..."], | ||
) | ||
|
||
fb_native.remote_file( | ||
name = "kotlin-stdlib-binary.jar", | ||
sha1 = "ea29e063d2bbe695be13e9d044dcfb0c7add398e", | ||
url = "mvn:org.jetbrains.kotlin:kotlin-stdlib:jar:1.4.10", | ||
) | ||
|
||
rn_prebuilt_jar( | ||
name = "kotlin-stdlib-common", | ||
binary_jar = ":kotlin-stdlib-common.jar", | ||
visibility = ["//ReactAndroid/..."], | ||
) | ||
|
||
fb_native.remote_file( | ||
name = "kotlin-stdlib-common.jar", | ||
sha1 = "6229be3465805c99db1142ad75e6c6ddeac0b04c", | ||
url = "mvn:org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.4.10", | ||
) | ||
|
||
rn_prebuilt_jar( | ||
name = "kotlin-stdlib-jdk7-binary", | ||
binary_jar = ":kotlin-stdlib-jdk7-binary.jar", | ||
visibility = ["//ReactAndroid/..."], | ||
) | ||
|
||
fb_native.remote_file( | ||
name = "kotlin-stdlib-jdk7-binary.jar", | ||
sha1 = "30e46450b0bb3dbf43898d2f461be4a942784780", | ||
url = "mvn:org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.4.10", | ||
) | ||
|
||
rn_prebuilt_jar( | ||
name = "kotlin-stdlib-jdk8-binary", | ||
binary_jar = ":kotlin-stdlib-jdk8-binary.jar", | ||
visibility = ["//ReactAndroid/..."], | ||
) | ||
|
||
fb_native.remote_file( | ||
name = "kotlin-stdlib-jdk8-binary.jar", | ||
sha1 = "998caa30623f73223194a8b657abd2baec4880ea", | ||
url = "mvn:org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.4.10", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters