Add gradle task runBreakpadDumpSyms

This commit is contained in:
Gabriel Calero 2018-06-19 14:31:44 -03:00
parent e1b5564c7b
commit e2ddaeac02
2 changed files with 46 additions and 4 deletions

View file

@ -74,6 +74,10 @@ android {
// so our merge has to depend on the external native build
variant.externalNativeBuildTasks.each { task ->
variant.mergeResources.dependsOn(task)
def dumpSymsTaskName = "runBreakpadDumpSyms${variant.name.capitalize()}";
def dumpSymsTask = rootProject.getTasksByName(dumpSymsTaskName, false).first()
dumpSymsTask.dependsOn(task)
variant.assemble.dependsOn(dumpSymsTask)
}
variant.mergeAssets.doLast {

View file

@ -151,11 +151,11 @@ def packages = [
checksum: '14b02795d774457a33bbc60e00a786bc'
],
breakpad: [
file: 'breakpad.zip',
versionId: '2OwvCCZrF171wnte5T44AnjTYFhhJsGJ',
checksum: 'a46062a3167dfedd4fb4916136e204d2',
file: 'breakpad_dump_syms.zip',
versionId: 'udimLCwfB7tMbfGdE1CcLRt5p0.ehtoM',
checksum: '92b6ace2edb95ea82dca257cf0fe522b',
sharedLibFolder: 'lib',
includeLibs: ['libbreakpad_client.a','libbreakpad.a']
includeLibs: ['libbreakpad_client.a']
]
]
@ -549,6 +549,44 @@ task cleanDependencies(type: Delete) {
delete 'app/src/main/res/values/libs.xml'
}
def runBreakpadDumpSyms = { buildType ->
def objDir = new File("${appDir}/build/intermediates/cmake/${buildType}/obj/arm64-v8a")
def stripDebugSymbol = "${appDir}/build/intermediates/transforms/stripDebugSymbol/${buildType}/0/lib/arm64-v8a/"
def outputDir = new File("${appDir}/build/tmp/breakpadDumpSyms")
if (!outputDir.exists()) {
outputDir.mkdirs()
}
objDir.eachFileRecurse (FileType.FILES) { file ->
if (file.name.endsWith('.so')) {
def output = file.name + ".sym"
def cmdArgs = [
file.toString(),
stripDebugSymbol
]
exec {
workingDir HIFI_ANDROID_PRECOMPILED + '/breakpad/bin'
commandLine './dump_syms'
args cmdArgs
standardOutput = new BufferedOutputStream(new FileOutputStream(new File(outputDir, output)))
}
}
}
}
task runBreakpadDumpSymsRelease() {
doLast {
runBreakpadDumpSyms("release");
}
}
task runBreakpadDumpSymsDebug() {
doLast {
runBreakpadDumpSyms("debug");
}
}
// FIXME this code is prototyping the desired functionality for doing build time binary dependency resolution.