Friday, September 30, 2016

Using Constants based on Environment

Hi,

I have a client side configuration file Config.properties, in which I store some client properties for the application.

I use this file as:

Config.properties:
key = xyz


Config.java:
public interface Config
 
extends Constants {

 
String key();
}


Now, I want to have 2 versions of this, for dev and production environments.

I differentiate between the environments using the custom properties in different *.gwt.xml files:
<set-property name="env" value="dev"/>
<set-property name="env" value="prod"/>

How can I use 2 versions of the properties (Config_dev.properties and Config_prod.properties) file mapped to the same Java class (Config.java).

I tried doing it with localization (via setting locale property), but I get other localization stuff with it that I don't need.

Thanks,
Harsh

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment