From 436d2dda9acb3fc51100c2e549fe4537e4d1ea9b Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 28 Apr 2026 15:47:04 +0200 Subject: [PATCH] feat(deps): Auto-update ComposablePreviewScanner version Externalize the ComposablePreviewScanner version into a properties file and wire it through BuildConfig, so the existing getsentry/github-workflows/updater action can open update PRs the same way it does for sentry-cli and the Android SDK. Also switch the properties read to providers.fileContents so the configuration cache is invalidated on file change instead of the file being read eagerly at configuration time. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/update-deps.yml | 9 +++++++++ plugin-build/build.gradle.kts | 15 ++++++++------- .../composable-preview-scanner.properties | 2 ++ .../android/gradle/AndroidComponentsConfig.kt | 3 ++- 4 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 plugin-build/composable-preview-scanner.properties diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml index 36d285e5c..2f733e07f 100644 --- a/.github/workflows/update-deps.yml +++ b/.github/workflows/update-deps.yml @@ -33,3 +33,12 @@ jobs: path: scripts/update-android.sh name: Android SDK ssh-key: ${{ secrets.CI_DEPLOY_KEY }} + + composable-preview-scanner: + runs-on: ubuntu-latest + steps: + - uses: getsentry/github-workflows/updater@26f565c05d0dd49f703d238706b775883037d76b # v3 + with: + path: plugin-build/composable-preview-scanner.properties + name: ComposablePreviewScanner + ssh-key: ${{ secrets.CI_DEPLOY_KEY }} diff --git a/plugin-build/build.gradle.kts b/plugin-build/build.gradle.kts index a88bee530..9aaf9b856 100644 --- a/plugin-build/build.gradle.kts +++ b/plugin-build/build.gradle.kts @@ -1,6 +1,5 @@ import io.sentry.android.gradle.internal.ASMifyTask import io.sentry.android.gradle.internal.BootstrapAndroidSdk -import java.io.FileInputStream import java.util.Properties import org.gradle.api.tasks.testing.logging.TestLogEvent import org.jetbrains.kotlin.config.KotlinCompilerVersion @@ -312,17 +311,19 @@ buildConfig { buildConfigField("String", "Version", provider { "\"${project.version}\"" }) buildConfigField("String", "SdkVersion", provider { "\"${project.property("sdk_version")}\"" }) buildConfigField("String", "AgpVersion", provider { "\"${BuildPluginsVersion.AGP}\"" }) + buildConfigField("String", "CliVersion", propertyVersionProvider("sentry-cli.properties")) buildConfigField( "String", - "CliVersion", - provider { - "\"${Properties().apply { - load(FileInputStream(File("$projectDir/sentry-cli.properties"))) - }.getProperty("version")}\"" - }, + "ComposablePreviewScannerVersion", + propertyVersionProvider("composable-preview-scanner.properties"), ) } +fun propertyVersionProvider(fileName: String): Provider = + providers.fileContents(layout.projectDirectory.file(fileName)).asText.map { content -> + "\"${Properties().apply { load(content.reader()) }.getProperty("version")}\"" + } + tasks.register("asmify") tasks.named("check").configure { dependsOn(tasks.named("validatePlugins")) } diff --git a/plugin-build/composable-preview-scanner.properties b/plugin-build/composable-preview-scanner.properties new file mode 100644 index 000000000..4e788d688 --- /dev/null +++ b/plugin-build/composable-preview-scanner.properties @@ -0,0 +1,2 @@ +version = 0.8.1 +repo = https://github.com/sergio-sastre/ComposablePreviewScanner diff --git a/plugin-build/src/main/kotlin/io/sentry/android/gradle/AndroidComponentsConfig.kt b/plugin-build/src/main/kotlin/io/sentry/android/gradle/AndroidComponentsConfig.kt index 797a5e242..4fcb35d83 100644 --- a/plugin-build/src/main/kotlin/io/sentry/android/gradle/AndroidComponentsConfig.kt +++ b/plugin-build/src/main/kotlin/io/sentry/android/gradle/AndroidComponentsConfig.kt @@ -13,6 +13,7 @@ import com.android.build.api.variant.HostTestBuilder.Companion.UNIT_TEST_TYPE import com.android.build.api.variant.Variant import com.android.build.gradle.BaseExtension import com.android.build.gradle.internal.utils.setDisallowChanges +import io.sentry.BuildConfig import io.sentry.android.gradle.SentryPlugin.Companion.sep import io.sentry.android.gradle.SentryPropertiesFileProvider.getPropertiesFilePath import io.sentry.android.gradle.SentryTasksProvider.capitalized @@ -493,7 +494,7 @@ private fun ApplicationVariant.configureSnapshotsTasks( project.dependencies.add( "testImplementation", - "io.github.sergio-sastre.ComposablePreviewScanner:android:0.8.1", + "io.github.sergio-sastre.ComposablePreviewScanner:android:${BuildConfig.ComposablePreviewScannerVersion}", ) val paparazziMajorVersion =