Sha256: b0777d59524125c9fe1ec6297625d49a82a0f628a89c03e52119875a95c5a929

Contents?: true

Size: 1.33 KB

Versions: 16

Compression:

Stored size: 1.33 KB

Contents

module Sprout # :nodoc:

  # The MXMLCDeploy helper wraps up an mxmlc task by
  # using either a Singleton or provided ProjectModel instance.
  #
  # This helper turns off debugging and turns on optimization for
  # the compiled SWF file.
  #
  # The simple case that uses a Singleton ProjectModel:
  #   deploy :deploy
  #
  # Using a ProjectModel instance:
  #   project_model :model
  #
  #   deploy :deploy => :model
  #
  # Configuring the proxy Sprout::MXMLCTask
  #   deploy :deploy do |t|
  #     t.link_report = 'LinkReport.rpt'
  #   end
  #
  class MXMLCDeploy < MXMLCHelper

    def initialize(args, &block)
      super
      t = define_outer_task
      t.prerequisites << player_task_name
      
      out_task = mxmlc output do |t|
        configure_mxmlc t
        configure_mxmlc_application t
        t.debug               = false
        t.optimize            = true
        t.warnings            = false
        t.verbose_stacktraces = false
        
        block.call t if !block.nil?
      end
      
      task player_task_name => output
      return out_task
    end

    def create_input
      return File.join(@model.src_dir, @model.project_name) + input_extension
    end
    
    def create_output
      return "#{create_output_base}.swf"
    end
  
  end
end

def deploy(args, &block)
  return Sprout::MXMLCDeploy.new(args, &block)
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sprout-as3-bundle-1.0.37 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.36 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.32 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.31 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.29 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.30 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.12 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.20 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.14 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.11 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.21 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.10 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.22 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.9 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.23 lib/sprout/tasks/mxmlc_deploy.rb
sprout-as3-bundle-1.0.24 lib/sprout/tasks/mxmlc_deploy.rb