| Class | Sprout::MTASCTask |
| In: |
bundles/as2/lib/sprout/tasks/mtasc_documentation.rb
bundles/as2/lib/sprout/tasks/mtasc_rdoc.rb bundles/as2/lib/sprout/tasks/mtasc_task.rb |
| Parent: | ToolTask |
Compile sources using the Motion Twin ActionScript Compiler (MTASC).
Like standard Rake file tasks, the name given to the MTASCTask instance should be the file that the task is epected to create. This value can be overridden in the configuration block by using the -output parameter.
mtasc 'bin/SomeProject.swf' do |t|
t.main = true
t.header = '800:600:24'
t.input = 'src/SomeProject.as'
end
The above MTASCTask can be aliased for easier typing on the command line as follows:
desc "Compile SomeProject.swf" task :compile => 'bin/SomeProject.swf'
If the MTASCTask has a SWFMillTask as a prerequisite, it will automatically set that task output as the value of the -swf paramter. Additionally, when MTASC pulls in an existing SWF file you no longer need to define the -header parameter as it will use the dimensions and frame rate found in the loaded SWF file. If the -header parameter is set, it will override whatever settings are in the loaded SWF. Following is a short example:
swfmill 'bin/SomeProjectSkin.swf' do |t|
t.input = 'assets/skin'
end
mtasc 'bin/SomeProject.swf' => 'bin/SomeProjectSkin.swf' do |t|
t.main = true
t.input = 'src/SomeProject.as'
end
Any LibraryTask instances that are added as prerequisites to the MTASCTask will be automatically added to the class_path in the order they are declared as prerequisites.
The following example will add the imaginary libraries :somelib, :otherlib and :yourlib to the class_path in that order.
library :yourlib
library :otherlib
library :somelib
mtasc 'bin/SomeProjectRunner.swf' => [:somelib, :otherlib, :yourlib] do |t|
t.main = true
t.header = '800:600:24'
t.input = 'src/SomeProjectRunner.as'
end
At this time, MTASC does not support libraries that are packaged as SWC files. We are considering adding support for SWC files in the near future, if you‘re interested in contributing to this feature, please let us know.
| include_std | [RW] | Automatically include the installation MTASC ‘std’ library to the class_path. |
Add a directory path to the class path. This is the list of directories that MTASC will use to look for .as files. You can add as many class_path values as you like. This parameter is an Array, so be sure to append rather than overwrite.
Even though the official MTASC compiler accepts the cp paramter, we have aliased it as class_path, you can use either name in your scripts.
mtasc 'bin/SomeProject.swf' do |t|
t.class_path << 'lib/somelib'
t.class_path << 'lib/otherlib'
# The following is not correct:
# t.class_path = 'lib/somelib'
end
Add a directory path to the class path. This is the list of directories that MTASC will use to look for .as files. You can add as many class_path values as you like. This parameter is an Array, so be sure to append rather than overwrite.
Even though the official MTASC compiler accepts the cp paramter, we have aliased it as class_path, you can use either name in your scripts.
mtasc 'bin/SomeProject.swf' do |t|
t.class_path << 'lib/somelib'
t.class_path << 'lib/otherlib'
# The following is not correct:
# t.class_path = 'lib/somelib'
end
Exclude code generation of classes listed in specified file (format is one full class path per line).
Exclude code generation of classes listed in specified file (format is one full class path per line).
Merge classes into one single clip (this will reduce SWF size but might cause some problems if you‘re using -keep or -mx).
Merge classes into one single clip (this will reduce SWF size but might cause some problems if you‘re using -keep or -mx).
width:height:fps:bgcolor: Create a new swf containing only compiled code and using provided header informations. bgcolor is optional and should be 6 digits hexadecimal value.
width:height:fps:bgcolor: Create a new swf containing only compiled code and using provided header informations. bgcolor is optional and should be 6 digits hexadecimal value.
Keep AS2 classes compiled by MCC into the SWF (this could cause some classes to be present two times if also compiled with MTASC).
Keep AS2 classes compiled by MCC into the SWF (this could cause some classes to be present two times if also compiled with MTASC).
Use Microsoft Visual Studio errors style formating instead of Java style (for file names and line numbers).
Use Microsoft Visual Studio errors style formating instead of Java style (for file names and line numbers).
The SWF file that should be generated, use only in addition to the -swf parameter if you want to generate a separate SWF from the one being loaded
The SWF file that should be generated, use only in addition to the -swf parameter if you want to generate a separate SWF from the one being loaded
Compile all the files contained in specified package - not recursively (eg to compile files in c:lashdemypp do mtasc -cp c:lashde -pack my/app).
Compile all the files contained in specified package - not recursively (eg to compile files in c:lashdemypp do mtasc -cp c:lashde -pack my/app).
Specify the swf that should be generated, OR the input SWF which contains assets.
If this parameter is not set, the MTASCTask will do the following:
Specify the swf that should be generated, OR the input SWF which contains assets.
If this parameter is not set, the MTASCTask will do the following:
Activate verbose mode, printing some additional information about compiling process. This parameter has been aliased as verbose
Activate verbose mode, printing some additional information about compiling process. This parameter has been aliased as verbose
Iterate over prerequisites until you find the first SWFMillTask instance, and set self.swf = instance.output so that the skin gets compiled in.