mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Handle jar signer errors.
This commit is contained in:
parent
2febea27a7
commit
1b472cd625
2 changed files with 10 additions and 4 deletions
|
@ -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))
|
||||
|
|
|
@ -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"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue