我想自动构建一个flex库项目,而不是当前的过程,这涉及到我们的一个开发人员在他的机器上编译它,然后我们签入生成的.swc文件。太恶心了。
我是从java开发人员的角度来看这一点的,所以我很难掌握Flex Builder 3应用程序中提供的编译工具的诀窍,但我已经掌握了以下内容:
<mxmlc/>和<compc/>任务。我想要的是一个蚂蚁脚本,它将执行以下步骤:
到目前为止我有这样的想法:
<target name="compile-component" depends="init">
<compc output="${DEPLOY_DIR}/${SWC_NAME}.swc">
<source-path path-element="${FLEX_HOME}/frameworks"/>
<source-path path-element="${SRC_DIR}"/>
</compc>
</target>但是,它不包括任何内容:
[compc] Loading configuration file /Applications/Adobe Flex Builder 3/sdks/3.2.0/frameworks/flex-config.xml
[compc] Adobe Compc (Flex Component Compiler)
[compc] Version 3.2.0 build 3958
[compc] Copyright (c) 2004-2007 Adobe Systems, Inc. All rights reserved.
[compc]
[compc] Error: nothing was specified to be included in the library
[compc]
[compc] Use 'compc -help' for information about using the command line.看起来我需要枚举我想要包含在库中的每个类,即.荒唐可笑。一定有更好的办法。我该怎么做?
发布于 2009-09-09 08:12:36
你可以做以下..。它从源路径获取所有文件,并将其转换为compc任务随后可以使用的格式。
<fileset id="project.test.dir.fileset" dir="${project.test.dir}">
<include name="**/*.as" />
<include name="**/*.mxml" />
</fileset>
<property name="project.test.dir.fileset" refid="project.test.dir.fileset" />
<!-- Convert the test files into a compiler friendly format. -->
<pathconvert property="project.test.dir.path" pathsep=" " refid="project.test.dir.fileset">
<compositemapper>
<chainedmapper>
<globmapper from="${project.test.dir}/*" to="*" handledirsep="true" />
<mapper type="package" from="*.as" to="*" />
</chainedmapper>
<chainedmapper>
<globmapper from="${project.test.dir}/*" to="*" handledirsep="true" />
<mapper type="package" from="*.mxml" to="*" />
</chainedmapper>
</compositemapper>
</pathconvert>
<compc headless-server="true" default-frame-rate="${flex.default-frame-rate}" debug="${flex.compiler.debug.mode}" output="${build.swc.dir}/${test.component.name}.swc" include-classes="${project.test.dir.path}" directory="false">
<source-path path-element="${project.test.dir}" />
&dependencies;
</compc>我们使用它来生产用于测试目的的swcs。
发布于 2010-04-22 21:08:24
幸运的是,我刚刚解决了这个问题,并在寻找另一个问题的答案!
<compc output="${basedir}/mySwc.swc" locale="en_US">
<source-path path-element="${basedir}/src/main/flex"/>
<include-sources dir="${basedir}/src/main/flex" includes="*" />
<load-config filename="${basedir}/fb3config.xml" />
</compc>当试图解析各种引用时,源路径是必要的,可以告诉它要查看什么。包含源告诉它应该包含哪些源(显然在本例中所有这些源)。load-config只是Flex Builder的-dump-config输出。
希望这能帮上忙!
发布于 2010-01-26 09:48:58
您可以使用Maven。它是一个配置管理工具,而不仅仅是一个构建工具。它依赖于您的项目有一个清单文件。
https://stackoverflow.com/questions/1395860
复制相似问题