Skip to content

Commit ca1fc90

Browse files
runningcodeclaude
andauthored
feat(telemetry): Add coreLibraryDesugaring and minSdk tags (#1206)
* feat(telemetry): Add coreLibraryDesugaring and minSdk tags (GRADLE-94) Track whether coreLibraryDesugaring is enabled and the project's minSdk in telemetry tags so we can understand desugaring adoption when minSdk < 26. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: Apply spotless formatting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bc6707b commit ca1fc90

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
package io.sentry.android.gradle.telemetry
44

5+
import com.android.build.gradle.BaseExtension
56
import io.sentry.BuildConfig
67
import io.sentry.IHub
78
import io.sentry.ISpan
@@ -393,6 +394,19 @@ abstract class SentryTelemetryService : BuildService<None>, BuildOperationListen
393394
// TODO PII?
394395
// extension.projectName.orNull?.let { tags.put("projectName", it) }
395396

397+
try {
398+
val android = project.extensions.findByType(BaseExtension::class.java)
399+
if (android != null) {
400+
tags.put(
401+
"coreLibraryDesugaring_enabled",
402+
android.compileOptions.isCoreLibraryDesugaringEnabled.toString(),
403+
)
404+
android.defaultConfig.minSdkVersion?.apiLevel?.let { tags.put("minSdk", it.toString()) }
405+
}
406+
} catch (_: Throwable) {
407+
// Android extensions may not be available (e.g. JVM plugin)
408+
}
409+
396410
return tags
397411
}
398412
}

0 commit comments

Comments
 (0)