Skip to content

Instantly share code, notes, and snippets.

@Lytol Lytol/gist:91655
Created Apr 8, 2009

Embed
What would you like to do?
FLEX_SRC = File.join(File.dirname(__FILE__), "src")
FLEX_LIB = File.join(File.dirname(__FILE__), "lib")
FLEX_BIN = File.join(File.dirname(__FILE__), "bin-debug")
task :default => [:compile, :run]
desc "Compile the Flex app"
task :compile do
Dir.chdir(FLEX_SRC) do
Dir["*.mxml"].each do |source_file|
output_file = source_file.gsub(/mxml$/,'swf')
puts "Compiling #{source_file} => #{output_file}"
sh %{ mxmlc --show-actionscript-warnings=true --strict=true -locale en_US -library-path+=#{FLEX_LIB} #{source_file} }
move output_file, "#{FLEX_BIN}/", :verbose => true
end
end
end
"Run the compiled swf in Flash Player"
task :run do
Dir[FLEX_BIN + "/*.swf"].each do |swf|
sh %{ open #{swf} -a "Flash Player" }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.