lib/flashsdk/mxmlc.rb in flashsdk-1.0.13.pre vs lib/flashsdk/mxmlc.rb in flashsdk-1.0.14.pre
- old
+ new
@@ -7,13 +7,11 @@
#
# The entire MXMLC advanced interface has been provided here. All parameter names should be
# identical to what is available on the regular compiler except dashes have been replaced
# by underscores.
#
- # The following example can be pasted in a file named 'rakefile.rb' which should be placed in
- # the same folder as an ActionScript 3.0 class named 'SomeProject.as' that extends
- # flash.display.Sprite.
+ # The following example can be pasted in a file named 'rakefile.rb' which should be placed in the same folder as an ActionScript 3.0 class named 'SomeProject.as' that extends flash.display.Sprite.
#
# # Create a remote library dependency on the corelib swc.
# library :corelib
#
# # Alias the compilation task with one that is easier to type
@@ -27,20 +25,36 @@
# t.default_background_color = "#FFFFFF"
# t.library_path << 'lib/SomeLibrary.swc'
# t.source_path << 'lib/otherlib'
# end
#
- # Note: Be sure to check out the features of the Executable to learn more about gem_version and preprocessor
+ # Remember that Rake files are really just regular Ruby code, so if you want to have some configuration information shared by multiple build tasks, just define a method like:
#
- # Interface and descriptions found here:
- # http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001481.html
+ # def configure_tasks t
+ # t.library_path << 'lib/SomeLibrary.swc'
+ # t.source_path << 'lib/otherlib'
+ # end
#
+ # desc "Compile the project"
+ # mxmlc 'bin/SomeProject.swf' do |t|
+ # configure_tasks t
+ # t.input = 'src/SomeProject.as'
+ # end
+ #
+ # desc "Compile the test harness"
+ # mxmlc 'bin/SomeProjectRunner.swf' => :asunit4 do |t|
+ # configure_tasks t
+ # t.input = 'src/SomeProjectRunner.as'
+ # end
+ #
+ # @see FlashSDK::CompilerBase
+ # @see Sprout::Executable
+ #
class MXMLC < CompilerBase
- include Sprout::Executable
##
- # Main source file to send compiler"
+ # Main source file to send compiler.
# This must be the last item in this list
add_param :input, File, { :required => true, :hidden_name => true }
set :default_prefix, '-'
@@ -63,9 +77,21 @@
set :executable, :mxmlc
end
end
+##
+# Create a new Rake::File task that will execute {FlashSDK::MXMLC}.
+#
+# @return [Sprout::MXMLC]
+#
+# @example The following is a simple MXMLC task:
+#
+# desc "Compile the project"
+# mxmlc 'bin/SomeProject.swf' do |t|
+# t.input = 'src/SomeProject.as'
+# end
+#
def mxmlc args, &block
exe = FlashSDK::MXMLC.new
exe.to_rake(args, &block)
exe
end