I'm trying to pass a build number from Hudson into a Flex application.
I've found Adobe's document (http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html) on conditional compilation which seems it should solve it but i must be missing something.
So in my ant build file i have:-
<mxmlc
file="${app.dir}/${application.name}.mxml"
output="${dist.dir}/${application.name}.swf"
context-root="${application.name}"
debug="true"
locale="${locales}"
allow-source-path-overlap="true">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<compiler.library-path dir="${lib.dir}" append="true">
<include name="*.swc" />
</compiler.library-path>
<define name="BUILD::BuildNumber" value="'20100707.800'"/>
<source-path path-element="${src.dir}"/>
<source-path path-element="${cfg.dir}"/>
<source-path path-element="${locale.dir}" />
</mxmlc>
Then i'm trying to retrieve with
public static const buildNumber:String = BUILD::BuildNumber;
However the compiler is rejecting with
SomeModel.as(31): col: 47 Error: Access of undefined property BUILD. [mxmlc] private static const _buildNumber:String = BUILD::BuildNumber;
Any suggestions?