Flex 4 swc size smaller compiled by FlashBuilder than using ANT
I'm trying to figure out why when I compile my Flex 4 Library swc using a simple ANT tasks, it compiles to about three times the size of the swc that's compiled by FlashBuilder.
Here is my ANT script to compile my swc
<target name="compileSWC" description="compiles the Library">
<echo>Compiling Library SWC To Deploy SWC Folder</echo>
<compc debug="false
output="${bin.dir}/${Library.name}-${timeVersion}.swc"
incremental="true"
optimize="true"
headless-server="true"
verbose-stacktraces="true"
default-frame-rate="24">
<source-path path-element="${src.dir}" />
<include-sources dir="${src.dir}" includes="*"/>
<source-path path-element="${src.dir}" />
<compiler.library-path dir="${basedir}/" append="true">
<include name="${library.dir}" />
</compiler.library-path>
</compc>
<echo>Compiled Library SWC To Deploy SWC Folder</echo>
</target>
This yields a swc that is 1,980 KB. This library file has custom components, some skins and images, so I was ok with the file size. But when I use the FlashBuilder to link my Library project to other Flex projects, the compiled swc is only 532 KB.
I am able to move the FlashBuilder compiled swc to any project and it works just fine.
So I'm wondering what is FlashBuilder doing different than my ANT build script to get that file size down? I tried adding 'static-link-runtime-shared-libraries="true"' to my ANT script, but I had th开发者_Go百科e same results.
Thanks.
Have you tried spitting out the config from the FB compile and using that in the ant task? You can use the compiler option
-dump-config fb_config.xml
And then use the load-config tag to pull it into your ant task.
Here's a KB article that runs through it: http://kb2.adobe.com/cps/404/kb404341.html
Hope that helps, Ruprict
Don't know why but after loading my configuration the compiler is whining about the compiler.extensions, it says is an unknown configuration variable, here's the stack:
Buildfile: C:\Users\cgascons\Documents\workspace\TCGEngine\build.xml
generateAssets:
[echo] Target::generateAssets
compile:
[echo] Target::compile
[mxmlc] Unknown:compiler.extensions
[mxmlc] Loading configuration: C:\Users\cgascons\Documents\workspace\TCGEngine\ant_config.xml
[mxmlc] C:\Users\cgascons\Documents\workspace\TCGEngine\ant_config.xml:8
[mxmlc] Warning: 'compiler.accessible' is not fully supported.
[mxmlc] <accessible>false</accessible>
[mxmlc] C:\Users\cgascons\Documents\workspace\TCGEngine\ant_config.xml:49
[mxmlc] Error: unknown configuration variable 'compiler.extensions'.
[mxmlc] C:\Users\cgascons\Documents\workspace\TCGEngine\ant_config.xml (line: 49)
[mxmlc] <extensions>
BUILD FAILED
C:\Users\cgascons\Documents\workspace\TCGEngine\build.xml:18: mxmlc task failed
Does anybody know what could be happening here?
精彩评论