Compiling mxml files with ant and flex sdk

后端 未结 4 1678
北恋
北恋 2020-12-10 07:10

I am just getting started with flex and am using the SDK (not Flex Builder). I was wondering what\'s the best way to compile a mxml file from an ant build script.

4条回答
  •  旧时难觅i
    2020-12-10 07:24

    There is another option - it's called Project Sprouts.

    This is a system built with Ruby, RubyGems and Rake that provides many of the features found in Maven and ANT, but with a much cleaner syntax and simpler build scripts.

    For example, the ANT script shown above would look like this in Sprouts:

    require 'rubygems'
    require 'sprout'
    
    desc 'Compile and run the SWF'
    flashplayer :run => 'bin/SomeProject.swf'
    
    mxmlc 'bin/SomeProject.swf' do |t|
      t.input = 'src/SomeProject.as'
      t.default_size = '800 600'
      t.default_background_color = '#ffffff'
      t.keep_generated_actionscript = true
      t.library_path << 'libs'
    end
    
    task :default => :run
    

    After installing Ruby and RubyGems, you would simply call this script with:

    rake
    

    To remove generated files, run:

    rake clean
    

    To see available tasks:

    rake -T
    

    Another great benefit of Sprouts, once installed, is that it provides project, class and test generators that will get any development box ready to run with a couple simple command line actions.

    # Generate a project and cd into it:
    sprout -n mxml SomeProject
    cd SomeProject
    
    # Compile and run the main debug SWF:
    rake
    
    # Generate a new class, test case and test suite:
    script/generate class utils.MathUtil
    
    # Compile and run the test harness:
    rake test
    

提交回复
热议问题