Class: Buildr::AS3::Compiler::Mxmlc
- Inherits:
-
Compiler::Base
- Object
- Compiler::Base
- Buildr::AS3::Compiler::Mxmlc
- Includes:
- CompilerUtils
- Defined in:
- lib/buildr/as3/compiler.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #compile(sources, target, dependencies) ⇒ Object
-
#initialize(project, options) ⇒ Mxmlc
constructor
A new instance of Mxmlc.
Methods included from CompilerUtils
#append_args, #get_last_modified, get_output, #is_output_outdated?, #move_dependency_dirs_to_source, #needed?, #older, #reserved_options, #timestamp_from_file
Constructor Details
#initialize(project, options) ⇒ Mxmlc
Returns a new instance of Mxmlc.
114 115 116 117 |
# File 'lib/buildr/as3/compiler.rb', line 114 def initialize(project, ) super @project = project end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
112 113 114 |
# File 'lib/buildr/as3/compiler.rb', line 112 def project @project end |
Instance Method Details
#compile(sources, target, dependencies) ⇒ Object
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/buildr/as3/compiler.rb', line 121 def compile(sources, target, dependencies) puts dependencies.join("\n") flex_sdk = [:flexsdk].invoke output = CompilerUtils::get_output(project, target, :swf, ) move_dependency_dirs_to_source( sources, dependencies) cmd_args = [] cmd_args << "-jar" << flex_sdk.mxmlc_jar cmd_args << "+flexlib" << "#{flex_sdk.home}/frameworks" cmd_args << [:main] cmd_args << "-output" << output cmd_args << "-load-config" << flex_sdk.flex_config append_args(cmd_args,[:append]) sources.each {|source| cmd_args << "-source-path+=#{source}"} # cmd_args << "-source-path" << sources.join(" ") cmd_args << "-library-path+=#{dependencies.join(",")}" unless dependencies.empty? [:debug] = Buildr..debug.to_s .to_hash.reject { |key, value| .include?(key) }. each do |key, value| cmd_args << "-#{key}=#{value}" end flex_sdk..each do |key, value| cmd_args << "-#{key}=#{value}" end puts "args:", cmd_args unless Buildr.application..dryrun Java::Commands.java cmd_args end end |