开发者

Why does Flexmojos produce a different size swf to mxmlc?

I am compiling a very simple app, Main.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark">

    <s:Label
        text="Flex"/>

</s:Application>

With mxmlc (SDK 4.0.0.14159):

mxmlc 
-context-root=a 
-services=.\src\main\webapp\WEB-INF\flex\services-config.xml 
src\main\flex\Main.mxml 
-output src\main\webapp\Main.swf

And also with Flexmojos 3.9 & 4.0-RC2, using SDK 4.0.0.14159:

<configuration>
    <output>src/main/webapp/Main.swf</output>
    <services>src/main/webapp/WEB-INF/flex/services-config.xml</services>
    <contextRoot>a</contextRoot>
</configuration>

The output from both builds creates a valid swf file that works as expected, yet the swf file from mxmlc is much smaller than the Flexmojos version:

mxmlc      Main.swf   43k
flexmojos  Main.swf  367k

This is quite worrying because I am developing in Eclipse (which uses mxmlc) yet my master build script (which uses flexmojos) is producing a totally different file.

Can anyone tell me why this is, and how t开发者_开发百科o rectify it?

Thanks


It seems, that compilation with flexmojos includes flex framework classes in output swf. And compilation with mxmlc in your case uses framework swfs as RSL.


MXMLC will be pulling in the flex-config.xml from the Flex SDK install that specifies the default linkage (mostly RSL) for the Flex runtime - meaning a smaller SWF file.

I'm not familiar with how Flexmojos work, so you'll need to learn how to set up the equivalent arguments. It may be possible to tell Flexmojos to use the same default config XML file.

I implemented a Flex build using Gradle and we have different file sizes even though we're supposed to be using the same compiler and the same settings as in Flash Builder (Eclipse) - though the difference is very small and our dependencies are linked as expected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜