This message was deleted.
# community-support
s
This message was deleted.
c
you could make a task that executes the necessary external commands to build the DLL; you can further set the
enabled
flag on that task to only be enabled when the OS is windows.
r
thank you, that sounds relatively straightforward! I think I was tripped up by the various plugins that seem mandatory when googling
f
I just learned some gradle recently it feels like it is a powerful tool so you can do a lot of customization yourself. Unfortunately, the API has been changing a lot and it used to use Groovy and now also supports Kotlin. Perhaps you should go with the Kotlin version as it might be the future (and also easier for me as it has a more Java-like syntax). Gradle also has sort of its own language there as in Kotlin it is easy to write DSL. Then make some tasks like you said should be fairly easy, this should get you going, I guess.
Copy code
tasks.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")
}
e
DefaultNativePlatform is Gradle internal, you should not use it
👍 1