Created
April 8, 2009 05:57
-
-
Save Lytol/91655 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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