lib/sprout/tasks/mxmlc_swc.rb in sprout-as3-bundle-0.2.3 vs lib/sprout/tasks/mxmlc_swc.rb in sprout-as3-bundle-0.2.9

- old
+ new

@@ -1,26 +1,47 @@ module Sprout # :nodoc: - class MXMLCSWC < MXMLCHelper # :nodoc: + + # The MXMLCSWC helper wraps a compc task to create + # a SWC library. + # + # The simple case that uses a Singleton ProjectModel: + # swc :swc + # + # Using a ProjectModel instance: + # project_model :model + # + # swc :swc => :model + # + # Configuring the proxy MXMLCTask + # swc :swc do |t| + # t.link_report = 'LinkReport.rpt' + # end + # + class MXMLCSWC < MXMLCHelper def initialize(args, &block) super - t = define_outer_task + outer_task = define_outer_task compc output do |t| configure_mxmlc t configure_mxmlc_application t + t.input = input yield t if block_given? end - t.prerequisites << output - return t + outer_task.prerequisites << output + return outer_task end def create_output return "#{create_output_base}.swc" end + def create_input + return @model.project_name + end end end def swc(args, &block) Sprout::MXMLCSWC.new(args, &block)