Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
contents: read

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
publish:
Expand Down
11 changes: 8 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import com.vanniktech.maven.publish.SonatypeHost
import java.net.URI
import kotlinx.validation.ApiValidationExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import ru.vyarus.gradle.plugin.animalsniffer.AnimalSnifferExtension
Expand Down Expand Up @@ -143,8 +145,8 @@ subprojects {
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs = listOf(
"-Xjvm-default=all",
)
Expand Down Expand Up @@ -179,6 +181,10 @@ subprojects {

maxParallelForks = Runtime.getRuntime().availableProcessors() * 2
testLogging {
if (System.getenv("CI") != null) {
events = setOf(TestLogEvent.FAILED)
info.events = setOf(TestLogEvent.FAILED)
}
exceptionFormat = TestExceptionFormat.FULL
}

Expand Down Expand Up @@ -254,7 +260,6 @@ subprojects {
}

plugins.withId("com.vanniktech.maven.publish.base") {
val publishingExtension = extensions.getByType(PublishingExtension::class.java)
configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.S01, automaticRelease = true)
signAllPublications()
Expand Down
27 changes: 21 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
org.gradle.caching=true
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
kotlin.mpp.stability.nowarn=true
kotlin.js.compiler=ir
kotlin.incremental.js.ir=true
androidBuild=false
graalBuild=false
loomBuild=false
containerTests=false
android.experimental.lint.version=8.2.0

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Ensure important default jvmargs aren't overwritten. See https://github.com/gradle/gradle/issues/19750
#
# For more information about how Gradle memory options were chosen:
# - Metaspace See https://www.jasonpearson.dev/metaspace-in-jvm-builds/
# - SoftRefLRUPolicyMSPerMB would default to 1000 which with a 4gb heap translates to ~51 minutes.
# A value of 1 means ~4 seconds before SoftRefs can be collected, which means its realistic to
# collect them as needed during a build that should take seconds to minutes.
# - CodeCache normally defaults to a very small size. Increasing it from platform defaults of 32-48m
# because of how many classes can be loaded into memory and then cached as native compiled code
# for a small speed boost.
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx2g -Xms2g

# For more information about how Kotlin Daemon memory options were chosen:
# - Kotlin JVM args only inherit Xmx, ReservedCodeCache, and MaxMetaspace. Since we are specifying
# other args we need to specify all of them here.
# - We're using the Kotlin Gradle Plugin's default value for ReservedCodeCacheSize, if we do not then
# the Gradle JVM arg value for ReservedCodeCacheSize will be used.
kotlin.daemon.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=320m -XX:+HeapDumpOnOutOfMemoryError -Xmx2g -Xms2g
15 changes: 8 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
[versions]
# 7.0.0 is JDK 17+ https://github.com/bndtools/bnd/wiki/Changes-in-7.0.0
biz-aQute-bnd = "6.4.0"
checkStyle = "10.20.2"
com-squareup-moshi = "1.15.1"
com-squareup-okio = "3.9.1"
de-mannodermaus-junit5 = "1.6.0"
graalvm = "22.3.2"
kotlinx-serialization = "1.6.3"
ksp = "1.9.24-1.0.20"
kotlinx-serialization = "1.7.3"
ksp = "2.1.0-1.0.29"
mockserverClient = "5.15.0"
org-bouncycastle = "1.76"
org-conscrypt = "2.5.2"
org-jetbrains-coroutines = "1.8.1"
org-jetbrains-kotlin = "1.9.25"
org-jetbrains-coroutines = "1.9.0"
org-jetbrains-kotlin = "2.1.0"
org-junit-jupiter = "5.11.3"
retrofit = "2.11.0"
testcontainers = "1.20.4"
Expand All @@ -38,7 +39,7 @@ conscrypt-openjdk = { module = "org.conscrypt:conscrypt-openjdk-uber", version.r
converter-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofit" }
eclipseOsgi = "org.eclipse.platform:org.eclipse.osgi:3.21.0"
findbugs-jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
gradlePlugin-android = "com.android.tools.build:gradle:8.2.0"
gradlePlugin-android = "com.android.tools.build:gradle:8.7.3"
gradlePlugin-androidJunit5 = "de.mannodermaus.gradle.plugins:android-junit5:1.11.2.0"
gradlePlugin-animalsniffer = "ru.vyarus:gradle-animalsniffer-plugin:1.7.2"
gradlePlugin-binaryCompatibilityValidator = "org.jetbrains.kotlinx.binary-compatibility-validator:org.jetbrains.kotlinx.binary-compatibility-validator.gradle.plugin:0.16.3"
Expand Down Expand Up @@ -87,14 +88,14 @@ openjsse = "org.openjsse:openjsse:1.1.14"
playservices-safetynet = "com.google.android.gms:play-services-safetynet:18.1.0"
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
robolectric-android = "org.robolectric:android-all:14-robolectric-10818077"
robolectric = "org.robolectric:robolectric:4.12.2"
robolectric = "org.robolectric:robolectric:4.14.1"
signature-android-apilevel21 = "net.sf.androidscents.signature:android-api-level-21:5.0.1_r2"
signature-android-apilevel24 = "net.sf.androidscents.signature:android-api-level-24:7.0_r2"
squareup-moshi = { module = "com.squareup.moshi:moshi", version.ref = "com-squareup-moshi" }
squareup-moshi-compiler = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "com-squareup-moshi" }
squareup-moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "com-squareup-moshi" }
squareup-okhttp-icu = "com.squareup.okhttpicu:okhttp-icu:0.2.0"
squareup-kotlinPoet = "com.squareup:kotlinpoet:1.17.0"
squareup-kotlinPoet = "com.squareup:kotlinpoet:1.18.1"
squareup-okio = { module = "com.squareup.okio:okio", version.ref = "com-squareup-okio" }
squareup-okio-fakefilesystem = { module = "com.squareup.okio:okio-fakefilesystem", version.ref = "com-squareup-okio" }
squareup-okio-nodefilesystem = { module = "com.squareup.okio:okio-nodefilesystem", version.ref = "com-squareup-okio" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion okcurl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {

val copyResourcesTemplates = tasks.register<Copy>("copyResourcesTemplates") {
from("src/main/resources-templates")
into("$buildDir/generated/resources-templates")
into(layout.buildDirectory.dir("generated/resources-templates"))
expand("projectVersion" to "${project.version}")
filteringCharset = Charsets.UTF_8.toString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*
*/
@file:OptIn(ExperimentalCoroutinesApi::class)

package okhttp3.coroutines

import assertk.assertThat
Expand All @@ -25,6 +27,7 @@ import kotlin.test.assertFailsWith
import kotlin.time.Duration.Companion.seconds
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.TimeoutCancellationException
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.job
Expand Down
8 changes: 4 additions & 4 deletions okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fun ByteArray.toByteStringExpression(): String {

val copyKotlinTemplates = tasks.register<Copy>("copyKotlinTemplates") {
from("src/main/kotlinTemplates")
into("$buildDir/generated/sources/kotlinTemplates")
into(layout.buildDirectory.dir("generated/sources/kotlinTemplates"))

// Tag as an input to regenerate after an update
inputs.file("src/test/resources/okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz")
Expand All @@ -44,9 +44,9 @@ dependencies {
generateIdnaMappingTableConfiguration(projects.okhttpIdnaMappingTable)
}
val generateIdnaMappingTable by tasks.creating(JavaExec::class.java) {
outputs.dir("$buildDir/generated/sources/idnaMappingTable")
outputs.dir(layout.buildDirectory.dir("generated/sources/idnaMappingTable"))
mainClass.set("okhttp3.internal.idn.GenerateIdnaMappingTableCode")
args("$buildDir/generated/sources/idnaMappingTable")
args(layout.buildDirectory.dir("generated/sources/idnaMappingTable").get())
classpath = generateIdnaMappingTableConfiguration
}

Expand Down Expand Up @@ -109,7 +109,7 @@ val osgiTestDeploy: Configuration by configurations.creating

val copyOsgiTestDeployment by tasks.creating(Copy::class.java) {
from(osgiTestDeploy)
into("$buildDir/resources/test/okhttp3/osgi/deployments")
into(layout.buildDirectory.dir("resources/test/okhttp3/osgi/deployments"))
}
tasks.getByName("test") {
dependsOn(copyOsgiTestDeployment)
Expand Down