class ASRake::Compc

Attributes

include_asdoc[RW]

Public Class Methods

new(swc_file) click to toggle source

Create a compc task for the provided swc

Calls superclass method ASRake::BaseCompiler::new
# File lib/asrake/compc.rb, line 15
def initialize(swc_file)
        super(swc_file, FlexSDK::compc)
end

Public Instance Methods

execute() click to toggle source
Calls superclass method ASRake::BaseCompiler#execute
# File lib/asrake/compc.rb, line 19
def execute
        super
        # include asdoc if needed
        if self.include_asdoc
                asdoc = ASRake::Asdoc.new File.join(self.output_dir, ".asrake_temp_#{Time.now.to_i}_#{rand(1000)}")
                asdoc.add(self)
                asdoc.keep_xml = true
                asdoc.skip_xsl = true
                asdoc.lenient = true
                puts "> #{FlexSDK::asdoc}"
                asdoc.execute {|line| puts ">    #{line}"}

                if output_is_dir?
                        cp_r "#{asdoc.output}/tempdita", File.join(self.output_dir, "docs")
                else
                        Zip::ZipFile.open(self.output) do |zipfile|
                                # remove existing docs (eg, from -include-libraries linking a swc with pre-existing docs)
                                begin
                                        zipfile.remove("docs")
                                rescue
                                        #no rescue
                                end
                                FileList["#{asdoc.output}/tempdita/*"].each do |file|
                                        zipfile.add("docs/#{File.basename(file)}", file)
                                end
                        end
                end

                rm_rf asdoc.output, :verbose => false
        end
end
generate_args() click to toggle source
Calls superclass method ASRake::BaseCompiler#generate_args
# File lib/asrake/compc.rb, line 51
def generate_args
        compc = super
        
        #compc << " -include-sources=#{Path::forward source_path.join(',')}" if !source_path.empty?
        self.source_path.each do |path|
                compc << " -include-classes #{ASRake::get_classes(path).join(' ')}"
        end

        return compc
end
merge_in(args) click to toggle source
Calls superclass method
# File lib/asrake/compc.rb, line 62
def merge_in(args)
        super
        self.include_asdoc = args.include_asdoc
end