I have 3 projects which is depending on the same shared library.
There is a singleton class inside the library which is providing globally shared objects across the project, anyway this globally shared objects is instances of a classes, which is different, depending on the platform, for instance :
on mobile application:
public static var message : TMobileMessage;
on desktop application:
public static var message : TDesktopMessage;
on web applcation:
public static var message : TWebApplication;
-
How to implement condition compiling on declarations, since the follow code doesn’t works :
If( CONFIG::applicationType == 'mobile' ) public static var message : TMobileMessage; else If( CONFIG::applicationType == 'desktop' ) public static var message : TDesktopMessage; else If( CONFIG::applicationType == 'web' ) public static var message : TWebApplication;
I would suggest the following.
Use conditional compiler’s declarations like this:
CONFIG::MOBILE {
public static var message : TMobileMessage;
}
CONFIG::DESKTOP {
public static var message : TDesktopMessage;
}
CONFIG::WEB {
public static var message : TWebApplication;
}
Create a flex-config.xml for each of the configs. Declare these conditionals in each of the config.xml:
flex-config-mobile.xml
flex-config-desktop.xml
flex-config-web.xml