diff --git a/src/main/kotlin/com/beust/kobalt/misc/RunCommand.kt b/src/main/kotlin/com/beust/kobalt/misc/RunCommand.kt index 2dd760a4..c619073b 100644 --- a/src/main/kotlin/com/beust/kobalt/misc/RunCommand.kt +++ b/src/main/kotlin/com/beust/kobalt/misc/RunCommand.kt @@ -23,6 +23,7 @@ open class RunCommand(val command: String) { * This field is used to specify how errors are caught. */ var useErrorStreamAsErrorIndicator = true + var useInputStreamAsErrorIndicator = false fun useErrorStreamAsErrorIndicator(f: Boolean) : RunCommand { useErrorStreamAsErrorIndicator = f @@ -52,6 +53,9 @@ open class RunCommand(val command: String) { if (useErrorStreamAsErrorIndicator && ! hasErrors) { hasErrors = hasErrors || hasErrorStream } + if (useInputStreamAsErrorIndicator && ! hasErrors) { + hasErrors = hasErrors || process.inputStream.available() > 0 + } if (! hasErrors) { successCallback(fromStream(process.inputStream)) diff --git a/src/main/kotlin/com/beust/kobalt/plugin/android/AndroidPlugin.kt b/src/main/kotlin/com/beust/kobalt/plugin/android/AndroidPlugin.kt index 830cbea9..9fe4aac3 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/android/AndroidPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/android/AndroidPlugin.kt @@ -308,17 +308,19 @@ public class AndroidPlugin @Inject constructor(val javaCompiler: JavaCompiler, v throw KobaltException("No signingConfig found for product type $buildType") } - val success = RunCommand("jarsigner").run(listOf( + val success = RunCommand("jarsigner").apply { +// useInputStreamAsErrorIndicator = true + }.run(listOf( "-keystore", signingConfig.storeFile, "-storepass", signingConfig.storePassword, "-keypass", signingConfig.keyPassword, "-signedjar", apk, temporaryApk, signingConfig.keyAlias - )) - log(1, "Created $apk") + )) + log(1, "Created $apk") - return TaskResult(success == 0) + return TaskResult(success == 0) } @Task(name = "install", description = "Install the apk file", runAfter = arrayOf(TASK_GENERATE_DEX, "assemble"))