Using Specification class to point to local Flex SDK, Sprout 1.0+

20 views
Skip to first unread message

peterc

unread,
Oct 10, 2010, 2:41:23 PM10/10/10
to ProjectSprouts
Not sure if this will be helpful, one of the difficulties with the old
sprout branch was how to use a local Flex SDK for compiling. With the
latest prerelease branch, I was able to do this by using the
Specification class.

First, create a file with the Specification for a new library/SDK
(flex4sdk.rb), and give it a name and version.
Then in the rakefile, set the pkg_name and pkg_version to those in the
new Specfication file.

~Peter C

#>>>> flex4sdk.rb
Sprout::Specification.new do |s|
s.name = 'flex4.local'
s.version = '4.1.016076'
s.add_file_target do |t|
t.platform = :universal
t.load_path = "{local file path}"
# see '{gempath}/gems/flashsdk-1.0.12.pre/lib/flex4.rb' for
additional options
end

#>>>> rakefile.rb
require 'flex4sdk.rb'

compc "ribbit:compile" => [:init] do |t|
t.pkg_name = "flex4.local"
t.pkg_version = "4.1.016076"
t.load_config << "src/main/config/config-ribbit.swc.xml"
t.output = "#{OUTPUT}"
t.prerequisites << :generate_config
end

Luke Bayes

unread,
Oct 10, 2010, 7:33:20 PM10/10/10
to project...@googlegroups.com
Hey Peter,

I'm still looking to get the environment variable support into the new build, but in the meantime thanks for posting that!

If anyone else has tips and tricks or work arounds that they've found for issues, please feel free to post them to the list.


Thanks!

Luke Bayes

Luke Bayes

unread,
Oct 12, 2010, 1:37:04 PM10/12/10
to project...@googlegroups.com
Hey Peter,

I also almost forgot to mention - the release build (0.7.x) does support environment variables for tools.

You should be able to set an environment variable that is based on the gem name - if found, that path should be used.

For example, the 'sprout-flex4-tool' gem can be overridden with an environment variable like:

SPROUT_FLEX4SDK_TOOL=/[full-path-to-your-flex-home]

I expect to get the same feature working in the release build, but it's not in there at the moment.

Thanks!

Luke



--
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

peterc

unread,
Oct 12, 2010, 1:53:09 PM10/12/10
to ProjectSprouts
Thanks Luke,

I'm currently using the prerelease version here at Ribbit and have
found the Specification class to be very useful. With a Specification
file I can point to different :mxmlc, :compc, which is useful when
testing and compiling builds of the SDK from source.

Going the environment variable route would be perfect for a CI setup
or where the use case above doesn't apply.

Looking forward to the 1.0 release.

Cheers
~Peter C

Luke Bayes

unread,
Oct 12, 2010, 1:58:42 PM10/12/10
to project...@googlegroups.com
Hey Peter,

That is precisely one of the use cases that drove the rebuild.

I have some (still not-fully-functioning) updates from this weekend in the master branch (1.0 prerelease) that will make this even easier and more powerful. Also - since Adobe has finally provided digestible previous player version releases, we can start running test harnesses in a variety of runtime environments too. 

The future looks bright!

lb.
Reply all
Reply to author
Forward
0 new messages