From d33e4c7edb434fe5efab67a733bec33e0d85722a Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 10:42:22 +0000 Subject: [PATCH 01/13] Dependency bumps --- build.gradle.kts | 6 +++--- buildSrc/build.gradle.kts | 2 +- gradle.properties | 27 ++++++++++++++++++------ gradle/libs.versions.toml | 16 +++++++------- gradle/wrapper/gradle-wrapper.properties | 2 +- okcurl/build.gradle.kts | 2 +- okhttp/build.gradle.kts | 8 +++---- 7 files changed, 39 insertions(+), 24 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 42c6bdee9feb..1dd1718818a2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,6 +7,7 @@ import java.net.URI import kotlinx.validation.ApiValidationExtension import org.gradle.api.tasks.testing.logging.TestExceptionFormat 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 @@ -143,8 +144,8 @@ subprojects { } tasks.withType { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) freeCompilerArgs = listOf( "-Xjvm-default=all", ) @@ -254,7 +255,6 @@ subprojects { } plugins.withId("com.vanniktech.maven.publish.base") { - val publishingExtension = extensions.getByType(PublishingExtension::class.java) configure { publishToMavenCentral(SonatypeHost.S01, automaticRelease = true) signAllPublications() diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index e30c56b5d823..f11fa23d97e2 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -23,5 +23,5 @@ repositories { } dependencies { - implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0") + implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:7.1.0") } diff --git a/gradle.properties b/gradle.properties index d963d6a5a396..b35a38eaab04 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 -Xmx4g -Xms4g + +# 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 -Xmx4g -Xms4g diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f4b21b528d05..99e3215de468 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,17 +1,17 @@ [versions] -biz-aQute-bnd = "6.4.0" +biz-aQute-bnd = "7.1.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" @@ -38,7 +38,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" @@ -87,14 +87,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" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e6aba2515d54..c1d5e0185987 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/okcurl/build.gradle.kts b/okcurl/build.gradle.kts index 77734c77c77d..a03c4dc1b125 100644 --- a/okcurl/build.gradle.kts +++ b/okcurl/build.gradle.kts @@ -12,7 +12,7 @@ plugins { val copyResourcesTemplates = tasks.register("copyResourcesTemplates") { from("src/main/resources-templates") - into("$buildDir/generated/resources-templates") + into("${layout.buildDirectory}/generated/resources-templates") expand("projectVersion" to "${project.version}") filteringCharset = Charsets.UTF_8.toString() } diff --git a/okhttp/build.gradle.kts b/okhttp/build.gradle.kts index 084db6e649d4..31ebd175bf27 100644 --- a/okhttp/build.gradle.kts +++ b/okhttp/build.gradle.kts @@ -19,7 +19,7 @@ fun ByteArray.toByteStringExpression(): String { val copyKotlinTemplates = tasks.register("copyKotlinTemplates") { from("src/main/kotlinTemplates") - into("$buildDir/generated/sources/kotlinTemplates") + into("${layout.buildDirectory}/generated/sources/kotlinTemplates") // Tag as an input to regenerate after an update inputs.file("src/test/resources/okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz") @@ -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}/generated/sources/idnaMappingTable") mainClass.set("okhttp3.internal.idn.GenerateIdnaMappingTableCode") - args("$buildDir/generated/sources/idnaMappingTable") + args("${layout.buildDirectory}/generated/sources/idnaMappingTable") classpath = generateIdnaMappingTableConfiguration } @@ -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}/resources/test/okhttp3/osgi/deployments") } tasks.getByName("test") { dependsOn(copyOsgiTestDeployment) From 24fe24c605d5b0c241d8a4233991c53460652e90 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 11:29:51 +0000 Subject: [PATCH 02/13] Fix build --- okcurl/build.gradle.kts | 2 +- okhttp/build.gradle.kts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/okcurl/build.gradle.kts b/okcurl/build.gradle.kts index a03c4dc1b125..868ee0ee0d71 100644 --- a/okcurl/build.gradle.kts +++ b/okcurl/build.gradle.kts @@ -12,7 +12,7 @@ plugins { val copyResourcesTemplates = tasks.register("copyResourcesTemplates") { from("src/main/resources-templates") - into("${layout.buildDirectory}/generated/resources-templates") + into(layout.buildDirectory.dir("generated/resources-templates")) expand("projectVersion" to "${project.version}") filteringCharset = Charsets.UTF_8.toString() } diff --git a/okhttp/build.gradle.kts b/okhttp/build.gradle.kts index 31ebd175bf27..60a7aa6cf63c 100644 --- a/okhttp/build.gradle.kts +++ b/okhttp/build.gradle.kts @@ -19,7 +19,7 @@ fun ByteArray.toByteStringExpression(): String { val copyKotlinTemplates = tasks.register("copyKotlinTemplates") { from("src/main/kotlinTemplates") - into("${layout.buildDirectory}/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") @@ -44,9 +44,9 @@ dependencies { generateIdnaMappingTableConfiguration(projects.okhttpIdnaMappingTable) } val generateIdnaMappingTable by tasks.creating(JavaExec::class.java) { - outputs.dir("${layout.buildDirectory}/generated/sources/idnaMappingTable") + outputs.dir(layout.buildDirectory.dir("generated/sources/idnaMappingTable")) mainClass.set("okhttp3.internal.idn.GenerateIdnaMappingTableCode") - args("${layout.buildDirectory}/generated/sources/idnaMappingTable") + args(layout.buildDirectory.dir("generated/sources/idnaMappingTable").get()) classpath = generateIdnaMappingTableConfiguration } @@ -109,7 +109,7 @@ val osgiTestDeploy: Configuration by configurations.creating val copyOsgiTestDeployment by tasks.creating(Copy::class.java) { from(osgiTestDeploy) - into("${layout.buildDirectory}/resources/test/okhttp3/osgi/deployments") + into(layout.buildDirectory.dir("resources/test/okhttp3/osgi/deployments")) } tasks.getByName("test") { dependsOn(copyOsgiTestDeployment) From 61b1e3707a6c36262e899dd1b9471b91f227bee4 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 11:47:16 +0000 Subject: [PATCH 03/13] Output the failures in logging --- build.gradle.kts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 1dd1718818a2..2ce3314feb18 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,7 @@ 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 @@ -180,6 +181,9 @@ subprojects { maxParallelForks = Runtime.getRuntime().availableProcessors() * 2 testLogging { + if (System.getenv("CI") != null) { + events = setOf(TestLogEvent.FAILED) + } exceptionFormat = TestExceptionFormat.FULL } From fb4395b6809839bf58009bd464a0ec7bb86e3177 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 12:14:52 +0000 Subject: [PATCH 04/13] Output the failures in logging --- build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle.kts b/build.gradle.kts index 2ce3314feb18..d200887cce5d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -183,6 +183,7 @@ subprojects { testLogging { if (System.getenv("CI") != null) { events = setOf(TestLogEvent.FAILED) + info.events = setOf(TestLogEvent.FAILED) } exceptionFormat = TestExceptionFormat.FULL } From 2ae197c2ceab81b9f9c0929ae1399ceb59ed2239 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 13:57:16 +0000 Subject: [PATCH 05/13] Testing logging failures --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72cc4c33c378..4326a6df0088 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: run: ./gradlew test -Dtest.java.version=11 - name: Publish Test Report - if: github.repository == 'square/okhttp' && github.ref == 'refs/heads/master' +# if: github.repository == 'square/okhttp' && github.ref == 'refs/heads/master' uses: mikepenz/action-junit-report@v4 with: report_paths: '**/build/test-results/*/TEST-*.xml' @@ -122,7 +122,7 @@ jobs: - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 - if: github.repository == 'square/okhttp' && github.ref == 'refs/heads/master' +# if: github.repository == 'square/okhttp' && github.ref == 'refs/heads/master' with: files: | **/build/test-results/*/TEST-*.xml From 8321e5af2f74538f76ce06dae966e2602388f17f Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 13:57:51 +0000 Subject: [PATCH 06/13] Testing logging failures --- .../src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt b/okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt index 6f436ba0bf60..1a4d252ec1d2 100644 --- a/okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt +++ b/okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt @@ -14,6 +14,8 @@ * limitations under the License. * */ +@file:OptIn(ExperimentalCoroutinesApi::class) + package okhttp3.coroutines import assertk.assertThat @@ -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 From 81864e329278c72151209ae47577bc660d64632b Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 14:23:31 +0000 Subject: [PATCH 07/13] Testing logging failures --- .github/workflows/build.yml | 4 ++-- gradle.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4326a6df0088..72cc4c33c378 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: run: ./gradlew test -Dtest.java.version=11 - name: Publish Test Report -# if: github.repository == 'square/okhttp' && github.ref == 'refs/heads/master' + if: github.repository == 'square/okhttp' && github.ref == 'refs/heads/master' uses: mikepenz/action-junit-report@v4 with: report_paths: '**/build/test-results/*/TEST-*.xml' @@ -122,7 +122,7 @@ jobs: - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 -# if: github.repository == 'square/okhttp' && github.ref == 'refs/heads/master' + if: github.repository == 'square/okhttp' && github.ref == 'refs/heads/master' with: files: | **/build/test-results/*/TEST-*.xml diff --git a/gradle.properties b/gradle.properties index b35a38eaab04..94aba30277b8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,11 +18,11 @@ containerTests=false # - 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 -Xmx4g -Xms4g +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 -Xmx4g -Xms4g +kotlin.daemon.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=320m -XX:+HeapDumpOnOutOfMemoryError -Xmx2g -Xms2g From 0e5a5e68fc35d3da075c29f49fbc2ca5834b0c89 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 14:31:55 +0000 Subject: [PATCH 08/13] Testing logging failures --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 94aba30277b8..0f0008a4fd8b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,11 +18,11 @@ containerTests=false # - 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 +org.gradle.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xms1g # 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 +kotlin.daemon.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=320m -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xms1g From 65a10fa5ff9512cd8b5c892968d6ce63b6935aef Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 14:33:52 +0000 Subject: [PATCH 09/13] Testing logging failures --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72cc4c33c378..9c9a672111e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: From dd052485bd1f4c64a2bedc996efc5a0e410463c5 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 15:13:21 +0000 Subject: [PATCH 10/13] Revert bnd bump --- gradle/libs.versions.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 99e3215de468..8f30028e5411 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,6 @@ [versions] -biz-aQute-bnd = "7.1.0" +# 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" From 2f01501bb6ecb2bccd007507b1fef3d2cb9f07a1 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 7 Dec 2024 15:15:41 +0000 Subject: [PATCH 11/13] bump memory back a bit --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0f0008a4fd8b..94aba30277b8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,11 +18,11 @@ containerTests=false # - 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 -Xmx1g -Xms1g +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 -Xmx1g -Xms1g +kotlin.daemon.jvmargs=-Dfile.encoding=UTF-8 -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=1 -XX:ReservedCodeCacheSize=320m -XX:+HeapDumpOnOutOfMemoryError -Xmx2g -Xms2g From 289ff5092b51dbb467d371abec61b477e0318ef0 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sun, 8 Dec 2024 11:00:44 +0000 Subject: [PATCH 12/13] Update build.gradle.kts --- buildSrc/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index f11fa23d97e2..e30c56b5d823 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -23,5 +23,5 @@ repositories { } dependencies { - implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:7.1.0") + implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0") } From d01abb1581a4e413184752841fdfd5df3f2ce1e5 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sun, 8 Dec 2024 14:48:28 +0000 Subject: [PATCH 13/13] Revert back some changes --- .github/workflows/build.yml | 2 +- build.gradle.kts | 8 ++------ buildSrc/build.gradle.kts | 6 +++++- gradle.properties | 23 +++-------------------- 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c9a672111e0..72cc4c33c378 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ permissions: contents: read env: - GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false" + GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" jobs: publish: diff --git a/build.gradle.kts b/build.gradle.kts index d200887cce5d..3f316981fb88 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,15 +3,14 @@ import com.diffplug.gradle.spotless.SpotlessExtension import com.vanniktech.maven.publish.MavenPublishBaseExtension 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 +import java.net.URI buildscript { dependencies { @@ -181,10 +180,6 @@ subprojects { maxParallelForks = Runtime.getRuntime().availableProcessors() * 2 testLogging { - if (System.getenv("CI") != null) { - events = setOf(TestLogEvent.FAILED) - info.events = setOf(TestLogEvent.FAILED) - } exceptionFormat = TestExceptionFormat.FULL } @@ -260,6 +255,7 @@ subprojects { } plugins.withId("com.vanniktech.maven.publish.base") { + val publishingExtension = extensions.getByType(PublishingExtension::class.java) configure { publishToMavenCentral(SonatypeHost.S01, automaticRelease = true) signAllPublications() diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index e30c56b5d823..90a3bde87bea 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -23,5 +23,9 @@ repositories { } dependencies { - implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0") + // TODO (https://github.com/square/okhttp/issues/8612) we will need a consistent version + // 7.1.0 is used because it avoids this error + // Could not create an instance of type aQute.bnd.gradle.BundleTaskExtension. + // Cannot change attributes of configuration ':native-image-tests:compileClasspath' after it has been locked for mutation + implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:7.1.0") } diff --git a/gradle.properties b/gradle.properties index 94aba30277b8..c7af0b38dfb6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,28 +1,11 @@ org.gradle.caching=true org.gradle.parallel=true + android.useAndroidX=true + androidBuild=false graalBuild=false loomBuild=false containerTests=false -# 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 +org.gradle.jvmargs='-Dfile.encoding=UTF-8'