Skip to content

Commit 24c0575

Browse files
authored
Merge pull request #5238 from square/jakew/eight/2019-06-25
Target Java 8 bytecode for Java and Kotlin
2 parents 3217919 + 0bdd679 commit 24c0575

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ subprojects { project ->
115115
}
116116
}
117117

118+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
119+
kotlinOptions {
120+
jvmTarget = "1.8"
121+
}
122+
}
123+
118124
def platform = System.getProperty("okhttp.platform", "jdk8")
119125

120126
test {
@@ -149,6 +155,9 @@ subprojects { project ->
149155
errorprone 'com.google.errorprone:error_prone_core:2.3.3'
150156
}
151157
tasks.withType(JavaCompile).configureEach {
158+
sourceCompatibility = JavaVersion.VERSION_1_8
159+
targetCompatibility = JavaVersion.VERSION_1_8
160+
152161
options.errorprone {
153162
check("MissingFail", CheckSeverity.ERROR)
154163
check("MissingOverride", CheckSeverity.ERROR)

okhttp/src/main/java/okhttp3/Cookie.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import okhttp3.internal.indexOfControlOrNonAscii
2424
import okhttp3.internal.publicsuffix.PublicSuffixDatabase
2525
import okhttp3.internal.toCanonicalHost
2626
import okhttp3.internal.trimSubstring
27+
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
2728
import java.util.Calendar
2829
import java.util.Collections
2930
import java.util.Date
@@ -124,6 +125,7 @@ class Cookie private constructor(
124125
other.hostOnly == hostOnly
125126
}
126127

128+
@IgnoreJRERequirement // As of AGP 3.4.1, D8 desugars API 24 hashCode methods.
127129
override fun hashCode(): Int {
128130
var result = 17
129131
result = 31 * result + name.hashCode()

0 commit comments

Comments
 (0)