ant I am converting an existing script assembly from to to generate swc. ...">

Using compiler constants with the task <compc / "> ant

I am converting an existing script assembly from <mxmlc /> to <compc /> to generate swc.

However, the assembly fails, which gives an error:

 [compc] C:\xxxx\LogViewer.mxml(32): Error: Access of undefined property VERSION. [compc] [compc] private static const VERSION:String = CONFIG::VERSION; 

In my ant task, I have defined the following:

  <compc compiler.as3="true" output="${output.dir}/${swc.name}.swc" incremental="true" fork="true" maxmemory="512m" compiler.show-deprecation-warnings="false"> <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" /> <source-path path-element="${srcdir}" /> <include-sources dir="${srcdir}" includes="*" /> <external-library-path dir="${swc.libs.dir}" append="true"> <include name="*.swc" /> </external-library-path> <external-library-path dir="${output.common.swc.dir}" append="true"> <include name="*.swc" /> </external-library-path> <compiler.define name="CONFIG::VERSION" value="${build.version}" /> <compiler.define name="CONFIG::RELEASE" value="${config.release}" /> <compiler.define name="CONFIG::DEBUG" value="${config.debug}" /> <compiler.define name="CONFIG::AUTOMATION" value="false" /> </compc> 

This approach did an excellent job, but now does not work.

What is the correct way to use compiler constants with compc?

+4
source share
2 answers

String values ​​must be enclosed in single quotes. For instance:

 <compiler.define name="CONFIG::VERSION" value="'${build.version}'" /> 

Flex Ant's tasks are truly incredibly frustrating, mainly due to a lack of documentation. I struggled with this for a while until I realized.

+4
source

We do something similar in our assembly, and the only difference that I see is that we do not have a compiler bit:

  <define name="CONFIG::build" value="5" /> 
+1
source

All Articles