airake 0.2.12 → 0.2.13

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,11 @@
1
- == 0.2.11 2007-11-11
1
+ == 0.2.13 2007-12-05
2
+
3
+ * Refactoring require asserts
4
+ * Adding asdoc task
5
+ * Refactoring comments
6
+ * Adding tests for all the rake tasks (except certificate)
7
+
8
+ == 0.2.12 2007-11-11
2
9
 
3
10
  * Fixing adl task
4
11
  * Adding air:package_only task
data/License.txt CHANGED
@@ -20,4 +20,4 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
 
23
- Portions of this work are derived from Sprout (http://code.google.com/p/projectsprouts/).
23
+ Portions of this work are derived from Sprouts (http://code.google.com/p/projectsprouts/).
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2007 Gabriel Handford
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Manifest.txt CHANGED
@@ -32,6 +32,7 @@ lib/airake/commands/acompc.rb
32
32
  lib/airake/commands/adl.rb
33
33
  lib/airake/commands/adt.rb
34
34
  lib/airake/commands/amxmlc.rb
35
+ lib/airake/commands/asdoc.rb
35
36
  lib/airake/commands/base.rb
36
37
  lib/airake/core_ext/blank.rb
37
38
  lib/airake/daemonize.rb
@@ -55,3 +56,4 @@ test/test_browsair_generator.rb
55
56
  test/test_class_generator.rb
56
57
  test/test_generator_helper.rb
57
58
  test/test_helper.rb
59
+ MIT-LICENSE
@@ -18,4 +18,7 @@ ENV["ASSETS"] ||= "src/assets"
18
18
  task :test => [ "air:test" ] do; end
19
19
  task :compile => [ "air:compile" ] do; end
20
20
  task :package => [ "air:package" ] do; end
21
- task :adl => [ "air:adl" ] do; end
21
+ task :adl => [ "air:adl" ] do; end
22
+ task :docs => [ "air:docs" ] do; end
23
+ task :clean => [ "air:clean" ] do; end
24
+ task :acompc => [ "air:acompc" ] do; end
@@ -7,41 +7,27 @@ module Airake #:nodoc:
7
7
  # http://livedocs.adobe.com/labs/flex3/html/help.html?content=CommandLineTools_3.html
8
8
  class Acompc < Base
9
9
 
10
- attr_reader :path, :extra_opts, :source_path, :include_packages, :output_path
10
+ attr_reader :acompc_path, :acompc_extra_opts, :source_path, :include_packages, :output_path
11
11
 
12
- # Initialize command
12
+ # Build with options
13
+ #
14
+ # acompc_path: Path to acompc, defaults to 'acompc'
15
+ # source_path: Path to source, defaults to 'src'
16
+ # output_path: Path to output (required)
17
+ # include_packages: Array of package names to include (required). Example, com.airake.utils will include all classes from Dir["com/airake/utils/**/*.as"]
18
+ # acompc_extra_opts: Extra options for command line
13
19
  #
14
- # options:: :acompc_path, :acompc_extra_opts, :source_path, :include_packages, :output_path
15
- #
16
- # :include_packages:
17
- # com.airake.utils will include all classes from Dir["com/airake/utils/**/*.as"]
18
20
  def initialize(options = {})
19
- @path = options[:acompc_path] || "acompc"
20
- @extra_opts = options[:acompc_extra_opts]
21
- with_options(options, { :source_path => "src" })
22
- assert_required([ :path, :source_path, :output_path, :include_packages ])
23
- @include_classes = include_classes
21
+ assert_required(options, [ :output_path, :include_packages ])
22
+ with_options(options, { :acompc_path => "acompc", :source_path => "src" })
23
+ @include_classes = include_classes(@source_path, @include_packages)
24
24
  end
25
25
 
26
- # Find classes list from packages, raises error if result is empty
27
- def include_classes
28
- classes = []
29
- paths = []
30
- @include_packages.each do |include_package|
31
- path = File.join(@source_path, include_package.gsub(".", "/")) + "/**/*.as"
32
- paths << path
33
- Dir[path].each do |file|
34
- classes << include_package + "." + File.basename(file).gsub(".as", "")
35
- end
36
- end
37
- raise "No classes found at:\n\t#{paths.join("\n\t")}" if classes.empty?
38
- classes
39
- end
40
-
41
26
  # Get the acompc compile command
42
27
  def compile
43
28
  command = []
44
- command << @path
29
+ command << @acompc_path
30
+ command << @acompc_extra_opts
45
31
  command << "-source-path"
46
32
  command << @source_path
47
33
  command << "-include-classes"
@@ -7,23 +7,27 @@ module Airake #:nodoc:
7
7
  # http://livedocs.adobe.com/labs/air/1/devappsflex/help.html?content=CommandLineTools_4.html#1031914
8
8
  class Adl < Base
9
9
 
10
- attr_reader :project, :path, :extra_opts, :appxml_path, :root_dir
10
+ attr_reader :adl_path, :adl_extra_opts, :appxml_path, :base_dir
11
11
 
12
- # options:: :adl_path, :adl_extra_opts, :appxml_path, :root_dir
12
+ # Build with options
13
+ #
14
+ # adl_path: Path to adl, defaults to 'adl'
15
+ # appxml_path: Path to application descriptor xml (required)
16
+ # base_dir: Path to base project directory (required)
17
+ # adl_extra_opts: Extra options for command line
18
+ #
13
19
  def initialize(options = {})
14
- @path = options[:adl_path] || "adl"
15
- @extra_opts = options[:adl_extra_opts]
16
- with_options(options)
17
- assert_required([ :path, :appxml_path, :root_dir ])
20
+ assert_required(options, [ :appxml_path, :base_dir ])
21
+ with_options(options, { :adl_path => "adl" })
18
22
  end
19
23
 
20
24
  # Get the ADL launch command
21
25
  def launch
22
26
  command = []
23
- command << @path
24
- command << @extra_opts
27
+ command << @adl_path
28
+ command << @adl_extra_opts
25
29
  command << escape(@appxml_path)
26
- command << escape(@root_dir)
30
+ command << escape(@base_dir)
27
31
  process(command)
28
32
  end
29
33
 
@@ -7,21 +7,29 @@ module Airake #:nodoc:
7
7
  # http://livedocs.adobe.com/labs/air/1/devappsflex/help.html?content=CommandLineTools_5.html
8
8
  class Adt < Base
9
9
 
10
- attr_reader :path, :certificate, :extra_opts, :assets, :air_path, :appxml_path, :swf_path, :base_dir
10
+ attr_reader :adt_path, :certificate, :adt_extra_opts, :assets, :air_path, :appxml_path, :swf_path, :base_dir
11
11
 
12
- # options:: :adt_path, :certificate, :adt_extra_opts, :assets, :air_path, :appxml_path, :swf_path, :base_dir
12
+ # Build with options:
13
+ #
14
+ # adt_path: Path to adt, defaults to 'adt'
15
+ # base_dir: Root directory for project (required). Directories like src, lib and bin should be visible from here.
16
+ # air_path: Path to generated AIR file (required)
17
+ # appxml_path: Path to application xml descriptor (required)
18
+ # swf_path: Path to compiled SWF file (required)
19
+ # assets: Path to any assets. Should a string with asset files and directories separated by spaces: 'assets/icons/foo.png assets/images'
20
+ # certificate: Path to certificate
21
+ # adt_extra_opts: Extra options for command line
22
+ #
13
23
  def initialize(options = {})
14
- @path = options[:adt_path] || "adt"
15
- @extra_opts = options[:adt_extra_opts]
16
- with_options(options)
17
- assert_required([ :path, :base_dir, :air_path, :appxml_path, :swf_path ])
24
+ assert_required(options, [ :air_path, :appxml_path, :swf_path ])
25
+ with_options(options, { :adt_path => "adt" })
18
26
  end
19
27
 
20
28
  # Get the ADT package command
21
29
  def package
22
30
  command = []
23
- command << @path
24
- command << @extra_opts
31
+ command << @adt_path
32
+ command << @adt_extra_opts
25
33
  command << "-package"
26
34
  command << "-certificate #{certificate}" unless @certificate.blank?
27
35
  command << escape(relative_path(@air_path, @base_dir))
@@ -33,13 +41,18 @@ module Airake #:nodoc:
33
41
 
34
42
  # Get the ADT certificate command to generate a certificate
35
43
  #
36
- # cn:: Common name
37
- # pfx_file:: Output certificate path
38
- # key_type:: 1024-RSA, 2048-RSA
39
- # password:: Password
40
- # optionals:: :org_unit, :org, :country
44
+ # cn: Common name
45
+ # pfx_file: Output certificate path
46
+ # key_type: 1024-RSA, 2048-RSA
47
+ # password: Password
48
+ # optionals:
49
+ # org: Organization. 'Adobe'
50
+ # org_unit: Orginizational unit. 'AIR Team'
51
+ # country: Country. 'USA'
52
+ #
53
+ # Example result:
54
+ # adt -certificate -cn ADigitalID 1024-RSA SigningCert.pfx 39#wnetx3tl
41
55
  #
42
- # Example result: adt -certificate -cn ADigitalID 1024-RSA SigningCert.pfx 39#wnetx3tl
43
56
  def generate_certificate(common_name, pfx_file, key_type, password, optionals = {})
44
57
  command = []
45
58
  command << path
@@ -7,58 +7,41 @@ module Airake #:nodoc:
7
7
  # http://livedocs.adobe.com/labs/air/1/devappsflex/help.html?content=CommandLineTools_2.html#1032546
8
8
  class Amxmlc < Base
9
9
 
10
- attr_reader :path, :extra_opts, :swf_path, :mxml_path, :lib_dir, :src_dirs, :debug
10
+ attr_reader :amxmlc_path, :amxmlc_extra_opts, :swf_path, :mxml_path, :lib_dir, :src_dirs, :debug
11
11
 
12
- # options:: :amxmlc_path, :amxmlc_extra_opts, :swf_path, :mxml_path, :lib_dir, :src_dirs, :debug
12
+ # Build with options:
13
+ #
14
+ # amxmlc_path: Path to flex compiler, defaults to 'mxmlc +configname=air'
15
+ # swf_path: Path to generated swf (required)
16
+ # mxml_path: Path to mxml (required)
17
+ # lib_dir: Path to lib directory. Will load swc files from here or source directories
18
+ # src_dirs: Path to source directories (required)
19
+ # amxmlc_extra_opts: Extra options to pass to compiler
20
+ #
13
21
  def initialize(options = {})
14
- @path = options[:amxmlc_path] || "mxmlc +configname=air"
15
- @extra_opts = options[:amxmlc_extra_opts]
16
- with_options(options)
17
- assert_required([ :path, :swf_path, :mxml_path ])
18
- @source_paths = source_paths
22
+ assert_required(options, [ :swf_path, :mxml_path, :src_dirs ])
23
+ with_options(options, { :amxmlc_path => "mxmlc +configname=air" })
24
+
25
+ @source_paths = source_paths(@src_dirs, @lib_dir)
19
26
  raise ArgumentError, "There aren't any valid source directories to compile" if @source_paths.empty?
20
- @library_path = library_path
27
+ @library_path = escape(@lib_dir) if @lib_dir and File.directory?(@lib_dir)
21
28
  end
22
29
 
23
30
  # Get the amxmlc compile command
24
31
  def compile
25
32
  command = []
26
- command << @path
33
+ command << @amxmlc_path
34
+ command << @amxmlc_extra_opts
27
35
  command << "-source-path #{@source_paths.join(" ")}"
28
- command << "-library-path+=#{@library_path}"
36
+ command << "-library-path+=#{@library_path}" unless @library_path.blank?
29
37
  command << "-output"
30
38
  command << escape(@swf_path)
31
- command << "-debug=#{@debug}" unless @debug.nil?
32
- command << @extra_opts
33
- #command << "-disable-incremental-optimizations=true"
39
+ command << "-debug=#{@debug}" unless @debug.nil?
34
40
  command << "--"
35
41
  command << escape(@mxml_path)
36
42
  process(command)
37
43
  end
38
44
 
39
- protected
40
-
41
- def source_paths
42
- source_paths = []
43
- # List of directories in lib/ for source_path +=
44
- if @lib_dir and File.directory?(@lib_dir)
45
- source_paths += Dir["#{@lib_dir}/*"].collect { |f| escape(f) if File.directory?(f) }.compact
46
- end
47
-
48
- @src_dirs.each do |src_dir|
49
- if File.directory?(src_dir)
50
- source_paths << escape(src_dir)
51
- else
52
- raise "Source directory: #{src_dir} is not a directory or does not exist"
53
- end
54
- end
55
- source_paths
56
- end
57
-
58
- def library_path
59
- escape(@lib_dir) if @lib_dir and File.directory?(@lib_dir)
60
- end
61
-
62
45
  end
63
46
 
64
47
  end
@@ -0,0 +1,57 @@
1
+ module Airake #:nodoc:
2
+
3
+ module Commands #:nodoc:
4
+
5
+ # ASDOC
6
+ class Asdoc < Base
7
+
8
+ attr_reader :asdoc_path, :asdoc_extra_opts, :src_dirs, :lib_dir, :output_dir
9
+
10
+ # Build with options.
11
+ #
12
+ # asdoc_path: Path to asdoc, defaults to 'asdoc'
13
+ # src_dirs: Paths to source (array), defaults to [ 'src' ]
14
+ # lib_dir: Path to lib directory.
15
+ # output_dir: Path to output directory, defaults to "doc/asdoc"
16
+ # asdoc_extra_opts: Extra options for command line
17
+ #
18
+ def initialize(options = {})
19
+ with_options(options, { :asdoc_path => "asdoc", :output_dir => "doc/asdoc" })
20
+
21
+ @source_paths = source_paths(@src_dirs, @lib_dir)
22
+ raise ArgumentError, "There aren't any valid source directories to compile" if @source_paths.empty?
23
+
24
+ @library_paths = []
25
+ if @lib_dir and File.directory?(@lib_dir)
26
+ @library_paths << escape(@lib_dir)
27
+ end
28
+ @library_paths << "#{frameworks_dir}/libs"
29
+ @library_paths << "#{frameworks_dir}/libs/air"
30
+ @library_paths << "#{frameworks_dir}/locale/en_US"
31
+ end
32
+
33
+ # This only works on bash
34
+ def frameworks_dir
35
+ "$(dirname `which asdoc`)/../frameworks"
36
+ end
37
+
38
+ # Get the amxmlc compile command
39
+ def generate
40
+ command = []
41
+ command << @asdoc_path
42
+ command << @asdoc_extra_opts
43
+ command << "-source-path #{@source_paths.join(" ")}"
44
+
45
+ @library_paths.each do |library_path|
46
+ command << "-library-path #{library_path}"
47
+ end
48
+ command << "-doc-sources #{@source_paths.join(" ")}"
49
+ command << "-output #{@output_dir}"
50
+ process(command)
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+
57
+ end
@@ -45,12 +45,52 @@ module Airake #:nodoc:
45
45
  end
46
46
  end
47
47
 
48
- def assert_required(vars)
49
- vars.each do |var|
50
- raise ArgumentError, "Must specify option: #{var}" if instance_variable_get("@#{var}").nil?
48
+ def assert_required(options, keys)
49
+ keys.each do |key|
50
+ raise ArgumentError, "Missing option: #{key}" unless options.include?(key)
51
51
  end
52
52
  end
53
53
 
54
+ def library_paths(lib_dir)
55
+ if lib_dir and File.directory?(lib_dir)
56
+ Dir["#{lib_dir}/*"].collect { |f| escape(f) if File.directory?(f) }.compact
57
+ end
58
+ end
59
+
60
+ # Returns an array of source paths from src_dirs and lib_dir
61
+ def source_paths(src_dirs = [], lib_dir = nil)
62
+ source_paths = []
63
+
64
+ # List of directories in lib/ for source paths
65
+ if lib_dir and File.directory?(lib_dir)
66
+ source_paths += Dir["#{lib_dir}/*"].collect { |f| escape(f) if File.directory?(f) }.compact
67
+ end
68
+
69
+ src_dirs.each do |src_dir|
70
+ if File.directory?(src_dir)
71
+ source_paths << escape(src_dir)
72
+ else
73
+ raise "Source directory: #{src_dir} is not a directory or does not exist"
74
+ end
75
+ end
76
+ source_paths
77
+ end
78
+
79
+ # Find classes list from packages, raises error if result is empty
80
+ def include_classes(source_path, include_packages)
81
+ classes = []
82
+ paths = []
83
+ include_packages.each do |include_package|
84
+ path = File.join(source_path, include_package.gsub(".", "/")) + "/**/*.as"
85
+ paths << path
86
+ Dir[path].each do |file|
87
+ classes << include_package + "." + File.basename(file).gsub(".as", "")
88
+ end
89
+ end
90
+ raise "No classes found at:\n\t#{paths.join("\n\t")}" if classes.empty?
91
+ classes
92
+ end
93
+
54
94
  end
55
95
 
56
96
  end
@@ -1,6 +1,8 @@
1
1
  module Airake #:nodoc
2
2
 
3
- # Project settings for AIR app
3
+ #
4
+ # Project for AIR application
5
+ #
4
6
  class Project
5
7
 
6
8
  attr_reader :base_dir, :bin_dir, :src_dir, :lib_dir, :test_dir
@@ -9,14 +11,29 @@ module Airake #:nodoc
9
11
  attr_reader :build_env
10
12
 
11
13
  # Options to override defaults
12
- Options = [ :certificate, :assets, :amxmlc_path, :adt_path, :adt_path, :bin_dir, :src_dir, :lib_dir, :test_dir,
13
- :appxml_path, :air_path, :swf_path, :debug, :amxmlc_extra_opts, :adl_extra_opts, :adt_extra_opts ]
14
+ Options = [ :bin_dir, :src_dir, :lib_dir, :test_dir,
15
+ :appxml_path, :air_path, :swf_path, :debug, :certificate, :assets,
16
+ :amxmlc_path, :adl_path, :adt_path, :asdoc_path, :amxmlc_extra_opts, :adl_extra_opts, :adt_extra_opts, :asdoc_extra_opts ]
14
17
 
15
- # Construct project
18
+ # Build project:
16
19
  #
17
- # base_dir:: Base (project) directory
18
- # mxml_path: Path to the project.mxml (relative)
19
- # options:: Override default paths, commands, extra opts, etc; See Options class var
20
+ # base_dir: Base (project) directory
21
+ # mxml_path: Path to the ProjectName.mxml (relative)
22
+ # options:
23
+ # bin_dir: Path to generated output, defaults to 'bin'
24
+ # src_dir: Path to source, defaults to 'src'
25
+ # lib_dir: Path to lib directory, defaults to 'lib'
26
+ # test_dir: Path to test directory, defaults to 'test'
27
+ # appxml_path: Path to application descriptor, defaults to '<mxml_dir>/<ProjectName>-app.xml'. Default assumes the app xml is in same directory as the root mxml.
28
+ # air_path: Path to AIR file, defaults to '<bin_dir>/<ProjectName>.air'
29
+ # swf_path: Path to SWF file, defaults to '<bin_dir>/<ProjectName.swf'
30
+ # debug: "true" or "false"
31
+ # assets: Path to assets
32
+ # certificate: Path to certificate
33
+ #
34
+ # Other options:
35
+ # :amxmlc_path, :adt_path, :adl_path, :asdoc_path, :amxmlc_extra_opts, :adt_extra_opts, :adl_extra_opts, :asdoc_extra_opts
36
+ #
20
37
  def initialize(base_dir, mxml_path, options = {}, build_env = :normal)
21
38
  raise ArgumentError, "Invalid MXML path: #{mxml_path}" if mxml_path.blank?
22
39
 
@@ -41,8 +58,8 @@ module Airake #:nodoc
41
58
  # Debug options
42
59
  @debug = options[:debug].is_a?(TrueClass) || options[:debug] == "true"
43
60
 
44
- @assets = options[:assets]
45
- @certificate = options[:certificate]
61
+ with_keyed_options([ :assets, :certificate, :amxmlc_path, :adt_path, :adl_path, :asdoc_path,
62
+ :amxmlc_extra_opts, :adt_extra_opts, :adl_extra_opts, :asdoc_extra_opts ], options)
46
63
  end
47
64
 
48
65
  # Flex compiler command for this project
@@ -54,24 +71,35 @@ module Airake #:nodoc
54
71
  end
55
72
 
56
73
  options = { :swf_path => @swf_path, :mxml_path => @mxml_path, :lib_dir => @lib_dir,
57
- :src_dirs => src_dirs, :debug => @debug }
74
+ :src_dirs => src_dirs, :debug => @debug, :amxmlc_extra_opts => @amxmlc_extra_opts,
75
+ :amxmlc_path => @amxmlc_path }
58
76
 
59
77
  Airake::Commands::Amxmlc.new(options)
60
78
  end
61
79
 
62
80
  # ADL command for this project
63
81
  def adl
64
- options = { :appxml_path => @appxml_path, :root_dir => @base_dir }
82
+ options = { :appxml_path => @appxml_path, :base_dir => @base_dir, :adl_extra_opts => @adl_extra_opts,
83
+ :adl_path => @adl_path }
65
84
  Airake::Commands::Adl.new(options)
66
85
  end
67
86
 
68
87
  # ADT command for this project
69
88
  def adt
70
89
  options = { :air_path => @air_path, :appxml_path => @appxml_path, :swf_path => @swf_path,
71
- :base_dir => @base_dir, :assets => @assets, :certificate => @certificate }
90
+ :base_dir => @base_dir, :assets => @assets, :certificate => @certificate, :adt_extra_opts => @adt_extra_opts,
91
+ :adt_path => @adt_path }
72
92
  Airake::Commands::Adt.new(options)
73
93
  end
74
94
 
95
+ # AS docs
96
+ def asdoc
97
+ src_dirs = [ @src_dir ]
98
+ options = { :lib_dir => @lib_dir, :src_dirs => src_dirs, :asdoc_extra_opts => @asdoc_extra_opts,
99
+ :asdoc_path => @asdoc_path }
100
+ Airake::Commands::Asdoc.new(options)
101
+ end
102
+
75
103
  # List of files to remove on clean
76
104
  def to_clean
77
105
  case build_env
@@ -80,13 +108,19 @@ module Airake #:nodoc
80
108
  end
81
109
  end
82
110
 
83
- # Create project using parameters from rake ENV
111
+ #
112
+ # Create project using parameters from rake ENV:
113
+ #
114
+ # BASE_DIR: Path to project base
115
+ # MXML: Path to mxml file
116
+ # MXML_TEST: In test environment, path to test mxml file
84
117
  #
85
- # This shouldn't really be here, but a Rakefile is a bad place to be :O
118
+ # You can override any of the project options via ENV; just upcase it. <tt>:foo_bar => ENV["FOO_BAR"]</tt>
86
119
  #
87
- # You can set any of the options via ENV; just upcase it. <tt>:foo_bar => ENV["FOO_BAR"]</tt>
120
+ # This shouldn't really be here, but a Rakefile is a bad place to be :O
88
121
  #
89
122
  # Booleans must be "true" for true
123
+ #
90
124
  def self.new_from_rake(env, build_env = :normal)
91
125
  base_dir = env["BASE_DIR"]
92
126
  mxml = case build_env
@@ -105,6 +139,14 @@ module Airake #:nodoc
105
139
  self.new(base_dir, mxml, options, build_env)
106
140
  end
107
141
 
142
+ # Load options into instance vars
143
+ def with_keyed_options(keys, options)
144
+ keys.each do |key|
145
+ value = options[key]
146
+ instance_variable_set("@#{key}", value) if value
147
+ end
148
+ end
149
+
108
150
  end
109
151
 
110
152
  end
@@ -138,6 +138,12 @@ namespace :air do
138
138
  Airake::Runner.run(Airake::Commands::Acompc.new(:source_path => source_path, :include_packages => packages.split(" "), :output_path => output_path), :compile)
139
139
  end
140
140
 
141
+ desc "Docs"
142
+ task :docs do
143
+ project = Airake::Project.new_from_rake(ENV)
144
+ Airake::Runner.run(project.asdoc, :generate)
145
+ end
146
+
141
147
  desc "Clean"
142
148
  task :clean do
143
149
  project = Airake::Project.new_from_rake(ENV)
@@ -2,7 +2,7 @@ module Airake #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 12
5
+ TINY = 13
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/airake.rb CHANGED
@@ -8,6 +8,7 @@ require 'airake/commands/acompc'
8
8
  require 'airake/commands/amxmlc'
9
9
  require 'airake/commands/adl'
10
10
  require 'airake/commands/adt'
11
+ require 'airake/commands/asdoc'
11
12
  require 'airake/project'
12
13
  require 'airake/runner'
13
14
  require 'rake'
data/test/test_airake.rb CHANGED
@@ -5,7 +5,49 @@ class TestAirake < Test::Unit::TestCase
5
5
  def setup
6
6
  end
7
7
 
8
- def test_project
8
+ def teardown
9
+ FileUtils.rm_rf("#{test_dir}/bin/*", :verbose => true)
10
+ FileUtils.rm_rf("#{test_dir}/doc", :verbose => true)
11
+ end
12
+
13
+ def test_dir
14
+ File.dirname(__FILE__) + "/Test\\ App"
15
+ end
16
+
17
+ def run_task(run)
18
+ system("cd #{test_dir}; rake #{run}") || fail
19
+ end
20
+
21
+ def test_adl
22
+ run_task("adl")
23
+ end
24
+
25
+ def test_acompc
26
+ run_task("acompc SOURCE=src OUTPUT=bin/Foo.swc PACKAGES=\"com.test\"")
27
+ end
28
+
29
+ def test_compile
30
+ run_task("compile")
31
+ end
32
+
33
+ def test_test
34
+ run_task("test")
35
+ end
36
+
37
+ def test_clean
38
+ run_task("clean")
39
+ end
40
+
41
+ def test_package
42
+ puts <<-EOS
43
+
44
+ Running package test. You will need to enter in the password: 'test'
9
45
 
46
+ EOS
47
+ run_task("package")
48
+ end
49
+
50
+ def test_docs
51
+ run_task("docs")
10
52
  end
11
53
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: airake
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.12
7
- date: 2007-11-11 00:00:00 -05:00
6
+ version: 0.2.13
7
+ date: 2007-12-05 00:00:00 -05:00
8
8
  summary: Tasks and generators for Adobe AIR apps
9
9
  require_paths:
10
10
  - lib
@@ -63,6 +63,7 @@ files:
63
63
  - lib/airake/commands/adl.rb
64
64
  - lib/airake/commands/adt.rb
65
65
  - lib/airake/commands/amxmlc.rb
66
+ - lib/airake/commands/asdoc.rb
66
67
  - lib/airake/commands/base.rb
67
68
  - lib/airake/core_ext/blank.rb
68
69
  - lib/airake/daemonize.rb
@@ -86,6 +87,7 @@ files:
86
87
  - test/test_class_generator.rb
87
88
  - test/test_generator_helper.rb
88
89
  - test/test_helper.rb
90
+ - MIT-LICENSE
89
91
  test_files:
90
92
  - test/test_airake.rb
91
93
  - test/test_airake_generator.rb