从IntelliJ Idea构建SWC而不诉诸蚂蚁?

时间:2010-01-18 06:39:20

标签: flex intellij-idea swc

首先,这就是我想要做的事情:

* Compile my library code into a SWC
* Do not staticly link the Flex framework

首先,我尝试设置一个Flex模块,单击“库”和“使用框架作为RSL”按钮。然而,这并没有将我的任何代码编译到SWC中,它基本上只编译整个Flex框架的新SWC,包括所有资源和类。

然后,我设法使用自定义编译器配置将我的类添加到构建中,但它仍包含我在库代码中引用的少数Flex类。

最后,我想我可以使用自定义flex-config.xml文件,使用<library-path append="false"></library-path>删除对库的父引用,然后使用自定义命令行参数(以及来自ant),添加{{ 1}}对SDK和PlayerGlobal.swc的引用。这应该可行,但是当我使用自定义配置文件时,Idea不会让我设置命令行参数:'(

非常感谢任何建议!

1 个答案:

答案 0 :(得分:2)

好的,通过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>