私は既存のビルドスクリプトを<mxmlc />
から<compc />
に変換して、swcを生成します。<compc /> antタスクでコンパイラ定数を使用する
ビルドがエラーを与えて、失敗しているが、:私のAntタスクで
[compc] C:\xxxx\LogViewer.mxml(32): Error: Access of undefined property VERSION.
[compc]
[compc] private static const VERSION:String = CONFIG::VERSION;
、私は次のように定義されています
<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>
このアプローチは、タスクにうまく働いているが、今失敗する。
compcでコンパイラ定数を使用する正しい方法は何ですか?
私はこれをFlash Builder 4で使用されているmxmlcコンパイラのバグに批判しています。 – JabbyPanda
Flash Builder 4を使用しないでAntとFlex SDKを使用してコンパイルすると、このエラーは発生しませんでした。 Flash Builder 4でAntタスクを使用してコンパイルするときに、信頼性が低く、時にはコンパイルが失敗し、時には失敗し、この場合にFlexプロジェクトを閉じて開き、プロジェクトをクリーンアップしようとします。 – JabbyPanda