Compiled files are much larger than Flash Builder

8 views
Skip to first unread message

suckerpunch

unread,
May 10, 2011, 7:02:14 AM5/10/11
to ProjectSprouts
I'm compiling my SWC like this:

----------------------------------------------------------------------------------------------------

version = "0.7.5"

def configure t
t.library_path << 'lib'
t.source_path << 'src'
t.include_sources << 'src'
t.optimize = true
t.target_player = '10.1'
end

compc "bin/birdbase-#{version}.swc" do |t|
configure t
t.debug = false
t.define_conditional << 'CONFIG::release,true'
t.define_conditional << 'CONFIG::debug,false'
end


desc "Compile and run the debug swc"
task :swc => "bin/birdbase-#{version}.swc"

----------------------------------------------------------------------------------------------------

And my filesize is 329, 170 bytes.

Flash Builder's compile is 258, 265 bytes.

Now clearly, I'm including a bunch of stuff in the Sprouts compile
that I shouldn't be, and I would like both compiles to generate
effectively identical files - how do I get the compile lines identical
between FB and Sprouts?

Thanks :)

Dan Tripp

unread,
May 10, 2011, 9:18:35 AM5/10/11
to project...@googlegroups.com
That subject line was kinda misleading... I thought "wow, a compiled SWF is ~ 850 MBs?  That's not right!"  :)

Unless I'm completely out to lunch I believe Project Sprouts uses the same compiler under the hood that Fl(ash|ex) Builder uses (or whatever it's called this week).  There isn't a "Project Sprouts Compiler"; it uses MXMLC, the Flex compiler from Adobe.


I believe there are some switches/params one can set in Project Sprouts but I'm lame and can't point you to them at the moment.  :)

- Dan




--
You received this message because you are subscribed to the Google Groups "ProjectSprouts" group.
To post to this group, send email to project...@googlegroups.com
To unsubscribe from this group, send email to projectsprout...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/projectsprouts?hl=en

For other info you can visit our project at: http://projectsprouts.org, or on Github at: http://github.com/lukebayes/project-sprouts

suckerpunch

unread,
May 10, 2011, 9:28:20 AM5/10/11
to ProjectSprouts
Heh, no, obviously they both use MXMLC, but there's clearly a
different set of compiler options being passed in. I think the easiest
way to fix this would be to figure out what the Flash Builder compile
line would be and try and replicate that in the Sprouts configuration.

suckerpunch

unread,
May 10, 2011, 9:52:21 AM5/10/11
to ProjectSprouts
Ok, I have the answer.

Add this to the compiler options in Flash Builder:

-dump-config /path/to/output/flex-config.xml

And then in the sprouts Rakefile:

t.load_config << 'flex-config.xml'

I now have two SWCs with the exact same file size.

Cheers all :) Hope this helps someone.

Simon Bailey

unread,
May 10, 2011, 10:00:29 AM5/10/11
to project...@googlegroups.com
Curious as to what is in your flex-config xml as I dont have Flash Builder, would you be able to stick the contents on the list at all?

Cheers,

Simon

--
You received this message because you are subscribed to the Google Groups "ProjectSprouts" group.
To post to this group, send email to project...@googlegroups.com
To unsubscribe from this group, send email to projectsprout...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/projectsprouts?hl=en

For other info you can visit our project at: http://projectsprouts.org, or on Github at: http://github.com/lukebayes/project-sprouts



--
Kind Regards,

Simon Bailey


newtriks.com

suckerpunch

unread,
May 10, 2011, 10:17:28 AM5/10/11
to ProjectSprouts
Yup, here it is, complete with paths to my Flash Builder installation:

http://pastie.org/1885154

Simon Bailey

unread,
May 10, 2011, 10:39:15 AM5/10/11
to project...@googlegroups.com
Excellent thanks mate!

On 10 May 2011 15:17, suckerpunch <vish.vi...@gmail.com> wrote:
Yup, here it is, complete with paths to my Flash Builder installation:

http://pastie.org/1885154

--
You received this message because you are subscribed to the Google Groups "ProjectSprouts" group.
To post to this group, send email to project...@googlegroups.com
To unsubscribe from this group, send email to projectsprout...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/projectsprouts?hl=en

For other info you can visit our project at: http://projectsprouts.org, or on Github at: http://github.com/lukebayes/project-sprouts

Luke Bayes

unread,
May 10, 2011, 11:45:08 AM5/10/11
to project...@googlegroups.com
Thanks for this thread, and for posting the solution!

I have looked into this a bit in the past, and just wanted to make the point that the SWC compiler (compc) is quite a bit more greedy (thankfully) than the SWF compiler (mxmlc).

Fortunately, if you refer to that SWC from a SWF project, you will only bring in the classes you require, and the SWF files *should* be identically sized. Please let me know if you see different behavior in this case.

Thanks!

Luke

suckerpunch

unread,
May 11, 2011, 10:53:21 AM5/11/11
to ProjectSprouts
Heh, well, actually, the SWF is a lot bigger too when using Sprouts,
but I imagine that the fix should be the same.

Luke Bayes

unread,
May 12, 2011, 2:54:17 AM5/12/11
to project...@googlegroups.com
Interesting.

Even with debug=false?

Thanks even more for the post!

Luke


On Wed, May 11, 2011 at 7:53 AM, suckerpunch <vish.vi...@gmail.com> wrote:
> Heh, well, actually, the SWF is a lot bigger too when using Sprouts,
> but I imagine that the fix should be the same.
>

Luke Bayes

unread,
May 12, 2011, 2:53:40 PM5/12/11
to project...@googlegroups.com
Sorry - what I meant was:

debug=false and optimize=true

Thanks,

Luke
Reply all
Reply to author
Forward
0 new messages