From ad1ded8342966532f58c41eba7ebdb3bb3ec7466 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2026 14:48:48 +0000 Subject: [PATCH 1/4] Update squareup.leakcanary to v3.0-alpha-9 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b8319d593..2fcc00329 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -81,7 +81,7 @@ rxjava2-core = "2.2.21" squareup-curtains = "1.2.5" squareup-cycler = "0.1.9" -squareup-leakcanary = "3.0-alpha-8" +squareup-leakcanary = "3.0-alpha-9" squareup-moshi = "1.15.2" squareup-moshi-kotlin = "1.15.2" squareup-okhttp = "4.9.1" From fd7e4df21b0393bf51a90aed25468e15c1ae856f Mon Sep 17 00:00:00 2001 From: Stephen Edwards Date: Mon, 29 Jun 2026 11:45:15 -0400 Subject: [PATCH 2/4] Fix LeakCanary 3 Android test builds --- .../AndroidManifest.xml | 6 ++++++ .../buildsrc/AndroidDefaultsPlugin.kt | 9 +++++++++ .../buildsrc/AndroidSampleAppPlugin.kt | 6 ++++++ .../workflow1/buildsrc/AndroidUiTestsPlugin.kt | 18 +++++++++++++++++- workflow-runtime/build.gradle.kts | 10 +++++++++- .../src/androidDeviceTest/AndroidManifest.xml | 6 +++++- .../src/androidTest/AndroidManifest.xml | 6 +++++- .../src/androidTest/AndroidManifest.xml | 6 +++++- .../src/androidTest/AndroidManifest.xml | 6 +++++- .../internal-testing-android/build.gradle.kts | 3 --- 10 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 build-logic/leakcanary-min-sdk-override/AndroidManifest.xml diff --git a/build-logic/leakcanary-min-sdk-override/AndroidManifest.xml b/build-logic/leakcanary-min-sdk-override/AndroidManifest.xml new file mode 100644 index 000000000..7849e4ab8 --- /dev/null +++ b/build-logic/leakcanary-min-sdk-override/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidDefaultsPlugin.kt b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidDefaultsPlugin.kt index a636ef6c1..bec67f3de 100644 --- a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidDefaultsPlugin.kt +++ b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidDefaultsPlugin.kt @@ -51,3 +51,12 @@ class AndroidDefaultsPlugin : Plugin { } } } + +internal fun TestedExtension.useLeakCanaryMinSdkOverrideManifest( + target: Project, + sourceSetName: String, +) { + sourceSets.getByName(sourceSetName).manifest.srcFile( + target.rootProject.file("build-logic/leakcanary-min-sdk-override/AndroidManifest.xml") + ) +} diff --git a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidSampleAppPlugin.kt b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidSampleAppPlugin.kt index 90cc1f958..74840618f 100644 --- a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidSampleAppPlugin.kt +++ b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidSampleAppPlugin.kt @@ -18,6 +18,12 @@ class AndroidSampleAppPlugin : Plugin { @Suppress("UnstableApiUsage") testedExtension.buildFeatures.viewBinding = true + + // LeakCanary 3 requires API 26 resources. Keep this scoped to sample apps so published + // artifacts can continue to use the shared library minSdk. + testedExtension.defaultConfig { defaultConfig -> + defaultConfig.minSdk = maxOf(defaultConfig.minSdk ?: 1, 26) + } } target.extensions.configure(BaseAppModuleExtension::class.java) { appExtension -> diff --git a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidUiTestsPlugin.kt b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidUiTestsPlugin.kt index 4ce59d3e7..9bcdb9494 100644 --- a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidUiTestsPlugin.kt +++ b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidUiTestsPlugin.kt @@ -7,6 +7,8 @@ import com.squareup.workflow1.buildsrc.internal.androidTestImplementation import com.squareup.workflow1.buildsrc.internal.invoke import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.artifacts.ExternalModuleDependency +import org.gradle.api.artifacts.MinimalExternalModuleDependency class AndroidUiTestsPlugin : Plugin { @@ -23,6 +25,10 @@ class AndroidUiTestsPlugin : Plugin { // Disable transition and rotation animations. testOptions.animationsDisabled = true } + + if (!target.file("src/androidTest/AndroidManifest.xml").exists()) { + testedExtension.useLeakCanaryMinSdkOverrideManifest(target, "androidTest") + } } target.dependencies { @@ -30,7 +36,17 @@ class AndroidUiTestsPlugin : Plugin { androidTestImplementation(target.libsCatalog.library("androidx-test-espresso-core")) androidTestImplementation(target.libsCatalog.library("androidx-test-junit")) - androidTestImplementation(target.libsCatalog.library("squareup-leakcanary-instrumentation")) + addProvider( + "androidTestImplementation", + target.libsCatalog.library("squareup-leakcanary-instrumentation") + ) { dependency -> + dependency.exclude( + mapOf( + "group" to "com.squareup.leakcanary", + "module" to "leakcanary-android-core" + ) + ) + } } } } diff --git a/workflow-runtime/build.gradle.kts b/workflow-runtime/build.gradle.kts index 75cb95daa..8f6de1990 100644 --- a/workflow-runtime/build.gradle.kts +++ b/workflow-runtime/build.gradle.kts @@ -113,7 +113,15 @@ kotlin { implementation(libs.androidx.test.espresso.core) implementation(libs.androidx.test.junit) - implementation(libs.squareup.leakcanary.instrumentation) + implementation( + "com.squareup.leakcanary:leakcanary-android-instrumentation:" + + libs.versions.squareup.leakcanary.get() + ) { + exclude( + group = "com.squareup.leakcanary", + module = "leakcanary-android-core" + ) + } implementation(libs.truth) implementation(libs.androidx.activity.ktx) diff --git a/workflow-runtime/src/androidDeviceTest/AndroidManifest.xml b/workflow-runtime/src/androidDeviceTest/AndroidManifest.xml index 125820472..70f938907 100644 --- a/workflow-runtime/src/androidDeviceTest/AndroidManifest.xml +++ b/workflow-runtime/src/androidDeviceTest/AndroidManifest.xml @@ -1,4 +1,8 @@ - + + + diff --git a/workflow-ui/compose-tooling/src/androidTest/AndroidManifest.xml b/workflow-ui/compose-tooling/src/androidTest/AndroidManifest.xml index 125820472..70f938907 100644 --- a/workflow-ui/compose-tooling/src/androidTest/AndroidManifest.xml +++ b/workflow-ui/compose-tooling/src/androidTest/AndroidManifest.xml @@ -1,4 +1,8 @@ - + + + diff --git a/workflow-ui/compose/src/androidTest/AndroidManifest.xml b/workflow-ui/compose/src/androidTest/AndroidManifest.xml index 125820472..70f938907 100644 --- a/workflow-ui/compose/src/androidTest/AndroidManifest.xml +++ b/workflow-ui/compose/src/androidTest/AndroidManifest.xml @@ -1,4 +1,8 @@ - + + + diff --git a/workflow-ui/core-android/src/androidTest/AndroidManifest.xml b/workflow-ui/core-android/src/androidTest/AndroidManifest.xml index a9d7a4808..d598d6ddd 100644 --- a/workflow-ui/core-android/src/androidTest/AndroidManifest.xml +++ b/workflow-ui/core-android/src/androidTest/AndroidManifest.xml @@ -1,4 +1,8 @@ - + + + Date: Mon, 29 Jun 2026 12:21:17 -0400 Subject: [PATCH 3/4] Restore LeakCanary object watcher in tests --- .../java/com/squareup/workflow1/buildsrc/AndroidUiTestsPlugin.kt | 1 + workflow-runtime/build.gradle.kts | 1 + 2 files changed, 2 insertions(+) diff --git a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidUiTestsPlugin.kt b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidUiTestsPlugin.kt index 9bcdb9494..9ce4430a3 100644 --- a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidUiTestsPlugin.kt +++ b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/AndroidUiTestsPlugin.kt @@ -36,6 +36,7 @@ class AndroidUiTestsPlugin : Plugin { androidTestImplementation(target.libsCatalog.library("androidx-test-espresso-core")) androidTestImplementation(target.libsCatalog.library("androidx-test-junit")) + androidTestImplementation(target.libsCatalog.library("squareup-leakcanary-objectwatcher-android")) addProvider( "androidTestImplementation", target.libsCatalog.library("squareup-leakcanary-instrumentation") diff --git a/workflow-runtime/build.gradle.kts b/workflow-runtime/build.gradle.kts index 8f6de1990..79b7600f1 100644 --- a/workflow-runtime/build.gradle.kts +++ b/workflow-runtime/build.gradle.kts @@ -113,6 +113,7 @@ kotlin { implementation(libs.androidx.test.espresso.core) implementation(libs.androidx.test.junit) + implementation(libs.squareup.leakcanary.objectwatcher.android) implementation( "com.squareup.leakcanary:leakcanary-android-instrumentation:" + libs.versions.squareup.leakcanary.get() From af69d35794195387837b68f81aa3c6a5aa9ce6dc Mon Sep 17 00:00:00 2001 From: Stephen Edwards Date: Mon, 29 Jun 2026 12:27:27 -0400 Subject: [PATCH 4/4] Relax JS exception logging assertion --- .../workflow1/SimpleLoggingWorkflowInterceptorTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/SimpleLoggingWorkflowInterceptorTest.kt b/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/SimpleLoggingWorkflowInterceptorTest.kt index 0889fab6b..358611c43 100644 --- a/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/SimpleLoggingWorkflowInterceptorTest.kt +++ b/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/SimpleLoggingWorkflowInterceptorTest.kt @@ -93,11 +93,11 @@ internal class SimpleLoggingWorkflowInterceptorTest { val EXPECTED_ERRORS = listOf( ( "ErrorLoggingInterceptor\\.logBeforeMethod threw exception:\n" + - ".+IllegalArgumentException.*" + ".*IllegalArgumentException.*" ).toRegex(), ( "ErrorLoggingInterceptor\\.logAfterMethod threw exception:\n" + - ".+IllegalArgumentException.*" + ".*IllegalArgumentException.*" ).toRegex() ) }