Module: Buildr::AS3::Apparat::Tasks

Includes:
Extension
Included in:
Project
Defined in:
lib/buildr/as3/apparat.rb

Instance Method Summary collapse

Instance Method Details

#apparat_reducer(quality) ⇒ Object



133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/buildr/as3/apparat.rb', line 133

def apparat_reducer(quality)
  output = Buildr::AS3::Compiler::CompilerUtils::get_output(project, compile.target, compile.packaging, compile.options)
  apparat_tk = compile.options[:apparat].invoke
  cmd_args = []
  cmd_args << "#{apparat_tk.reducer}"
  cmd_args << "-i #{output}"
  cmd_args << "-o #{output}"
  cmd_args << "-q"
  cmd_args << quality || 100
  ENV["PATH"] = "#{apparat_tk.scala_home}#{File::Separator}bin#{File::PATH_SEPARATOR}#{ENV["PATH"]}" if apparat_tk.scala_home && !ENV["PATH"].include?("#{apparat_tk.scala_home}/bin")
  system(cmd_args.join " ")
end

#apparat_tdsi(options = {}) ⇒ Object



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/buildr/as3/apparat.rb', line 117

def apparat_tdsi(options = {})
  output = Buildr::AS3::Compiler::CompilerUtils::get_output(project, compile.target, compile.packaging, compile.options)
  apparat_tk = compile.options[:apparat].invoke
  cmd_args = []
  cmd_args << "#{apparat_tk.tdsi}"
  cmd_args << "-i #{output}"
  cmd_args << "-o #{output}"
  reserved = []
  options.to_hash.reject { |key, value| reserved.include?(key) }.
      each do |key, value|
    cmd_args << "-#{key} #{value}"
  end
  ENV["PATH"] = "#{apparat_tk.scala_home}/bin#{File::PATH_SEPARATOR}#{ENV["PATH"]}" if apparat_tk.scala_home && !ENV["PATH"].include?("#{apparat_tk.scala_home}/bin")
  system(cmd_args.join " ")
end