I’m working on a Java project that will be distributed to multiple clients, but need to have the client name in a variable within the java code for use in logging and version checking.
Is there a way to have a list of options set in gradle that when running the build task will generate multiple jars, one for each of the options? Each jar will need the variable added to the archive name and a java variable in the main class changed to match.
As an example, if I’ve got ['Client A', 'Client B']
as a gradle array, I would need a project-client-a.jar
with the variable MainClass.CLIENT = "Client A"
and a separate jar with project-client-b.jar
with MainClass.CLIENT = "Client B"