Class: Airake::Projects::Air

Inherits:
Airake::Project show all
Defined in:
lib/airake/projects/air.rb

Overview

Project for AIR application

Instance Attribute Summary collapse

Attributes inherited from Airake::Project

#base_dir, #debug, #env, #lib_dir, #src_dirs, #swf_path

Instance Method Summary collapse

Methods inherited from Airake::Project

#asdoc, #initialize

Constructor Details

This class inherits a constructor from Airake::Project

Instance Attribute Details

#air_pathObject (readonly)

Returns the value of attribute air_path.



8
9
10
# File 'lib/airake/projects/air.rb', line 8

def air_path
  @air_path
end

#appxml_pathObject (readonly)

Returns the value of attribute appxml_path.



8
9
10
# File 'lib/airake/projects/air.rb', line 8

def appxml_path
  @appxml_path
end

#assetsObject (readonly)

Returns the value of attribute assets.



9
10
11
# File 'lib/airake/projects/air.rb', line 9

def assets
  @assets
end

#certificateObject (readonly)

Returns the value of attribute certificate.



9
10
11
# File 'lib/airake/projects/air.rb', line 9

def certificate
  @certificate
end

#mxml_pathObject (readonly)

Returns the value of attribute mxml_path.



8
9
10
# File 'lib/airake/projects/air.rb', line 8

def mxml_path
  @mxml_path
end

Instance Method Details

#adlObject

ADL command for this project



54
55
56
57
58
# File 'lib/airake/projects/air.rb', line 54

def adl
  options = { :appxml_path => @appxml_path, :base_dir => @base_dir, :adl_extra_opts => @adl_extra_opts,
    :adl_path => @adl_path }
  Airake::Commands::Adl.new(options)
end

#adtObject

ADT command for this project



61
62
63
64
65
66
# File 'lib/airake/projects/air.rb', line 61

def adt
  options = { :air_path => @air_path, :appxml_path => @appxml_path, :swf_path => @swf_path, 
    :base_dir => @base_dir, :assets => @assets, :cert => @certificate, :adt_extra_opts => @adt_extra_opts,
    :adt_path => @adt_path }
  Airake::Commands::Adt.new(options)
end

#amxmlcObject

Flex compiler command (under AIR) for this project



40
41
42
# File 'lib/airake/projects/air.rb', line 40

def amxmlc
  mxmlc({ :config_name => "air" })
end

#cleanObject



68
69
70
71
72
73
# File 'lib/airake/projects/air.rb', line 68

def clean
  paths = [ @swf_path, @air_path ]
  paths.each do |path|
    FileUtils.rm(path, :verbose => true) if File.exist?(path)
  end
end

#load(options = {}) ⇒ Object

Load options

options: If nil, options are loaded from airake.yml in root. (All paths relative to base directory)

  • air_path: Path to AIR file

  • mxml_path: Path to the ProjectName.mxml

  • appxml_path: Path to application descriptor

  • assets: Path to assets

  • certificate: Path to certificate

More options

  • adt_path

  • adl_path

  • adt_extra_opts

  • adl_extra_opts



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/airake/projects/air.rb', line 26

def load(options = {})
  super(options)
  
  @air_path = File.join(base_dir, options[:air_path])      
  @mxml_path = File.join(base_dir, options[:mxml_path])      
  @appxml_path = File.join(base_dir, options[:appxml_path])
  
  with_keyed_options([ :assets, :certificate, :mxmlc_path, :adt_path, :adl_path, :asdoc_path, 
    :mxmlc_extra_opts, :adt_extra_opts, :adl_extra_opts, :asdoc_extra_opts ], options)

  ensure_exists([ @mxml_path, @appxml_path ])
end

#mxmlc(options = {}) ⇒ Object

Flex compiler command for this project



45
46
47
48
49
50
51
# File 'lib/airake/projects/air.rb', line 45

def mxmlc(options = {})
  options = options.merge({ :swf_path => @swf_path, :target_file => @mxml_path, :lib_dir => @lib_dir, 
    :src_dirs => @src_dirs, :debug => @debug, :mxmlc_extra_opts => @mxmlc_extra_opts, 
    :mxmlc_path => @mxmlc_path })

  Airake::Commands::Mxmlc.new(options)
end