Commit bcca8fe5 authored by Adrien's avatar Adrien

use Builder to build perocessBuilder

parent 4f9fee26
......@@ -51,8 +51,10 @@ class MacCodeSign {
}
logger.info("Signing macOS installer...")
var processBuilder = ProcessBuilder("echo", "bonitasoft", "|", "sudo", "-S", "codesign", "--deep", "-s", "Bonitasoft", file.canonicalPath)
var signResult = processBuilder.inheritIO().start().waitFor()
var signResult = ProcessBuilder()
.command("echo", "bonitasoft", "|", "sudo", "-S", "codesign", "--deep", "-s", "Bonitasoft", file.canonicalPath)
.start()
.waitFor()
if (signResult != 0) {
logger.error("An error occured while signing installer.")
throw SignException()
......@@ -62,8 +64,10 @@ class MacCodeSign {
var dmgName = file.nameWithoutExtension
var dmgPath = file.parentFile.canonicalPath + separator + file.nameWithoutExtension + ".dmg"
logger.info("DMG Path: " + dmgPath)
processBuilder = ProcessBuilder("echo", "bonitasoft", "|", "sudo", "-S", "hdiutil", "create", "-volname", dmgName, "-srcfolder", file.canonicalPath, "-ov", "-format", "UDZO", dmgPath)
val buildDmgResult = processBuilder.inheritIO().start().waitFor()
val buildDmgResult = ProcessBuilder()
.command("echo", "bonitasoft", "|", "sudo", "-S", "hdiutil", "create", "-volname", dmgName, "-srcfolder", file.canonicalPath, "-ov", "-format", "UDZO", dmgPath)
.start()
.waitFor()
var dmg = File(dmgPath);
if (buildDmgResult != 0 || ! dmg.exists()) {
logger.error("An error occured while building dmg.")
......@@ -74,8 +78,10 @@ class MacCodeSign {
}
logger.info("Signing macOS dmg...")
processBuilder = ProcessBuilder("codesign", "-s", "Bonitasoft", dmgPath)
signResult = processBuilder.inheritIO().start().waitFor()
signResult = ProcessBuilder()
.command("codesign", "-s", "Bonitasoft", dmgPath)
.start()
.waitFor()
if (signResult != 0) {
logger.error("An error occured while signing dmg.")
throw SignException()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment