I am trying to set some public static constants in a class conditionally by passing variables to the compiler, for example. -define = CONFIG :: ENVIRONMENT, 'testing_server'
This is what I would 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 tried many versions of this code, but everything still caused an error of one kind or another. The only way I succeeded is to set the compiler variable for each environment (all false, except the required one, which is true) and use 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 that I have to go through a long command line setting each time. I thought that my initial approach was possible based on the documentation and various tutorials that I read.
Can anyone help?