Class: Sprout::MXMLCDeploy

Inherits:
MXMLCHelper show all
Defined in:
lib/sprout/tasks/mxmlc_deploy.rb

Overview

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

Instance Attribute Summary

Attributes inherited from MXMLCHelper

#model, #use_fcsh

Instance Method Summary collapse

Methods inherited from MXMLCHelper

#input, #output, #prerequisites, #task_name

Constructor Details

#initialize(args, &block) ⇒ MXMLCDeploy

Returns a new instance of MXMLCDeploy.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/sprout/tasks/mxmlc_deploy.rb', line 25

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

Instance Method Details

#create_inputObject



45
46
47
# File 'lib/sprout/tasks/mxmlc_deploy.rb', line 45

def create_input
  return File.join(@model.src_dir, @model.project_name) + input_extension
end

#create_outputObject



49
50
51
# File 'lib/sprout/tasks/mxmlc_deploy.rb', line 49

def create_output
  return "#{create_output_base}.swf"
end