I am trying to set some public static constants on a class conditionally by passing variables to the compiler e.g. -define=CONFIG::ENVIRONMENT,'testing_server'
This is what I'd like to do:
if(CONFIG::ENVIRONMENT=='production')
public static const DOMAIN:String="production_site.com";
else if(CONFIG::ENVIRONMENT=='testing_server')
public static const DOMAIN:String="secret_domain.com";
I have tried many versions of this code, but everything so far has produced an error of one sort or another. The only way I have succeeded is by setting a compiler variable for each environment (all false except the one wanted which is true) and using the following syntax:
CONFIG::PRODUCTION{
public static const DOMAIN:String="production_site.com";
}
CONFIG::TESTING_SERVER{
public static const DOMAIN:String="secret_domain.com";
}
Obviously this means I have to tinker with long command line setting each time. I thought my initial approach was possible given the documentation and various tutorials I have read.
Can anyone help?