swc file size

jhon's Avatar

jhon

05 Nov, 2012 10:18 PM

Hi

I am using gradle to compile my swc project using the attached build.file. All the dependencies, including the flex framework, are linked as external resources. I have a similar setting on Flash Builder, and when I compile the source, using flash builder the resulting file size is 23,077 bytes.

Using gradle the resulting file size seems to be 26995 bytes, take a look to the logs generated by gradle below, but the actual size of the resulting swc is 184274 bytes. any idea why the resulting swc is several times larger than the one generated by flash builder?

thanks

workstation:ProServASLib jhon$ gradle compile
:asdoc UP-TO-DATE :compile Loading configuration file /Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/flex-config.xml
/Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/build/ProServASLib.swc (26995 bytes) [ant:zip] Updating zip: /Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/build/ProServASLib.swc

BUILD SUCCESSFUL

Total time: 10.625 secs
workstation:ProServASLib jhon$ ls -l build
total 360
-rw-r--r-- 1 jhon VIDMARK\domain users 184274 Nov 5 16:59 ProServASLib.swc workstation:ProServASLib jhon$

  1. Support Staff 1 Posted by Yennick Trevels on 06 Nov, 2012 07:40 AM

    Yennick Trevels's Avatar

    Hi Jhon,

    It looks like you are using GradleFx 0.5, which had a bug that causes the dependencies of a swc project to not be declared as external by default. That is probably causing this rather big increase in swc file size.

    Good news is that I released GradleFx 0.6 last sunday, so this should be fixed in this version. This version does include some breaking changes, so please have a look at the changelog to see if you have to change something to your buildscript when migrating to this version: https://github.com/GradleFx/GradleFx/blob/master/CHANGELOG.textile

  2. 2 Posted by jhon on 06 Nov, 2012 03:19 PM

    jhon's Avatar

    Hi Yennick

    Thanks for your promptly response, I'll take a look to the new version.

  3. 3 Posted by jhon on 06 Nov, 2012 05:10 PM

    jhon's Avatar

    Hi

    GradleFX 0.6 did NOT solve my problem, see my logs below

    Thanks

    workstation-think1:ProServASLib jhon$ gradle clean
    :clean

    BUILD SUCCESSFUL

    Total time: 4.99 secs
    workstation-think1:ProServASLib jhon$ gradle compile
    :asdoc :compileFlex Compiling with compc

    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc
    -runtime-shared-library-path=
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/framework.swc
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/textLayout.swc
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/spark.swc
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/sparkskins.swc
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/rpc.swc
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/charts.swc
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/spark_dmv.swc
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/osmf.swc
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/mx/mx.swc
    -external-library-path+=/Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/libs/advancedgrids.swc
    -source-path+=/Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/src
    -include-sources+=/Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/src
    -include-file
    facebook-btn.gif
    /Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/assets/facebook-btn.gif
    -include-file
    twitter-btn.gif
    /Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/assets/twitter-btn.gif
    -external-library-path+=/Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/lib/as3commons-logging-2.7.swc
    -external-library-path+=/Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/lib/as3corelib.swc
    -external-library-path+=/Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/lib/BrightcovePlayerAPI.swc
    -external-library-path+=/Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/lib/CasaLib_1.4.1.swc
    -external-library-path+=/Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/lib/flash.swc
    -output=/Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/build/ProServASLib.swc
    

    [compc] Loading configuration file /Users/jhon/Desktop/FlexBuildTools/flex/4.6.0/frameworks/flex-config.xml /Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/build/ProServASLib.swc (25025 bytes) [ant:zip] Updating zip: /Users/jhon/Documents/Adobe Flash Builder 4.5/ProServASLib/build/ProServASLib.swc

    BUILD SUCCESSFUL

    Total time: 33.604 secs
    workstation-think1:ProServASLib jhon$ ls -l build
    total 360
    -rw-r--r-- 1 jhon VIDMARK\domain users 182304 Nov 6 12:06 ProServASLib.swc workstation-think1:ProServASLib jhon$

  4. Support Staff 4 Posted by Yennick Trevels on 06 Nov, 2012 05:56 PM

    Yennick Trevels's Avatar

    it may have something to do with the asdoc. are you creating a fat swc?

  5. 5 Posted by jhon on 06 Nov, 2012 06:06 PM

    jhon's Avatar

    Good catch!! That was exactly the problem

    Thanks for your help.

  6. Yennick Trevels closed this discussion on 07 Jan, 2013 01:16 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac