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
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ private fun Project.replaceSentryProguardUuidInAndroidManifest(
)
.toTransform(SingleArtifact.MERGED_MANIFEST)

val mappingFile = variant.artifacts.get(SingleArtifact.OBFUSCATION_MAPPING_FILE)

tasks.registerUploadUuidToSentryTask(
variantName = variant.name,
uuid = uuid,
downloadSentryCliTask = downloadSentryCliTask,
sentryProguardExtension = sentryProguardExtension,
mappingFile = mappingFile,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ internal fun TaskContainer.registerUploadUuidToSentryTask(
variantName: String,
uuid: String,
downloadSentryCliTask: TaskProvider<DownloadSentryCliTask>,
sentryProguardExtension: SentryProguardExtension
sentryProguardExtension: SentryProguardExtension,
mappingFile: Provider<RegularFile>
): TaskProvider<UploadUuidToSentryTask> {
val uploadUuidTask = register(
"uploadSentryProguardUuidFor${variantName.replaceFirstChar { it.titlecase() }}",
Expand All @@ -37,6 +38,7 @@ internal fun TaskContainer.registerUploadUuidToSentryTask(
it.uuid.set(uuid)
it.variantName.set(variantName)
it.cliCommand.set(sentryProguardExtension.cliConfig.command)
it.mappingFile.set(mappingFile)
}

configureEach { task ->
Expand Down Expand Up @@ -74,16 +76,15 @@ internal abstract class UploadUuidToSentryTask : DefaultTask() {
@get:Inject
abstract val execOperations: ExecOperations

private val mappingFilePath: Provider<RegularFile> = variantName.flatMap {
project.layout.buildDirectory.file("outputs/mapping/$it/mapping.txt")
}
@get:InputFile
abstract val mappingFile: RegularFileProperty

@TaskAction
fun uploadUuidToSentry() {
val command = cliCommand.get().build(
cliFilePath = cliFilePath.get().asFile.absolutePath,
uuid = uuid.get(),
mappingFilePath = mappingFilePath.get().asFile.absolutePath,
mappingFilePath = mappingFile.get().asFile.absolutePath,
org = sentryOrg.get(),
project = sentryProject.get(),
authToken = sentryAuthToken.get()
Expand Down