Skip to content

Commit

Permalink
chore: [sc-14173] Upload generated mapping file to Sentry (#5123)
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth authored Nov 26, 2024
1 parent 9b4ee9b commit 7410e74
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ jobs:
./gradlew \
-PrunProguard=true \
-PdefaultProguardFile=proguard-android.txt \
-PsentryUploadProguard=false \
bundle${{ matrix.buildType }}Release
verify_room_schemas:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- Bump asm to v9.7.1
- Bump AndroidX CameraX to v1.4.0
- Bump AndroidX Annotation to v1.9.1
- Upload generated mapping file to Sentry

### Fixes

Expand Down
31 changes: 10 additions & 21 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@ plugins {
}

sentry {
val sentryOrg: String by project
val sentryProject: String by project
val sentryAuthToken: String by project
val sentryUploadProguard: String by project

org = sentryOrg
projectName = sentryProject
authToken = sentryAuthToken

includeProguardMapping.set(true)
autoUploadProguardMapping.set(false)
autoUploadProguardMapping.set(sentryUploadProguard.toBooleanStrict())

// We are using our own instrumentation tooling for Room queries
// Look at [ADR 013: SQL Performance Profiling (v2)]
Expand Down Expand Up @@ -231,27 +240,7 @@ android {
}
}

// We don"t obfuscate (only minify) using proguard. Gradle plugin 3.2.0 (and greater?) generates
// an empty mappings.txt file. This caused an issue where the CI deploy to play store task tries
// to upload the empty mapping file, which causes the Play Store api to complain.
val deleteProguardMappings = tasks.create<Delete>("deleteProguardMappings") {
delete(fileTree(layout.buildDirectory).matching {
include("outputs/mapping/**/mapping.txt")
})
}

afterEvaluate {
val assembleReleaseTasks = setOf(
"assembleStagingRelease",
"assembleSandboxRelease",
"assembleProductionRelease",
"assembleSecurityRelease"
)

assembleReleaseTasks.forEach { buildType ->
tasks.findByName(buildType)?.finalizedBy(deleteProguardMappings)
}

val kspTasks = mapOf(
"kspQaDebugKotlin" to "qaDebug",
"kspSandboxReleaseKotlin" to "sandboxRelease",
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ androidNdkVersion=21.3.6528147
# Sentry config
sentryDsn=do_not_change_here
sentryEnvironment=dev
sentryOrg=do_not_change_here
sentryProject=do_not_change_here
sentryAuthToken=do_not_change_here
sentryUploadProguard=true
# App behaviour
disableScreenshot=false
allowRootedDevice=true
Expand Down

0 comments on commit 7410e74

Please sign in to comment.