Friday, April 22, 2011

Flex Compiler Constants

There is plenty of information on the web talking about how to specify constants for the Flex compiler so I've compiled a cheat sheet of the essentials:
  • Constant values can be defined in main-config.xml for the flex/mxml compiler so that they don't have to be edited in eclipse preferences.
  • Values for String constants should have quotation marks around them
    • Whether you are defining strings in your maven's pom.xml file to manage maven builds:
      <property>
           <name>MY_CONSTANTS::someStringConstant</name>
           <value>"Hello World"</value>
      </property>
    • Or you are using *-config.xml file to manage Eclipse builds:
      <define>
           <name>MY_CONSTANTS::someStringConstant</name>
           <value>"Hello World"</value>
      </define>
  • Values for Boolean constants DO NOT need any quotations.
    • pom.xml
      <property>
           <name>MY_CONSTANTS::someBooleanConstant</name>
           <value>true</value>
      </property>
    • *-config.xml
      <define>
           <name>MY_CONSTANTS::someBooleanConstant</name>
           <value>true</value>
      </define>
  • More to come...

0 comments:

Post a Comment