mxmlc and framework linkage - how to specify linkage as rsl

I'm trying to build my flex 4 project using ant. In Flash Builder 4, in project properties it's possible to set the "Framework linkage" to one of "Merged into code", "Runtime Shared Library (RSL)" or "Use SDK Default (Runtime Shared library)". How can I set the equivalent as mxmlc options in build.xml?

My current build.xml looks like this:

<target name="myapp">
    <mxmlc 
        file="${PROJECT_ROOT}/myapp.mxml" 
        output="${DEPLOY_DIR}/myapp.swf"
        actionscript-file-encoding="UTF-8"
        keep-generated-actionscript="false"
        warnings="false" optimize="true" incremental="false" >

        <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/> 

        <source-path path-element="${FLEX_FRAMEWORKS}"/> 

        <compiler.debug>true</compiler.debug>

        <runtime-shared-library-path path-element="${FLEX_FRAMEWORKS}/libs/framework.swc">
            <url rsl-url="framework_4.0.0.14159.swz"/>
            <url rsl-url="framework_4.0.0.14159.swf"/>
        </runtime-shared-library-path>                       

        <compiler.source-path path-element="src"/>

        <!-- List of external libraries -->
        <compiler.source-path path-element="${MY_LIB}/src" />

        <!-- List of SWC files or directories that contain SWC files. -->
        <compiler.library-path dir="libs" append="true">
            <include name="*.swc" />
        </compiler.library-path>

        <copy todir="${DEPLOY_DIR}" file="${FLEX_FRAMEWORKS}/rsls/framework_4.0.0.14159.swz"/>
        <copy todir="${DEPLOY_DIR}" file="${FLEX_FRAMEWORKS}/rsls/framework_4.0.0.14159.swf"/>

    </mxmlc>
</target>

I assumed that setting the runtime-shared-library-path directive and copying the framework swf, swz files into my target folder would make things work, but this does not seem to be the case.

The way I'm assessing whether this works is as follows: I use a custom preloader, and for it to work I need to have framework linkage as RSL. With "merged into code", my preloader gets stuck at a certain point and does not progress to my application swf. This is the same behavior i see when i use the above build.xml, which makes me think that the SWF is being built with framework linkage merged into code (rather than RSL linked).

A related question to this is how to determine if my swf is using RSL or not. I guess I could look at the size of the compiled output. But it seems there should be a way to tell if I'm using the external framework file or it's being bundled into the SWF somehow, without my knowledge.

5
задан cybertoast 1 November 2010 в 20:45
поделиться