Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions apps/flipcash/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ fun gitVersionCode(): Int {
return result.toInt().also { println("VersionCode $it") }
}

// Bugsnag joins an uploaded mapping file to an incoming event on build UUID, falling back
// to applicationId + versionName + versionCode. Neither side was supplying one: the Gradle
// plugin emits the UUID as a string resource that bugsnag-android never reads (it looks for
// manifest meta-data only) and that resource shrinking strips anyway, and the mapping upload
// omits `build-uuid` unless the `bugsnag` block below sets it. The commit SHA gives both
// sides the same value — the app build and the upload task run against the same HEAD in the
// release workflow — and going through the manifest keeps it out of the shrinker's reach.
val bugsnagBuildId: String = providers.exec {
commandLine("git", "rev-parse", "HEAD")
}.standardOutput.asText.get().trim()

val contributorsSigningConfig = ContributorsSignatory(rootDir)
val appNamespace = "${Gradle.flipcashNamespace}.app.android"

Expand All @@ -50,6 +61,7 @@ android {
buildConfigField("Boolean", "NOTIFY_ERRORS", "false")

manifestPlaceholders["BUGSNAG_API_KEY"] = tryReadProperty(rootProject.rootDir, "BUGSNAG_API_KEY")
manifestPlaceholders["BUGSNAG_BUILD_UUID"] = bugsnagBuildId
}

signingConfigs {
Expand Down Expand Up @@ -127,6 +139,7 @@ bugsnag {
variants {
release {
autoCreateBuild = true
buildUuid = bugsnagBuildId
}
debug {
enabled = false
Expand Down
10 changes: 10 additions & 0 deletions apps/flipcash/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@
android:name="com.bugsnag.android.API_KEY"
android:value="${BUGSNAG_API_KEY}" />

<!--
bugsnag-android reads the build UUID from manifest meta-data only. The Gradle
plugin's generated string resource is never read, and resource shrinking removes
it. Both this value and the one attached to the uploaded ProGuard mapping come
from `bugsnagBuildId` in build.gradle.kts.
-->
<meta-data
android:name="com.bugsnag.android.BUILD_UUID"
android:value="${BUGSNAG_BUILD_UUID}" />

<activity
android:name="com.flipcash.app.MainActivity"
android:exported="true"
Expand Down
Loading