我如何可以自动的Flex组件库建设? [英] How can I automate the building of a Flex component library?

查看:270
本文介绍了我如何可以自动的Flex组件库建设?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立当前进程,这涉及到我们的开发自己的机器上编译它一个,然后我们检查生成的文件名为.swc的Flex库项目将自动代替。它的毛。

I would like to build a flex library project automatically instead of the current process, which involves one of our developers compiling it on his machine and then us checking in the resulting .swc file. It's gross.

我是从Java开发人员的角度来看未来在这,所以我有一个很难得到的在Flex Builder 3中的应用程序所提供的编译工具挂起,但这里是我已经有:

I am coming at this from the perspective of a java developer, so I'm having a hard time getting the hang of the compilation tools provided in the Flex Builder 3 application, but here's what I already have:

  1. 在我创建了正确加载Ant任务库中的蚂蚁文件,因此可以执行< mxmlc的/> < compc命令/> 工作
  2. 我已经找到了源头code,我需要建立,并知道我要结束了什么样的名为.swc。
  1. I have created an ant file that loads the ant task library correctly, and can therefore execute <mxmlc/> and <compc/> tasks.
  2. I have located the source code that I need to build, and know what sort of .swc I want to end up with.

我要的是一个Ant脚本,将做到这些步骤是等效的:

What I want is an ant script that will do the equivalent of these steps:

  1. 我们构建项目中的所有资源(ActionScript和MXML)和资产注入的SWC文件。
  2. 的library.swf文件提取和优化

到目前为止,我有这样的:

So far I have this:

<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>

不过,它不包含任何内容:

However, it's not including any content:

[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.

它看起来像我需要枚举,我想在图书馆,这是......可笑,包括每一个类。必须有一个更好的办法。如何做到这一点?

It looks like I need to enumerate every class that I want to include in the library, which is... ludicrous. There must be a better way. How do I do this?

推荐答案

您可以执行下列操作...它需要从源路径下的所有文件,并把它转换成该compc命令任务可以再使用的格式。

You can do the following... it takes all the files from the source path and converts it to a format that the compc task can then use.

<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用于测试目的。

We use it to produce swcs for testing purposes.

这篇关于我如何可以自动的Flex组件库建设?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆