lib/sprout/generators/project/templates/rakefile.rb in sprout-as3-bundle-0.1.45 vs lib/sprout/generators/project/templates/rakefile.rb in sprout-as3-bundle-0.2.1
- old
+ new
@@ -2,105 +2,42 @@
# Optionally load gems from a server other than rubyforge:
# set_sources 'http://gems.projectsprouts.org'
sprout 'as3'
############################################
-# Uncomment and modify any of the following:
-Sprout::ProjectModel.setup do |model|
- model.project_name = '<%= project_name %>'
- # Default Values:
- # model.src_dir = 'src'
- # model.lib_dir = 'lib'
- # model.swc_dir = 'lib'
- # model.bin_dir = 'bin'
- # model.test_dir = 'test'
- # model.doc_dir = 'doc'
- # model.asset_dir = 'assets'
- model.language = 'as3'
- model.output = "#{model.bin_dir}/<%= project_name %>.swf"
- model.test_output = "#{model.bin_dir}/<%= project_name %>Runner.swf"
+# Configure your Project Model
+project_model :model do |m|
+ m.project_name = '<%= project_name %>'
+ m.language = 'as3'
+ m.background_color = '#FFFFFF'
+ m.width = 970
+ m.height = 550
+ # m.src_dir = 'src'
+ # m.lib_dir = 'lib'
+ # m.swc_dir = 'lib'
+ # m.bin_dir = 'bin'
+ # m.test_dir = 'test'
+ # m.doc_dir = 'doc'
+ # m.asset_dir = 'assets'
+ # m.compiler_gem_name = 'sprout-flex4sdk-tool'
+ # m.compiler_gem_version = '>= 4.0.0'
+ # m.source_path << "#{m.lib_dir}/somelib"
+ # m.libraries << :corelib
end
-model = Sprout::ProjectModel.instance
+desc 'Compile and run the application for debugging'
+debug :debug
-############################################
-# Set up remote library tasks
-# the task name will be converted to a string
-# and modified as follows sprout-#{name}-library
-# unless you pass t.gem_name = 'full-sprout-name'
-# For libraries that contain source code, the
-# task name will also be the folder name that
-# will be added to ProjectModel.lib_dir
-# For a complete list of available sprout gems:
-# http://rubyforge.org/frs/?group_id=3688
-# You can also search that list directly from a
-# terminal as follows:
-# gem search -r sprout-*library
+desc 'Compile and run the test harness'
+unit :test
-library :asunit3
-library :corelib
+desc 'Compile for deployment'
+deploy :deploy => :doc
-############################################
-# Launch the application using the Flash Player
-# NOTE: double-quoted strings in ruby enable
-# runtime expression evaluation using the
-# following syntax:
-# "Some String with: #{variable}"
+desc 'Generate documentation'
+document :doc
-desc "Compile and run main application"
-flashplayer :run => model.output
+desc "Generate Flex Builder project files"
+flex_builder :project
-# Make 'run' the default task
-task :default => :run
-
-############################################
-# Launch the test suites using the Flash Player
-
-desc "Compile and run test suites"
-flashplayer :test => model.test_output
-
-############################################
-# Compile your application using mxmlc
-# Any library tasks that are set as
-# dependencies will automatically be added
-# to the compiler source or swc paths
-
-desc "Compile application"
-mxmlc model.output => [:corelib] do |t|
-# Uncomment to use the Flex 3 SDK
-# t.gem_name = 'sprout-flex3sdk-tool'
- t.warnings = true
- t.default_background_color = '#FFFFFF'
- t.default_frame_rate = 24
- t.default_size = '600 400'
- t.input = "#{model.src_dir}/<%= project_name %>.as"
- t.source_path << model.asset_dir
-# t.source_path << "#{model.lib_dir}/non-sprout-src-library"
-# t.library_path << "#{model.lib_dir}/non-sprout.swc"
-end
-
-############################################
-# Compile test harness using mxmlc
-
-desc "Compile test harness"
-mxmlc model.test_output => [:asunit3, :corelib] do |t|
-# Uncomment to use the Flex 3 SDK
-# t.gem_name = 'sprout-flex3sdk-tool'
- t.warnings = true
- t.default_background_color = '#FFFFFF'
- t.default_frame_rate = 24
- t.verbose_stacktraces = true
- t.default_size = "800 450"
- t.input = "#{model.src_dir}/<%= project_name %>Runner.as"
- t.source_path << model.src_dir
- t.source_path << model.test_dir
- t.source_path << model.asset_dir
-end
-
-############################################
-# Build documentation for your application
-
-desc "Create documentation"
-asdoc model.doc_dir => model.test_output do |t|
-# Uncomment to use the Flex 3 SDK
-# t.gem_name = 'sprout-flex3sdk-tool'
-end
+# set up the default rake task
+task :default => :debug