1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-12 10:23:16 +03:00

Merge pull request #5256 from square/jwilson.0701.java8

Add a note on Java 8 to the upgrade guide
This commit is contained in:
Jesse Wilson
2019-07-02 17:34:21 -04:00
committed by GitHub
2 changed files with 37 additions and 1 deletions

View File

@@ -1812,7 +1812,7 @@ Initial release.
[conscrypt]: https://github.com/google/conscrypt/
[conscrypt_dependency]: https://github.com/google/conscrypt/#download
[https_server_sample]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/HttpsServer.java
[require_android_5]: https://medium.com/square-corner-blog/okhttp-3-13-requires-android-5-818bb78d07ce
[require_android_5]: https://cashapp.github.io/2019-02-05/okhttp-3-13-requires-android-5
[obsolete_apache_client]: https://gist.github.com/swankjesse/09721f72039e3a46cf50f94323deb82d
[obsolete_url_factory]: https://gist.github.com/swankjesse/dd91c0a8854e1559b00f5fc9c7bfae70
[tls_configuration_history]: https://square.github.io/okhttp/tls_configuration_history/

View File

@@ -233,6 +233,41 @@ between ProGuard, OkHttp 4.x, and Kotlin-originated `.class` files. Make sure yo
release if youre using ProGuard,
Gradle
------
OkHttp 4s minimum requirements are Java 8+ and Android 5+. These requirements were
[first introduced][require_android_5] with OkHttp 3.13.
Heres what you need in `build.gradle` to target Java 8 byte code for Kotlin, Java, and Android
plugins respectively.
```
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
```
[advanced_profiling_bug]: https://issuetracker.google.com/issues/135141615
[japicmp]: https://github.com/siom79/japicmp
[japicmp_gradle]: https://github.com/melix/japicmp-gradle-plugin
@@ -240,4 +275,5 @@ release if youre using ProGuard,
[kotlin_sams]: https://youtrack.jetbrains.com/issue/KT-11129
[mockito]: https://site.mockito.org/
[proguard_problems]: https://github.com/square/okhttp/issues/5167
[require_android_5]: https://cashapp.github.io/2019-02-05/okhttp-3-13-requires-android-5
[r8]: https://developer.android.com/studio/releases#r8-default