Trying to fix Android pre-build

This commit is contained in:
Brad Davis 2018-01-16 09:22:39 -08:00
parent 673a396fdc
commit ca83999546

View file

@ -154,16 +154,18 @@ def options = [
def qmlRoot = new File(HIFI_ANDROID_PRECOMPILED, 'qt') def qmlRoot = new File(HIFI_ANDROID_PRECOMPILED, 'qt')
def captureOutput = { String command -> def captureOutput = { String command, List<String> commandArgs ->
def proc = command.execute() def result
def sout = new StringBuilder(), serr = new StringBuilder() new ByteArrayOutputStream().withStream { os ->
proc.consumeProcessOutput(sout, serr) def execResult = exec {
proc.waitForOrKill(30000) executable = command
def errorOutput = serr.toString() args = commandArgs
if (!errorOutput.isEmpty()) { standardOutput = os
throw new GradleException("Command '${command}' failed with error ${errorOutput}") errorOutput = new ByteArrayOutputStream()
} }
return sout.toString() result = os.toString()
}
return result;
} }
def relativize = { File root, File absolute -> def relativize = { File root, File absolute ->
@ -177,12 +179,13 @@ def scanQmlImports = { File qmlRootPath ->
throw new GradleException('Unable to find required qmlimportscanner executable at ' + qmlImportCommandFile.parent.toString()) throw new GradleException('Unable to find required qmlimportscanner executable at ' + qmlImportCommandFile.parent.toString())
} }
def command = qmlImportCommandFile.absolutePath + def command = qmlImportCommandFile.absolutePath
" -rootPath ${qmlRootPath.absolutePath}" + def args = [
" -importPath ${qmlRoot.absolutePath}/qml" '-rootPath', qmlRootPath.absolutePath,
'-importPath', "${qmlRoot.absolutePath}/qml"
]
println command def commandResult = captureOutput(command, args)
def commandResult = captureOutput(command)
new JsonSlurper().parseText(commandResult).each { new JsonSlurper().parseText(commandResult).each {
if (!it.containsKey('path')) { if (!it.containsKey('path')) {
println "Warning: QML import could not be resolved in any of the import paths: ${it.name}" println "Warning: QML import could not be resolved in any of the import paths: ${it.name}"