asrake 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,23 +2,14 @@
2
2
 
3
3
  **Quickly and easily create build scripts for Actionscript 3, Flex, and AIR projects.**
4
4
 
5
-
6
5
  ## Installation
7
6
 
8
7
  ### `gem install asrake`
9
8
 
10
- Or add this line to your application's Gemfile:
11
-
12
- gem 'asrake'
13
-
14
- And then execute:
15
-
16
- $ bundle
17
-
18
-
19
9
  ## Usage
20
10
 
21
- Add the path(s) to your Flex SDK for all systems that will need to run the Rake tasks.
11
+ Add the path(s) to your Flex SDK for all systems that will need to run the Rake tasks. The value of the environment variable `FLEX_HOME` is added to this list by default if it is defined on your system.
12
+
22
13
  ```ruby
23
14
  FlexSDK::SDK_PATHS << 'C:\develop\sdk\flex_sdk_4.6.0.23201'
24
15
  FlexSDK::SDK_PATHS << "C:/develop/sdk/flex_sdk 4.5.1"
@@ -36,35 +27,40 @@ Convenience methods are provided for `include_libraries`, `external_library_path
36
27
  ### Build a SWF or SWC
37
28
 
38
29
  ```
39
- ASRake::Mxmlc(file) |self|
30
+ ASRake::Mxmlc.new(output)
40
31
  ```
41
32
  ```
42
- ASRake::Compc(file) |self|
33
+ ASRake::Compc.new(output)
43
34
  ```
44
35
 
45
36
  Assign arguments for your build and optionally run it with a friendlier-named task:
46
37
 
47
38
  ```ruby
48
- args = ASRake::Compc.new "bin/bin/my_project.swc"
39
+ args = ASRake::Compc.new "bin/my_project.swc"
49
40
  args.target_player = 11.0
50
41
  args.debug = true
51
- args.source_path << "bin/src"
42
+ args.source_path << "src"
52
43
  args.statically_link_only_referenced_classes << "lib/lib_used_in_project.swc"
53
44
 
54
45
  desc "Build swc"
55
46
  task :build => args
56
47
  ```
57
48
 
58
- You can also define arguments in a block on creation:
49
+ You can chain together complex builds and the dependencies will be properly handled:
59
50
 
60
51
  ```ruby
52
+ bar = ASRake::Compc.new "lib/other_project/bin/proj.swc"
53
+ bar.target_player = 11.0
54
+ bar.source_path << "lib/other_project/src"
55
+
56
+ foo = ASRake::Compc.new "bin/my_project.swc"
57
+ foo.target_player = 11.0
58
+ foo.debug = true
59
+ foo.source_path << "src"
60
+ foo.library_path << bar
61
+
61
62
  desc "Build swc"
62
- ASRake::Compc.new "bin/bin/my_project.swc" do |build|
63
- build.target_player = 11.0
64
- build.debug = true
65
- build.source_path << "bin/src"
66
- build.statically_link_only_referenced_classes << "lib/lib_used_in_project.swc"
67
- end
63
+ task :build => foo
68
64
  ```
69
65
 
70
66
  ### Include ASDoc in a SWC
@@ -73,12 +69,10 @@ If you are compiling with `Compc`, you can set the field `include_asdoc` to have
73
69
 
74
70
  ```ruby
75
71
  desc "Build swc"
76
- ASRake::Compc.new "bin/bin/my_project.swc" do |build|
77
- build.target_player = 11.0
78
- build.source_path << "bin/src"
79
- build.statically_link_only_referenced_classes << "lib/lib_used_in_project.swc"
80
- build.include_asdoc = true
81
- end
72
+ swc = ASRake::Compc.new "bin/bin/my_project.swc"
73
+ swc.target_player = 11.0
74
+ swc.source_path << "bin/src"
75
+ swc.include_asdoc = true
82
76
  ```
83
77
 
84
78
  ### Build an AIR
@@ -87,25 +81,22 @@ Compile your SWF file as normal, but set the `isAIR` property to true
87
81
 
88
82
  ```ruby
89
83
  desc "Build app"
90
- ASRake::Mxmlc.new "bin/my_app.swf" do |build|
91
- build.load_config << "mxmlc_config.xml"
92
- build.isAIR = true
93
- end
84
+ my_app = ASRake::Mxmlc.new "bin/my_app.swf"
85
+ my_app.load_config << "mxmlc_config.xml"
86
+ my_app.isAIR = true
94
87
  ```
95
88
 
96
89
  Provide the package task with the AIR and keystore information. If the key doesn't exist, it will be created.
97
90
 
98
- > Be sure that the swf file is included in the package (eg, it is included here by packaging everything in the bin directory with `-C bin .`)
91
+ > Be sure that the swf file is included in the package (eg, it is included here by packaging everything in the bin directory: `air.include_files << "bin ."`)
99
92
 
100
93
  ```ruby
101
- ASRake::AdtTask.new :package => :build do |package|
102
- package.output = "bin/my_app.air"
103
- package.keystore = "my_app_cert.p12"
104
- package.keystore_name = "my_app"
105
- package.storepass = "my_app"
106
- package.tsa = "none"
107
- package.additional_args = "-C bin ."
108
- end
94
+ air = ASRake::Adt.new "deploy/my_app.air"
95
+ air.keystore = "cert.p12"
96
+ air.keystore_name = "my_app"
97
+ air.storepass = "my_app"
98
+ air.tsa = "none"
99
+ air.include_files << "bin ."
109
100
  ```
110
101
 
111
102
  ### Version
@@ -159,7 +150,7 @@ cp_u "path/to/file.xml", "/dest/dest.xml"
159
150
  # copy an array of files
160
151
  cp_u %w{application.xml my_app.swf config.json}, "/dest"
161
152
 
162
- # use FileList, Dir.glob(), or othr methods to copy groups of files
153
+ # use FileList, Dir.glob(), or other methods to copy groups of files
163
154
  cp_u FileList["lib/**/*.swc"], "bin/lib"
164
155
  ```
165
156
 
@@ -170,17 +161,11 @@ You don't need to create a rake task to build a swf or swc. Just call `execute()
170
161
  > Note that this will not do any dependency checks, so the build will run even if it is unnecessary
171
162
 
172
163
  ```ruby
173
- args = ASRake::Compc.new "bin/bin/my_project.swc"
164
+ args = ASRake::Compc.new "bin/my_project.swc"
174
165
  args.target_player = 11.0
175
- args.source_path << "bin/src"
166
+ args.source_path << "src"
176
167
  args.statically_link_only_referenced_classes << "lib/lib_used_in_project.swc"
177
168
  args.execute()
178
-
179
- (ASRake::Mxmlc.new "bin/bin/my_project.swf" do |mxmlc|
180
- mxmlc.target_player = 11.0
181
- mxmlc.debug = true
182
- mxmlc.source_path << "bin/src"
183
- end).execute()
184
169
  ```
185
170
 
186
171
  ## Contributing
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = 'asrake'
4
- spec.version = '0.14.0'
4
+ spec.version = '0.14.1'
5
5
  spec.platform = Gem::Platform::RUBY
6
6
 
7
7
  spec.authors = ["Malachi Griffie"]
@@ -9,13 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.homepage = 'https://github.com/nexussays/ASRake'
10
10
  spec.license = 'MIT'
11
11
 
12
- spec.summary = <<DESC
13
- A cross-platform Rake library to quickly and easily create build scripts for
14
- Actionscript 3, Flex, and AIR projects.
15
- DESC
12
+ spec.summary = "A Rake library for Actionscript 3, Flex, and AIR projects."
16
13
  spec.description = <<DESC
17
- A Rake library for Actionscript 3, Flex, and AIR projects.
18
- See full documentation at https://github.com/nexussays/ASRake/blob/master/README.md
14
+ A Rake-based library for quickly and easily creating build scripts for Actionscript 3, Flex, and AIR projects.
19
15
  DESC
20
16
 
21
17
  spec.files = Dir['lib/**/*.rb'] + %w[LICENSE README.md asrake.gemspec Gemfile]
@@ -51,12 +51,12 @@ class Adt < BaseExecutable
51
51
  # define named task first so if desc was called it will be attached to it instead of the file task
52
52
  def execute
53
53
 
54
- raise "You must define 'output' for #{self}" if self.output == nil
55
- raise "You must define 'application_descriptor'" if self.application_descriptor == nil || !File.exists?(self.application_descriptor)
56
- raise "You must define 'keystore' for #{self}" if self.keystore == nil
57
- raise "You must define 'keystore_name' for #{self}" if self.keystore_name == nil
58
- raise "You must define 'storepass' for #{self}" if self.storepass == nil
59
- raise "You must define 'include_files' for #{self}\neg: include_files << 'bin .'" if self.include_files.length < 1
54
+ #raise "You must define 'output' for #{self}" if self.output == nil
55
+ #raise "You must define 'application_descriptor'" if self.application_descriptor == nil || !File.exists?(self.application_descriptor)
56
+ #raise "You must define 'keystore' for #{self}" if self.keystore == nil
57
+ #raise "You must define 'keystore_name' for #{self}" if self.keystore_name == nil
58
+ #raise "You must define 'storepass' for #{self}" if self.storepass == nil
59
+ #raise "You must define 'include_files' for #{self}\neg: include_files << 'bin .'" if self.include_files.length < 1
60
60
 
61
61
  # TODO: Somehow confirm that the initialWindow content is included in the build
62
62
  #app_xml = Nokogiri::XML(File.read(application_descriptor))
@@ -105,10 +105,10 @@ class BaseCompiler < BaseExecutable
105
105
  end
106
106
  end
107
107
 
108
- fail "You must define 'target_player' for #{self}" if self.target_player == nil && !is_target_defined
108
+ raise "You must define 'target_player' for #{self}" if self.target_player == nil && !is_target_defined
109
109
 
110
110
  # TODO: iterate over all non-default config files provided and look for source-path entries
111
- #fail "You must add at least one path to 'source_path' for #{self}" if source_path.empty? && !configSource?
111
+ #raise "You must add at least one path to 'source_path' for #{self}" if source_path.empty? && !configSource?
112
112
 
113
113
  #
114
114
  # validation complete, generate build args
@@ -167,6 +167,7 @@ class BaseCompiler < BaseExecutable
167
167
 
168
168
  def task_pre_invoke
169
169
  super
170
+ # TODO: get dependencies from config files
170
171
  # set dependencies on all .as and .mxml files in the source paths
171
172
  dependencies = FileList.new
172
173
  self.source_path.each do |path|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-01 00:00:00.000000000 Z
12
+ date: 2012-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -65,9 +65,8 @@ dependencies:
65
65
  - - ~>
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0.9'
68
- description: ! 'A Rake library for Actionscript 3, Flex, and AIR projects.
69
-
70
- See full documentation at https://github.com/nexussays/ASRake/blob/master/README.md
68
+ description: ! 'A Rake-based library for quickly and easily creating build scripts
69
+ for Actionscript 3, Flex, and AIR projects.
71
70
 
72
71
  '
73
72
  email:
@@ -119,7 +118,6 @@ rubyforge_project:
119
118
  rubygems_version: 1.8.24
120
119
  signing_key:
121
120
  specification_version: 3
122
- summary: A cross-platform Rake library to quickly and easily create build scripts
123
- for Actionscript 3, Flex, and AIR projects.
121
+ summary: A Rake library for Actionscript 3, Flex, and AIR projects.
124
122
  test_files: []
125
123
  has_rdoc: