首先,这是我想要做的:
* Compile my library code into a SWC
* Do not staticly link the Flex framework首先,我试着设置一个Flex模块,点击"library“和"use framework as an RSL”按钮。然而,这并没有将我的任何代码编译到SWC中,它基本上只是编译了整个Flex框架的一个新的SWC,包括所有的资源和类。
然后,我设法使用自定义编译器配置将我的类添加到构建中,但它仍然包含我在库代码中引用的几个Flex类。
最后,我想我可以使用自定义的flex-config.xml文件,使用<library-path append="false"></library-path>删除对库的父引用,然后使用自定义命令行参数(也来自ant),添加对SDK和PlayerGlobal.swc的-compiler.external-library-path引用。这可能会起作用,但Idea不允许我在使用自定义配置文件时设置命令行参数:'(
任何建议都是非常感谢的!
发布于 2010-01-19 08:06:52
好的,通过在Idea论坛上的帮助,大量的谷歌搜索,和随机的实验,这里是有效的。请注意,某些参数的指定方式类似于"{name}“,而有些参数的指定方式为"${name}”。不,我不知道为什么:-/
<!-- Specifies the minimum player version that will run the compiled SWF. -->
<!-- 9.0.124 is the April 2008 security release -->
<target-player>9.0.124</target-player>
<compiler>
<source-path>
<path-element>src</path-element>
</source-path>
<incremental>true</incremental>
<keep-as3-metadata append="true">
<name>Inject</name>
<name>InjectInto</name>
<name>InjectIntoContents</name>
<name>Singleton</name>
<name>PostConstruct</name>
</keep-as3-metadata>
<!-- Remove the "include" library path. -->
<library-path append="false"></library-path>
<!-- Set up an "external library" path that is compiled against but not linked. -->
<!-- SWCs not used for SP are left in but commented out to make it easier to copy this script -->
<external-library-path>
<path-element>${flexlib}/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
<path-element>${flexlib}/libs/framework.swc</path-element>
<!--<path-element>${flexlib}/libs/flex.swc</path-element>-->
<!--<path-element>${flexlib}/libs/rpc.swc</path-element>-->
<!--<path-element>${flexlib}/libs/utilities.swc</path-element>-->
<!--<path-element>${flexlib}/libs/datavisualization.swc</path-element>-->
</external-library-path>
</compiler>
<static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
<include-classes>
<class>net.expantra.smartypants.impl.InjectorImpl</class>
</include-classes>
<output>./build/SmartyPants-IOC.swc</output>
https://stackoverflow.com/questions/2084287
复制相似问题