Sha256: 3ca0f332a817b86a4e93a0a0caf2ffb7a6e74b988458935ad4a1b7e0466fa573

Contents?: true

Size: 1.9 KB

Versions: 13

Compression:

Stored size: 1.9 KB

Contents

module AsProject
  class HAMTASCError < StandardError; end

  class HAMTASC < MTASC
  
    attr_accessor :pack_path,
                  :rb_entry,
                  :rb_exclude_swf,
                  :rb_exclude_path

    def initialize(name=:compile, do_not_define=false)
      @pack_path = []
      @exclude_packages = []
      @rb_exclude_swf = []
      @rb_exclude_path = []
      super(name, true) do |s|
        s.compiler_version = '1.12.rb.20'
        s.win_url = "http://asproject.googlecode.com/files/hamtasc-#{compiler_version}.zip"
        s.win_extracted_file = "/hamtasc-#{compiler_version}/hamtasc.exe"
        s.osx_url = nil
        s.osx_extracted_file = nil
        s.unix_url = nil
        s.unix_extracted_file = nil
      end
      yield self if block_given?
      define unless do_not_define
    end
    
    def define
      if(rb_exclude_path.size > 0)
        @exclude_packages = rb_exclude_path
#        rb_exclude_path.each do |path|
#          @exclude_packages << recurse_exclude_path(path)
#        end
      end
      
      @cleaned_pack_path = []
      pack_path.each do |path|
        add_path(path, @cleaned_pack_path)
      end

      super
    end
    
    def remote_task_name
      return "hamtasc-#{compiler_version}"
    end

    def compile_task_desc
      return "Compile #{name} using HAMTASC"
    end
    
    def option_list
      result = super
      input = result.pop if(input) 
      result << "-rb_entry" << rb_entry if rb_entry
#      result << "-rb_exclude_swf" << clean_path(rb_exclude_swf) if rb_exclude_swf
      result << "-rb_exclude_swf " << @rb_exclude_swf.join(" -rb_exclude_swf ") if @rb_exclude_swf.size > 0
      result << "-rb_exclude_package " << @exclude_packages.join(" -rb_exclude_package ") if @exclude_packages.size > 0
      result << "-pack " + @cleaned_pack_path.join(" -pack ") if pack_path.size > 0
      result << input if input
      return result
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
asproject-0.1.118 lib/tasks/hamtasc.rb
asproject-0.1.44 lib/tasks/hamtasc.rb
asproject-0.1.43 lib/tasks/hamtasc.rb
asproject-0.1.60 lib/tasks/hamtasc.rb
asproject-0.1.68 lib/tasks/hamtasc.rb
asproject-0.1.75 lib/tasks/hamtasc.rb
asproject-0.1.69 lib/tasks/hamtasc.rb
asproject-0.1.71 lib/tasks/hamtasc.rb
asproject-0.1.74 lib/tasks/hamtasc.rb
asproject-0.1.92 lib/tasks/hamtasc.rb
asproject-0.1.80 lib/tasks/hamtasc.rb
asproject-0.1.84 lib/tasks/hamtasc.rb
asproject-0.1.89 lib/tasks/hamtasc.rb