Skip to content

Instantly share code, notes, and snippets.

@BelooS
Created November 1, 2020 12:18
Show Gist options
  • Save BelooS/97eb37e4d30f7e87775cbaf92fe27e56 to your computer and use it in GitHub Desktop.
Save BelooS/97eb37e4d30f7e87775cbaf92fe27e56 to your computer and use it in GitHub Desktop.
Extract mapping gradle task
def extractMapping = tasks.create("extractMapping") {
description "Copy mapping archive into outputs/artifacts folder."
group 'circleci'
}
android.applicationVariants.all { variant ->
if (variant.mappingFile != null) {
def copyMapping = tasks.create(name: "copy${variant.name}Mapping", type: Copy) {
from variant.mappingFile
rename { "${archivesBaseName}-${variant.name}Mapping.txt" }
into "${rootProject.buildDir}/circleci/mapping"
}
extractMapping.dependsOn copyMapping
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment