Slackbot
01/19/2024, 10:14 PMChris Lee
01/19/2024, 10:26 PMenabled flag on that task to only be enabled when the OS is windows.Rob
01/19/2024, 10:33 PMFuyang Liu
01/20/2024, 6:50 AMtasks.register<Exec>("whatOs" ) {
val os = DefaultNativePlatform.getCurrentOperatingSystem()
val toPrint = when (os.isWindows) {
true -> "I love Windows"
false -> "I really love ${os.name}"
}
commandLine(
"echo",
toPrint
)
standardOutput = System.out
}
// Make it that when you build your java project, the other task runs first.
tasks.named("build") {
dependsOn("whatOs")
}ephemient
01/20/2024, 5:46 PM