Commit b81142a1 authored by Adrien's avatar Adrien

processbuilders inherits IO

parent 1d88debb
......@@ -31,9 +31,12 @@ class MacCodeSign {
throw Throwable()
}
val processBuilder = ProcessBuilder("echo", "bonitasoft", "|", "sudo", "-S", "codesign", "--deep", "-s", "Bonitasoft", file.canonicalPath)
logger.info("Signing macOS file...")
val signResult = processBuilder.inheritIO().start().waitFor()
val signResult = ProcessBuilder()
.inheritIO()
.command("echo", "bonitasoft", "|", "sudo", "-S", "codesign", "--deep", "-s", "Bonitasoft", file.canonicalPath)
.start()
.waitFor()
if (signResult != 0) {
logger.error("An error occured while signing file.")
......@@ -52,6 +55,7 @@ class MacCodeSign {
logger.info("Signing macOS installer...")
var signResult = ProcessBuilder()
.inheritIO()
.command("echo", "bonitasoft", "|", "sudo", "-S", "codesign", "--deep", "-s", "Bonitasoft", file.canonicalPath)
.start()
.waitFor()
......@@ -63,8 +67,8 @@ class MacCodeSign {
logger.info("Building dmg...")
var dmgName = file.nameWithoutExtension
var dmgPath = file.parentFile.canonicalPath + separator + file.nameWithoutExtension + ".dmg"
logger.info("DMG Path: " + dmgPath)
val buildDmgResult = ProcessBuilder()
.inheritIO()
.command("hdiutil", "create", "-volname", dmgName, "-srcfolder", file.canonicalPath, "-ov", "-format", "UDZO", dmgPath)
.start()
.waitFor()
......@@ -79,6 +83,7 @@ class MacCodeSign {
logger.info("Signing macOS dmg...")
signResult = ProcessBuilder()
.inheritIO()
.command("codesign", "-s", "Bonitasoft", dmgPath)
.start()
.waitFor()
......@@ -92,6 +97,7 @@ class MacCodeSign {
fun unzip(zipFile: File) : File {
ProcessBuilder()
.inheritIO()
.command("unzip", zipFile.canonicalPath, "-d", zipFile.parentFile.canonicalPath)
.start()
.waitFor()
......@@ -106,6 +112,7 @@ class MacCodeSign {
fun zip(file: File) : File {
val zipPath : String = file.parentFile.canonicalPath + separator + file.nameWithoutExtension + ".zip"
ProcessBuilder()
.inheritIO()
.command("zip", zipPath, file.canonicalPath)
.start()
.waitFor()
......
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