【问题标题】:Building a SWC from IntelliJ Idea without resorting to ant?从 IntelliJ Idea 构建 SWC 而不求助于 ant?
【发布时间】:2010-01-18 06:39:20
【问题描述】:

首先,这是我想要做的:

* 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),添加 -compiler.external-library-path 引用到 SDK 和 PlayerGlobal.swc。这应该可行,但是当我使用自定义配置文件时,Idea 不会让我设置命令行参数:'(

非常感谢任何建议!

【问题讨论】:

    标签: apache-flex intellij-idea swc


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-27
      • 1970-01-01
      • 2013-07-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多