Skip to content

Instantly share code, notes, and snippets.

@Lytol
Created April 8, 2009 05:57
Show Gist options
  • Save Lytol/91655 to your computer and use it in GitHub Desktop.
Save Lytol/91655 to your computer and use it in GitHub Desktop.
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