Skip to content

Commit 1024da8

Browse files
runningcodeclaude
andauthored
feat(deps): Auto-update ComposablePreviewScanner version (#1173)
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) <noreply@anthropic.com>
1 parent e31b834 commit 1024da8

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

.github/workflows/update-deps.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,12 @@ jobs:
3333
path: scripts/update-android.sh
3434
name: Android SDK
3535
ssh-key: ${{ secrets.CI_DEPLOY_KEY }}
36+
37+
composable-preview-scanner:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: getsentry/github-workflows/updater@26f565c05d0dd49f703d238706b775883037d76b # v3
41+
with:
42+
path: plugin-build/composable-preview-scanner.properties
43+
name: ComposablePreviewScanner
44+
ssh-key: ${{ secrets.CI_DEPLOY_KEY }}

plugin-build/build.gradle.kts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import io.sentry.android.gradle.internal.ASMifyTask
22
import io.sentry.android.gradle.internal.BootstrapAndroidSdk
3-
import java.io.FileInputStream
43
import java.util.Properties
54
import org.gradle.api.tasks.testing.logging.TestLogEvent
65
import org.jetbrains.kotlin.config.KotlinCompilerVersion
@@ -312,17 +311,19 @@ buildConfig {
312311
buildConfigField("String", "Version", provider { "\"${project.version}\"" })
313312
buildConfigField("String", "SdkVersion", provider { "\"${project.property("sdk_version")}\"" })
314313
buildConfigField("String", "AgpVersion", provider { "\"${BuildPluginsVersion.AGP}\"" })
314+
buildConfigField("String", "CliVersion", propertyVersionProvider("sentry-cli.properties"))
315315
buildConfigField(
316316
"String",
317-
"CliVersion",
318-
provider {
319-
"\"${Properties().apply {
320-
load(FileInputStream(File("$projectDir/sentry-cli.properties")))
321-
}.getProperty("version")}\""
322-
},
317+
"ComposablePreviewScannerVersion",
318+
propertyVersionProvider("composable-preview-scanner.properties"),
323319
)
324320
}
325321

322+
fun propertyVersionProvider(fileName: String): Provider<String> =
323+
providers.fileContents(layout.projectDirectory.file(fileName)).asText.map { content ->
324+
"\"${Properties().apply { load(content.reader()) }.getProperty("version")}\""
325+
}
326+
326327
tasks.register<ASMifyTask>("asmify")
327328

328329
tasks.named("check").configure { dependsOn(tasks.named("validatePlugins")) }
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version = 0.8.1
2+
repo = https://github.com/sergio-sastre/ComposablePreviewScanner

plugin-build/src/main/kotlin/io/sentry/android/gradle/AndroidComponentsConfig.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import com.android.build.api.variant.HostTestBuilder.Companion.UNIT_TEST_TYPE
1313
import com.android.build.api.variant.Variant
1414
import com.android.build.gradle.BaseExtension
1515
import com.android.build.gradle.internal.utils.setDisallowChanges
16+
import io.sentry.BuildConfig
1617
import io.sentry.android.gradle.SentryPlugin.Companion.sep
1718
import io.sentry.android.gradle.SentryPropertiesFileProvider.getPropertiesFilePath
1819
import io.sentry.android.gradle.SentryTasksProvider.capitalized
@@ -493,7 +494,7 @@ private fun ApplicationVariant.configureSnapshotsTasks(
493494

494495
project.dependencies.add(
495496
"testImplementation",
496-
"io.github.sergio-sastre.ComposablePreviewScanner:android:0.8.1",
497+
"io.github.sergio-sastre.ComposablePreviewScanner:android:${BuildConfig.ComposablePreviewScannerVersion}",
497498
)
498499

499500
val paparazziMajorVersion =

0 commit comments

Comments
 (0)