Skip to content

Commit

Permalink
Target Java 8 bytecode for Java and Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Jun 26, 2019
1 parent 3217919 commit 0bdd679
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ subprojects { project ->
}
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}

def platform = System.getProperty("okhttp.platform", "jdk8")

test {
Expand Down Expand Up @@ -149,6 +155,9 @@ subprojects { project ->
errorprone 'com.google.errorprone:error_prone_core:2.3.3'
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

options.errorprone {
check("MissingFail", CheckSeverity.ERROR)
check("MissingOverride", CheckSeverity.ERROR)
Expand Down
2 changes: 2 additions & 0 deletions okhttp/src/main/java/okhttp3/Cookie.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import okhttp3.internal.indexOfControlOrNonAscii
import okhttp3.internal.publicsuffix.PublicSuffixDatabase
import okhttp3.internal.toCanonicalHost
import okhttp3.internal.trimSubstring
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
import java.util.Calendar
import java.util.Collections
import java.util.Date
Expand Down Expand Up @@ -124,6 +125,7 @@ class Cookie private constructor(
other.hostOnly == hostOnly
}

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

0 comments on commit 0bdd679

Please sign in to comment.