Skip to content

Commit

Permalink
Skip QmlImport scanner if the ABI is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
strseb committed Aug 31, 2022
1 parent e55107d commit cd9ca64
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion android/buildSrc/src/main/kotlin/QtConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ open class QTConfigurationExtension
// Runs QMLImportscanner from qt_host against the
// qt_android_<abi> folder, to find out what we need to bundle for qml
private fun getQMLImports(abi: String): JSONArray {
val path = getPath(abi)
val abiFolder = File(path)
if (!abiFolder.exists()) {
return JSONArray()
}
val importScanner = File("$host/libexec/qmlimportscanner")
if (!importScanner.exists()) {
error("Did not found qmlimportscanner in $host/libexec/qmlimportscanner")
Expand All @@ -179,6 +184,7 @@ open class QTConfigurationExtension
if (!qmlPath.exists()) {
return JSONArray()
}
print("Calling: $importScanner -rootPath $qmlPath -importPath $qtQMLPath")
val process =
Runtime.getRuntime().exec("$importScanner -rootPath $qmlPath -importPath $qtQMLPath")
val processOutput = StringBuilder()
Expand All @@ -192,7 +198,13 @@ open class QTConfigurationExtension
}
process.waitFor()
}
return JSONArray(processOutput.toString())
val out = processOutput.toString();
try{
return JSONArray(out)
}catch(e:Exception){
error("Got Output of: $out \n ${e.toString()}")

}
}

companion object {
Expand Down

0 comments on commit cd9ca64

Please sign in to comment.