I am relatively new to Gradle and would appreciate some advice on the best way to organise my Gradle build file to allow different versions of my application to be built.
Specifically, I am using Gradle to build a Grails 3 application, which results in a Spring Boot WAR file. This is all working fine, but I would like to add two features to the build file:
I would like to build two different versions of the WAR file - with and without an embedded Tomcat server. The difference is whether the relevant dependency is labelled as
My application uses a 3rd party library, which has a dependency on another library. It turns out that this second library is only needed on Windows and not on Mac OS X, so I would like to be able to build two versions of the application, with and without this extra library.
What is the best / most idiomatic way to add these features to my build file? I’d like the solution to be declarative if possible.