Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automate GWT builds using different sets of property values?

Tags:

java

build

ant

gwt

I need to be able to build two different versions of my GWT application using two different sets of property values. For example, one version would be built with the value of custom_property set to "A" and another would be built with the value of custom_property set to "B".

Currently I am editing the application's module XML file in between builds by hand. So, to make one build I would first add:

<set-property name="custom_property" value="A"/>

And to make the other build I would change this line to:

<set-property name="custom_property" value="B"/>

This approach is working okay, but I would like to automate it if possible.

Is there a good way to accomplish this?

like image 389
Daniel Trebbien Avatar asked Jan 17 '23 09:01

Daniel Trebbien


2 Answers

One powerful way to do this would be using Maven substitution. I've used this approach in many GWT- and non-GWT-based apps. Due to Maven's prevalence, you'll find loads of examples of Mavenizing your GWT app. Then you can use Maven substitution to make all the magic happen.

like image 156
Chris Cashwell Avatar answered Jan 18 '23 23:01

Chris Cashwell


You can clone your app's module XML file and change values of your custom properties in it (e.g. MyAppStaging.gwt.xml and MyAppProd.gwt.xml). You'll thus be able to script builds of different app versions and have different run configurations in your IDE. The drawback here is in subsequently needing to maintain both module XML files.

like image 39
Boris Brudnoy Avatar answered Jan 18 '23 23:01

Boris Brudnoy