Kotlin: DPE-62 Check if OS is Windows and run relevant commands in each case.

dz_patch_2022-02-22
ignaciogarcia 2022-01-19 16:35:37 +01:00
parent b571d3cd23
commit c97a48e8fa
Signed by untrusted user: Ignacio
GPG Key ID: 5E6A455C909DD623
1 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,4 @@
import org.gradle.internal.os.OperatingSystem
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.5.0'
@ -37,19 +38,29 @@ dependencies {
task cleanSrc() {
description = "make clean"
exec{
def command = ['make', 'clean']
workingDir "../../src"
commandLine command
if (!OperatingSystem.current().isWindows()) {
exec {
def command = ['make', 'clean']
workingDir "../../src"
commandLine command
}
}
}
task makeSrc(dependsOn: 'cleanSrc') {
description = "make src"
exec{
def command = ['make', 'all']
workingDir "../../src"
commandLine command
if (OperatingSystem.current().isWindows()) {
exec {
def command = ['cmd', '/c', 'generate_code.cmd']
workingDir "../../build-windows"
commandLine command
}
} else {
exec {
def command = ['make', 'all']
workingDir "../../src"
commandLine command
}
}
}