我正在将现有的构建脚本从<mxmlc />to转换<compc />为生成 swc。
但是,构建失败,给出错误:
[compc] C:\xxxx\LogViewer.mxml(32): Error: Access of undefined property VERSION.
[compc]
[compc] private static const VERSION:String = CONFIG::VERSION;
Run Code Online (Sandbox Code Playgroud)
在我的 ant 任务中,我定义了以下内容:
<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>
Run Code Online (Sandbox Code Playgroud)
这种方法可以很好地完成任务,但现在失败了。
在 compc 中使用编译器常量的正确方法是什么?
我有一个我已经构建的代码库.它依赖于另外两个(第三方)库.目前,当我将库编译成swc时,包含了第三方库.我正在寻找一种方法来编译我的代码库对抗第三方库,但不包括在编译的swc中.
这显然意味着任何使用我的库的人都需要这两个库,但我更喜欢这种方式.我没有使用Flex/Flashbuilder,我知道允许您选择要包含在swc中的类.
谢谢
当我尝试使用compc构建.swc时,我得到了Error: could not find a JVM.
我找到了这个 站点,然后注释掉了java.home行.这没有用.
我正在尝试从这个库中构建一个.swc ,所以我实际上可以使用它.我也有FlashBuilder,如果我可以通过它来构建或添加这个库到我的项目,这将是很好的.
编辑:设置JAVA_HOME到jre或jdk目录给我一个不同的错误的变化Error loading: C:\Program Files\Java\jdk1.7.0_45\jre\bin\server\jvm.dll
编辑2:在包装JAVA_HOME字符串后,我得到了我下载JDK之前的错误:
Error: could not find JRE
Error: could not find Java 2 Runtime Environment.
Run Code Online (Sandbox Code Playgroud)
不过,我可以输入%JAVA_HOME%\bin\java -version并查看java version "1.7.0_45.
JAVA_HOME用路径替换JRE 并没有帮助.
编辑3安装并设置JAVA_HOME为32位sdk后,我收到此错误:
C:\Users\Jim\Downloads\as3httpclient-master\as3httpclient-master\build-swc.xml(14): Error: unable to open 'C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks/libs/player/9/playerglobal.swc'
</external-library-path>
Run Code Online (Sandbox Code Playgroud)
我注意到文件路径使用开关使用反斜杠转发斜杠,所以我把它们改回来,但这没有帮助.