ClaudiuB
02/01/2018, 11:44 AMkotlinc -script $somePath
from shell in gradle? Here's what I'm trying to do
task ensurePerformanceTestDevice(type: Exec) {
def scriptsFolder = new File(projects.project.projectDir, "scripts")
def environmentScript = new File(scriptsFolder, "device_check.kts")
def scriptCall = "kotlinc -script \"$environmentScript\""
println("Kotlinc device test command: \'$scriptCall\'")
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', scriptCall
} else {
// maybe wrap it so it looks like only one arg?
def unixCall = "\'$scriptCall\'"
println("Unix call: $unixCall")
commandLine 'sh', '-c', unixCall
}
}
if I just take scriptCall and paste it into the terminal, it works, but for the .sh
call I get exit value 127 back 😕: