Sha256: 34c182de4f5d7e20fedb62768c4a9e4d4ab48ab0ffb90479026b0476e9b68215

Contents?: true

Size: 1.6 KB

Versions: 2

Compression:

Stored size: 1.6 KB

Contents

namespace :air do
  
  task :settings do
    ENV["FCSH_IP"] ||= "127.0.0.1"
    ENV["FCSH_PORT"] ||= "20569"
  end
  
  desc "Compile"
  task :compile => :settings do
    begin
      project = Airake::Project.new(ENV["BASE_DIR"], ENV["MXML"], ENV)
      fcsh = FCSH.new(ENV["FCSH_IP"], ENV["FCSH_PORT"].to_i)
      fcsh.execute([ project.base_dir, project.mxmlc_command ])      
    rescue FCSHConnectError => e
      puts "Cannot connect to FCSHD (start by running: rake air:fcshd); Continuing compilation..."
      project.run_mxmlc
    end
  end

  desc "Test"
  task :test => :settings do
    test_project = Airake::Project.new(ENV["BASE_DIR"], ENV["MXML_TEST"], ENV)
    test_project.run_mxmlc
    test_project.run_adl
  end

  desc "Package"
  task :package => :compile do
    project = Airake::Project.new(ENV["BASE_DIR"], ENV["MXML"], ENV)
    project.run_adt
  end

  desc "Apollo Debug Luncher"
  task :adl => :compile do
    project = Airake::Project.new(ENV["BASE_DIR"], ENV["MXML"], ENV)
    project.run_adl
  end

  desc "Start the FCSHD process (or use air:fcshd)"
  task :start_fcshd => :settings do  
    puts "Starting FCSHD @ #{ENV["FCSH_IP"]}:#{ENV["FCSH_PORT"].to_i}"
    FCSHD.new(ENV["FCSH_IP"], ENV["FCSH_PORT"].to_i)
  end

  desc "Stop the FCSHD process"
  task :stop_fcshd => :settings do
    fcsh = FCSH.new(ENV["FCSH_IP"], ENV["FCSH_PORT"].to_i)
    fcsh.stop
  end

  desc "Restart the FCSHD process"
  task :restart_fcsh => :settings do
    Rake::Task[:stop_fcshd].invoke rescue puts "Could not stop FCSHD"
    sleep 1
    Rake::Task[:start_fcshd].invoke
  end

  # Aliases
  task :fcshd => :start_fcshd
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
airake-0.1.3 lib/airake/tasks/deployment.rake
airake-0.1.4 lib/airake/tasks/deployment.rake