Class: AsProject::MTASC
- Inherits:
-
RemoteFileTask
- Object
- Rake::TaskLib
- RemoteFileTask
- AsProject::MTASC
- Defined in:
- lib/tasks/mtasc.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#compiler_version ⇒ Object
Returns the value of attribute compiler_version.
-
#cp ⇒ Object
Returns the value of attribute cp.
-
#exclude ⇒ Object
Returns the value of attribute exclude.
-
#frame ⇒ Object
Returns the value of attribute frame.
-
#group ⇒ Object
Returns the value of attribute group.
-
#header ⇒ Object
Returns the value of attribute header.
-
#infer ⇒ Object
Returns the value of attribute infer.
-
#input ⇒ Object
Returns the value of attribute input.
-
#keep ⇒ Object
Returns the value of attribute keep.
-
#main ⇒ Object
Returns the value of attribute main.
-
#msvc ⇒ Object
Returns the value of attribute msvc.
-
#mx ⇒ Object
Returns the value of attribute mx.
-
#name ⇒ Object
Returns the value of attribute name.
-
#out ⇒ Object
Returns the value of attribute out.
-
#pack ⇒ Object
Returns the value of attribute pack.
-
#strict ⇒ Object
Returns the value of attribute strict.
-
#swf ⇒ Object
Returns the value of attribute swf.
-
#trace ⇒ Object
Returns the value of attribute trace.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
-
#version ⇒ Object
Returns the value of attribute version.
-
#wimp ⇒ Object
Returns the value of attribute wimp.
Attributes inherited from RemoteFileTask
#osx_extracted_file, #osx_mounted_path, #osx_url, #unix_extracted_file, #unix_url, #user_task, #win_extracted_file, #win_url
Instance Method Summary collapse
- #add_path(path, list) ⇒ Object
- #compile_task_desc ⇒ Object
-
#define ⇒ Object
Create the tasks defined by this task lib.
-
#initialize(name = :compile, do_not_define = false) ⇒ MTASC
constructor
A new instance of MTASC.
- #option_list ⇒ Object
- #recurse_exclude_path(dir) ⇒ Object
- #remote_task_name ⇒ Object
Methods inherited from RemoteFileTask
#clean_path, #define_user_task, #execute, #extracted_file_path, #user
Constructor Details
#initialize(name = :compile, do_not_define = false) ⇒ MTASC
Returns a new instance of MTASC.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/tasks/mtasc.rb', line 29 def initialize(name=:compile, do_not_define=false) @compiler_version = '1.13' @options = [] @cp = [] @pack = [] @user_task = nil @win_url = "http://www.mtasc.org/zip/mtasc-#{compiler_version}.zip" @win_extracted_file = "/mtasc-#{compiler_version}/mtasc.exe" @osx_url = "http://mtasc.org/zip/mtasc-1.12-osx.zip" @osx_extracted_file = "/mtasc-1.12-osx/mtasc" @unix_url = nil @unix_extracted_file = nil super(name, true) define unless do_not_define end |
Instance Attribute Details
#compiler_version ⇒ Object
Returns the value of attribute compiler_version.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def compiler_version @compiler_version end |
#cp ⇒ Object
Returns the value of attribute cp.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def cp @cp end |
#exclude ⇒ Object
Returns the value of attribute exclude.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def exclude @exclude end |
#frame ⇒ Object
Returns the value of attribute frame.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def frame @frame end |
#group ⇒ Object
Returns the value of attribute group.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def group @group end |
#header ⇒ Object
Returns the value of attribute header.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def header @header end |
#infer ⇒ Object
Returns the value of attribute infer.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def infer @infer end |
#input ⇒ Object
Returns the value of attribute input.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def input @input end |
#keep ⇒ Object
Returns the value of attribute keep.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def keep @keep end |
#main ⇒ Object
Returns the value of attribute main.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def main @main end |
#msvc ⇒ Object
Returns the value of attribute msvc.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def msvc @msvc end |
#mx ⇒ Object
Returns the value of attribute mx.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def mx @mx end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def name @name end |
#out ⇒ Object
Returns the value of attribute out.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def out @out end |
#pack ⇒ Object
Returns the value of attribute pack.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def pack @pack end |
#strict ⇒ Object
Returns the value of attribute strict.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def strict @strict end |
#swf ⇒ Object
Returns the value of attribute swf.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def swf @swf end |
#trace ⇒ Object
Returns the value of attribute trace.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def trace @trace end |
#verbose ⇒ Object
Returns the value of attribute verbose.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def verbose @verbose end |
#version ⇒ Object
Returns the value of attribute version.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def version @version end |
#wimp ⇒ Object
Returns the value of attribute wimp.
7 8 9 |
# File 'lib/tasks/mtasc.rb', line 7 def wimp @wimp end |
Instance Method Details
#add_path(path, list) ⇒ Object
99 100 101 102 103 104 105 106 107 108 |
# File 'lib/tasks/mtasc.rb', line 99 def add_path(path, list) as_files = FileList[path + '/**/**/*.as'] file as_files file out => as_files xml_files = FileList[path + '/**/**/*.xml'] file xml_files file out => xml_files list << clean_path(path) end |
#compile_task_desc ⇒ Object
50 51 52 |
# File 'lib/tasks/mtasc.rb', line 50 def compile_task_desc return "Compile #{name} using MTASC" end |
#define ⇒ Object
Create the tasks defined by this task lib.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/tasks/mtasc.rb', line 55 def define super # if(!swf && !header && pack_path.size == 0) # raise MTASCError.new('MTASC task must be provided with an swf, a header argument, or at least one pack_path') # end # if(header && !swf && out) # raise MTASCError.new('It looks like you used the out parameter where you should have used the swf parameter') # end desc compile_task_desc task name => [out] CLEAN.add(out) if(swf) file swf task name => [swf] end @cleaned_class_paths = [] cp.each do |path| add_path(path, @cleaned_class_paths) end file out do |f| # if(input && !File.exists?(input)) # raise MTASCError.new('MTASC.input must be an existing file') # end user_task.execute(option_list.join(' ')) end self end |
#option_list ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/tasks/mtasc.rb', line 110 def option_list result = @options.dup result << "-header" << header if header result << "-cp " + @cleaned_class_paths.join(" -cp ") if cp.size > 0 result << "-exclude" << exclude if exclude result << "-frame" << frame if frame result << "-group" if group result << "-infer" if infer result << "-keep" if keep result << "-main" if main result << "-msvc" if msvc result << "-strict" if strict result << "-mx" if mx result << "-trace" << trace if trace result << "-v" if verbose result << "-version" << version if version result << "-wimp" if wimp result << "-pack " + pack.join(" -pack ") if pack.size > 0 result << "-swf" << clean_path(swf) if swf result << "-out" << clean_path(out) if out result << clean_path(input) if input return result end |
#recurse_exclude_path(dir) ⇒ Object
89 90 91 92 93 94 95 96 97 |
# File 'lib/tasks/mtasc.rb', line 89 def recurse_exclude_path(dir) paths = [dir] Dir[dir + '/*'].each do |f| if(File.directory?(f)) paths << recurse_exclude_path(f) end end return paths end |
#remote_task_name ⇒ Object
46 47 48 |
# File 'lib/tasks/mtasc.rb', line 46 def remote_task_name return "mtasc-#{compiler_version}" end |