public

Default AS3 Rakefile - without Task Helpers

  • Download Gist
Project Sprouts Example Rakefile.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
require 'sprout'
# Load gems from a server other than rubyforge:
set_sources 'http://gems.gemcutter.org'
sprout 'as3'
 
############################################
# Configure ProjectModel to be used by
# script/generate for appropriate bundles.
 
project_model :model do |m|
m.project_name = 'SomeProject'
m.language = 'as3'
end
 
############################################
# Configure CompilerModel to be shared with
# whichever tasks add it as a prerequisite.
 
tool_task_model :compiler_model do |m|
m.source_path = []
m.source_path << 'src'
m.source_path << 'assets'
m.input = 'src/SomeProject.as'
m.default_size = '970 550'
m.default_background_color = '#ffffff'
m.debug = true
end
 
############################################
# Configure :debug
# http://projectsprouts.org/rdoc/classes/Sprout/MXMLCTask.html
# http://projectsprouts.org/rdoc/classes/Sprout/FlashPlayerTask.html
 
mxmlc 'bin/SomeProject-debug.swf' => :compiler_model do |t|
end
 
desc 'Compile and debug the application'
flashplayer :debug => 'bin/SomeProject-debug.swf'
 
# set :debug as the :default task
task :default => :debug
 
############################################
# Configure :test
# http://projectsprouts.org/rdoc/classes/Sprout/MXMLCTask.html
# http://projectsprouts.org/rdoc/classes/Sprout/FlashPlayerTask.html
 
library :asunit3
 
mxmlc 'bin/SomeProjectRunner.swf' => [:compiler_model, :asunit3] do |t|
t.source_path << 'test'
t.input = 'src/SomeProjectRunner.as'
end
 
desc 'Compile and debug the test harness'
flashplayer :test => 'bin/SomeProjectRunner.swf'
 
############################################
# Configure :deploy
# http://projectsprouts.org/rdoc/classes/Sprout/MXMLCTask.html
# http://projectsprouts.org/rdoc/classes/Sprout/FlashPlayerTask.html
 
mxmlc 'bin/SomeProject.swf' => :compiler_model do |t|
t.debug = false
t.optimize = true
end
 
desc 'Compile the optimized SWF for deployment'
task :deploy => [:clean, 'bin/SomeProject.swf']
 
############################################
# Configure :swc
# http://projectsprouts.org/rdoc/classes/Sprout/COMPCTask.html
 
compc 'bin/SomeProject.swc' => :compiler_model do |t|
t.input = 'SomeProject'
end
 
desc 'Compile the project as a SWC'
task :swc => 'bin/SomeProject.swc'
 
############################################
# Configure AsDoc
# http://projectsprouts.org/rdoc/classes/Sprout/AsDocTask.html
 
asdoc :doc => [:clean, :compiler_model] do |t|
t.doc_sources << 'src/SomeProject.as'
end
 
############################################
# Configure :cruise to compile and run
# test harness, then write results to disk
# and close the Flash Player.
#
# http://projectsprouts.org/rdoc/classes/Sprout/MXMLCTask.html
# http://projectsprouts.org/rdoc/classes/Sprout/FDBTask.html
#
# NOTE: The FDBTask cannot target a specific player, it
# will launch whatever player is the default on your system.
# You may need to ensure your system default player is configured
# correctly.
 
mxmlc 'bin/SomeProjectXMLRunner.swf' => [:compiler_model, :asunit3] do |t|
t.source_path << 'test'
t.input = 'src/SomeProjectXMLRunner.as'
end
 
desc 'Compile and run the CI task'
fdb :cruise => 'bin/SomeProjectXMLRunner.swf' do |t|
t.file = 'bin/SomeProjectXMLRunner.swf'
t.kill_on_fault = true
t.run
# You can set breakpoints in here like:
# t.break = 'SomeProjectXMLRunner:13'
t.continue
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.