flashsdk 1.0.5.pre → 1.0.12.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -1
- data/Gemfile.lock +26 -0
- data/POSTINSTALL.rdoc +1 -1
- data/README.textile +79 -0
- data/VERSION +1 -1
- data/bin/sprout-flex +8 -0
- data/doc/adl-list.txt +4 -0
- data/doc/adt-list.txt +12 -0
- data/ext/CloseFlashPlayerForDumbassOSX.scpt +6 -0
- data/ext/OpenFlashPlayerForDumbassOSX.scpt +12 -0
- data/flashsdk-1.0.11.pre.gem +0 -0
- data/flashsdk.gemspec +1 -3
- data/lib/flashplayer/log_file.rb +4 -5
- data/lib/flashplayer/specification.rb +1 -1
- data/lib/flashplayer/system_mixins.rb +91 -0
- data/lib/flashplayer/task.rb +1 -38
- data/lib/flashplayer.rb +1 -0
- data/lib/flashsdk/adl.rb +50 -0
- data/lib/flashsdk/adt.rb +227 -0
- data/lib/flashsdk/amxmlc.rb +29 -0
- data/lib/flashsdk/compc.rb +6 -3
- data/lib/flashsdk/compiler_base.rb +8 -0
- data/lib/flashsdk/generators/flash_helper.rb +27 -7
- data/lib/flashsdk/generators/flex_project_generator.rb +30 -0
- data/lib/flashsdk/generators/project_generator.rb +6 -6
- data/lib/flashsdk/generators/templates/ActionScript3RunnerClass.as +19 -0
- data/lib/flashsdk/generators/templates/Flex4Application.mxml +45 -0
- data/lib/flashsdk/generators/templates/Flex4Main.css +7 -0
- data/lib/flashsdk/generators/templates/Flex4Rakefile.rb +35 -0
- data/lib/flashsdk/generators/templates/Flex4RunnerClass.mxml +29 -0
- data/lib/flashsdk/generators/templates/FlexTestRunner.mxml +0 -0
- data/lib/flashsdk/generators/templates/rakefile.rb +24 -4
- data/lib/flashsdk/module.rb +2 -2
- data/lib/flashsdk/mxmlc.rb +10 -7
- data/lib/flashsdk.rb +4 -0
- data/lib/flex4.rb +2 -2
- data/mate +0 -0
- data/rakefile.rb +22 -3
- data/test/fixtures/air/simple/SomeProject.as +11 -0
- data/test/fixtures/air/simple/SomeProject.mxml +9 -0
- data/test/fixtures/air/simple/SomeProject.pfx +0 -0
- data/test/fixtures/air/simple/SomeProject.swf +0 -0
- data/test/fixtures/air/simple/SomeProject.xml +13 -0
- data/test/fixtures/flashplayer/AsUnit Runner.swf +0 -0
- data/test/unit/adl_test.rb +30 -0
- data/test/unit/adt_test.rb +68 -0
- data/test/unit/amxmlc_test.rb +54 -0
- data/test/unit/{task_test.rb → flashplayer_task_test.rb} +4 -5
- data/test/unit/flex_generator_test.rb +37 -0
- data/test/unit/mxmlc_test.rb +5 -5
- data/test/unit/project_generator_test.rb +4 -0
- data/test/unit/test_helper.rb +4 -5
- metadata +51 -14
- data/lib/flashplayer/clix_flash_player.rb +0 -91
- data/lib/flashplayer/clix_wrapper.rb +0 -22
- /data/test/unit/{log_file_test.rb → flashplayer_log_file_test.rb} +0 -0
- /data/test/unit/{mm_config_test.rb → flashplayer_mm_config_test.rb} +0 -0
- /data/test/unit/{flashplayer_test.rb → flashplayer_module_test.rb} +0 -0
- /data/test/unit/{trust_test.rb → flashplayer_trust_test.rb} +0 -0
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
archive-tar-minitar (0.5.2)
|
5
|
+
mocha (0.9.8)
|
6
|
+
rake
|
7
|
+
open4 (1.0.1)
|
8
|
+
rake (0.8.7)
|
9
|
+
rdoc (2.5.11)
|
10
|
+
rubyzip (0.9.4)
|
11
|
+
shoulda (2.11.3)
|
12
|
+
sprout (1.0.28.pre)
|
13
|
+
archive-tar-minitar (= 0.5.2)
|
14
|
+
bundler (>= 0.9.19)
|
15
|
+
open4 (>= 0.9.6)
|
16
|
+
rake (>= 0.8.7)
|
17
|
+
rdoc (>= 2.5.8)
|
18
|
+
rubyzip (= 0.9.4)
|
19
|
+
|
20
|
+
PLATFORMS
|
21
|
+
ruby
|
22
|
+
|
23
|
+
DEPENDENCIES
|
24
|
+
mocha
|
25
|
+
shoulda
|
26
|
+
sprout (>= 1.0.26.pre)
|
data/POSTINSTALL.rdoc
CHANGED
data/README.textile
CHANGED
@@ -0,0 +1,79 @@
|
|
1
|
+
|
2
|
+
h1. The Flash SDK Sprout Gem
|
3
|
+
|
4
|
+
h3. Installation
|
5
|
+
|
6
|
+
# "Install Ruby":http://www.ruby-lang.org/en/downloads/ _(>= v 1.8.7)_
|
7
|
+
# "Install RubyGems":http://rubyforge.org/frs/?group_id=126 _(>= v 1.3.6)_
|
8
|
+
# Install the Flash SDK prerelease gem:
|
9
|
+
|
10
|
+
<pre><code>gem install flashsdk --pre</code></pre>
|
11
|
+
|
12
|
+
h3. Getting Started
|
13
|
+
|
14
|
+
Open a terminal and enter the following commands:
|
15
|
+
|
16
|
+
Create a new ActionScript 3 project and move into it:
|
17
|
+
|
18
|
+
<pre><code>sprout-as3 SomeProject
|
19
|
+
cd SomeProject</code></pre>
|
20
|
+
|
21
|
+
|
22
|
+
Resolve all dependencies, compile and launch the SWF:
|
23
|
+
|
24
|
+
<pre><code>rake</code></pre>
|
25
|
+
|
26
|
+
Generate a new class, test case and test suite:
|
27
|
+
|
28
|
+
<pre><code>sprout-class utils.MathUtil</code></pre>
|
29
|
+
|
30
|
+
Compile and launch the test harness:
|
31
|
+
|
32
|
+
<pre><code>rake test</code></pre>
|
33
|
+
|
34
|
+
Compile a SWC file:
|
35
|
+
|
36
|
+
<pre><code>rake swc</code></pre>
|
37
|
+
|
38
|
+
Generate documentation using "AsDoc":http://labs.adobe.com/wiki/index.php/ASDoc:
|
39
|
+
|
40
|
+
<pre><code>rake asdoc</code></pre>
|
41
|
+
|
42
|
+
Execute the test harness, emit a JUnit-compatible test results document, and close the Flash Player when complete or after encountering an uncaught exception:
|
43
|
+
|
44
|
+
<pre><code>rake ci</code></pre>
|
45
|
+
|
46
|
+
Display all available Rake tasks:
|
47
|
+
|
48
|
+
<pre><code>rake -T</code></pre>
|
49
|
+
|
50
|
+
h3. Some Links
|
51
|
+
|
52
|
+
* "Web Site":http://projectsprouts.org
|
53
|
+
* "See the Documentation":http://projectsprouts.org/rdoc
|
54
|
+
* "Meet the Community":http://groups.google.com/group/projectsprouts
|
55
|
+
|
56
|
+
h3. MIT License
|
57
|
+
|
58
|
+
<pre>
|
59
|
+
Copyright (c) 2007-2010 Pattern Park
|
60
|
+
|
61
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
62
|
+
a copy of this software and associated documentation files (the
|
63
|
+
"Software"), to deal in the Software without restriction, including
|
64
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
65
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
66
|
+
permit persons to whom the Software is furnished to do so, subject to
|
67
|
+
the following conditions:
|
68
|
+
|
69
|
+
The above copyright notice and this permission notice shall be
|
70
|
+
included in all copies or substantial portions of the Software.
|
71
|
+
|
72
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
73
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
74
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
75
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
76
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
77
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
78
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
79
|
+
</pre>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.12.pre
|
data/bin/sprout-flex
ADDED
data/doc/adl-list.txt
CHANGED
data/doc/adt-list.txt
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
usage:
|
2
|
+
adt -checkstore SIGNING_OPTIONS
|
3
|
+
adt -certificate -cn <name> ( -ou <org-unit> )? ( -o <org-name> )? ( -c <country> )? <key-type> <pfx-file> <password>
|
4
|
+
adt -help
|
5
|
+
adt -migrate SIGNING_OTIONS <air-file-in> <air-file-out>
|
6
|
+
adt -package SIGNING_OPTIONS <air-file> <app-desc> FILE_ARGS
|
7
|
+
adt -prepare <airi-file> <app-desc> FILE_ARGS
|
8
|
+
adt -sign SIGNING_OPTIONS <airi-file> <air-file>
|
9
|
+
adt -version
|
10
|
+
|
11
|
+
SIGNING_OPTIONS: -storetype <type> ( -keystore <store> )? ( -storepass <pass> )? ( -keypass <pass> )? ( -providerName <name> )? ( -tsa <url> )?
|
12
|
+
FILE_ARGS: <fileOrDir>* (( -C <dir> <fileOrDir>+ ) | ( -e <file> <path> ))*
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
on run argv
|
3
|
+
set flash_player to item 1 of argv as text
|
4
|
+
set swf_file to item 2 of argv as text
|
5
|
+
tell application flash_player to activate
|
6
|
+
tell application flash_player to open swf_file
|
7
|
+
repeat
|
8
|
+
if application flash_player is not running then exit repeat
|
9
|
+
delay 0.1
|
10
|
+
end repeat
|
11
|
+
end run
|
12
|
+
|
Binary file
|
data/flashsdk.gemspec
CHANGED
@@ -3,8 +3,6 @@ lib = File.expand_path File.dirname(__FILE__), 'lib'
|
|
3
3
|
$:.unshift lib unless $:.include?(lib)
|
4
4
|
|
5
5
|
require 'bundler'
|
6
|
-
Bundler.setup
|
7
|
-
|
8
6
|
require 'flashsdk'
|
9
7
|
|
10
8
|
Gem::Specification.new do |s|
|
@@ -15,7 +13,7 @@ Gem::Specification.new do |s|
|
|
15
13
|
s.homepage = "http://www.adobe.com/products/flex"
|
16
14
|
s.summary = "Adobe Flash SDK including mxmlc, compc, asdoc, adl, adt, optimizer and fdb"
|
17
15
|
s.description = "The Flash SDK Rubygem is brought to you by Project Sprouts (http://projectsprouts.org)"
|
18
|
-
s.
|
16
|
+
s.executables = ['sprout-as3', 'sprout-flex']
|
19
17
|
s.post_install_message = File.read 'POSTINSTALL.rdoc'
|
20
18
|
s.files = FileList['**/**/*'].exclude /.git|.svn|.DS_Store/
|
21
19
|
s.add_bundler_dependencies
|
data/lib/flashplayer/log_file.rb
CHANGED
@@ -6,7 +6,8 @@ module FlashPlayer
|
|
6
6
|
attr_accessor :logger
|
7
7
|
|
8
8
|
def initialize
|
9
|
-
@logger
|
9
|
+
@logger = $stdout
|
10
|
+
super
|
10
11
|
end
|
11
12
|
|
12
13
|
def tail thread=nil
|
@@ -26,12 +27,10 @@ module FlashPlayer
|
|
26
27
|
thread ||= fake_thread
|
27
28
|
lines_put = 0
|
28
29
|
|
29
|
-
trap("INT") { thread.kill }
|
30
|
-
|
31
30
|
while thread.alive? do
|
32
31
|
lines_put = read_from_file path, lines_put
|
33
32
|
logger.flush
|
34
|
-
sleep(0.
|
33
|
+
sleep(0.1)
|
35
34
|
end
|
36
35
|
|
37
36
|
logger.puts ""
|
@@ -85,7 +84,7 @@ module FlashPlayer
|
|
85
84
|
end
|
86
85
|
end
|
87
86
|
|
88
|
-
desc "Tail the flashlog.txt and block"
|
87
|
+
desc "Tail the flashlog.txt and block (until CTRL+C)"
|
89
88
|
task :flashlog do
|
90
89
|
mm_config = FlashPlayer::MMConfig.new
|
91
90
|
mm_config.create
|
@@ -9,7 +9,7 @@ Sprout::Specification.new do |s|
|
|
9
9
|
t.archive_type = :zip
|
10
10
|
t.url = "http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_sa_debug.app.zip"
|
11
11
|
t.md5 = "ff6824b7fd676dd1b613204221f5b5b9"
|
12
|
-
t.add_executable :flashplayer, "Flash Player Debugger.app
|
12
|
+
t.add_executable :flashplayer, "Flash Player Debugger.app"
|
13
13
|
end
|
14
14
|
|
15
15
|
s.add_remote_file_target do |t|
|
@@ -0,0 +1,91 @@
|
|
1
|
+
##
|
2
|
+
# Update the native System instances
|
3
|
+
# to handle FlashPlayer launching in
|
4
|
+
# order to overcome non-cli limitations.
|
5
|
+
#
|
6
|
+
module Sprout
|
7
|
+
module System
|
8
|
+
|
9
|
+
class WinSystem
|
10
|
+
|
11
|
+
def open_flashplayer_with exe, swf
|
12
|
+
return Thread.new {
|
13
|
+
system exe, swf
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class OSXSystem < UnixSystem
|
19
|
+
|
20
|
+
##
|
21
|
+
# Use AppleScript to open the specified Flash Player
|
22
|
+
# because, simply launching the executable does not focus
|
23
|
+
# it.
|
24
|
+
def open_flashplayer_with exe, swf
|
25
|
+
# Clean paths differently for this exectuable,
|
26
|
+
# because we're forking out to AppleScript over
|
27
|
+
# a new process, and spaces need to be escaped.
|
28
|
+
@player_exe = exe.split(' ').join('\ ')
|
29
|
+
|
30
|
+
wrapper = []
|
31
|
+
wrapper << "osascript"
|
32
|
+
wrapper << open_flashplayer_script_path
|
33
|
+
wrapper << @player_exe
|
34
|
+
|
35
|
+
# Call the UnixSystem.open_flashplayer_with method:
|
36
|
+
super wrapper.join(" "), File.expand_path(swf)
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
##
|
42
|
+
# Use AppleScript to close the Flash Player
|
43
|
+
def close_flashplayer
|
44
|
+
closer = []
|
45
|
+
closer << "osascript"
|
46
|
+
closer << close_flashplayer_script_path
|
47
|
+
closer << @player_exe
|
48
|
+
`#{closer.join(" ")}`
|
49
|
+
end
|
50
|
+
|
51
|
+
def ext_gem_path
|
52
|
+
File.join(File.dirname(__FILE__), '..', '..', 'ext')
|
53
|
+
end
|
54
|
+
|
55
|
+
def close_flashplayer_script_path
|
56
|
+
File.expand_path(File.join(ext_gem_path, "CloseFlashPlayerForDumbassOSX.scpt"))
|
57
|
+
end
|
58
|
+
|
59
|
+
def open_flashplayer_script_path
|
60
|
+
File.expand_path(File.join(ext_gem_path, "OpenFlashPlayerForDumbassOSX.scpt"))
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
# All others inherit from this class
|
66
|
+
class UnixSystem
|
67
|
+
|
68
|
+
def open_flashplayer_with exe, swf
|
69
|
+
trap("INT") {
|
70
|
+
close_flashplayer
|
71
|
+
@player_thread.kill
|
72
|
+
}
|
73
|
+
|
74
|
+
@player_thread = Thread.new {
|
75
|
+
require 'open4'
|
76
|
+
@player_pid, stdin, stdout, stderr = Open4.popen4("#{exe} #{swf}")
|
77
|
+
stdout.read
|
78
|
+
}
|
79
|
+
end
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
def close_flashplayer
|
84
|
+
# Don't need to do anything - created
|
85
|
+
# this method to handle belligerent OS X trash.
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
data/lib/flashplayer/task.rb
CHANGED
@@ -25,7 +25,6 @@ module FlashPlayer
|
|
25
25
|
|
26
26
|
def execute *args
|
27
27
|
super
|
28
|
-
#puts ">> invoke with: #{args} and input: #{input}"
|
29
28
|
update_input_if_necessary
|
30
29
|
execute_safely do
|
31
30
|
update_mm_config
|
@@ -50,6 +49,7 @@ module FlashPlayer
|
|
50
49
|
|
51
50
|
def execute_safely
|
52
51
|
begin
|
52
|
+
Thread.abort_on_exception = true
|
53
53
|
yield if block_given?
|
54
54
|
rescue FlashPlayer::PathError => e
|
55
55
|
logger.puts ">> [WARNING] It seems this was the first time FlashPlayer was launched on this system and as a result, the expected folders were not found. Please close the Player and run again - this message should only ever be displayed once."
|
@@ -94,43 +94,6 @@ module FlashPlayer
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
##
|
98
|
-
# Update the native System instances
|
99
|
-
# to handle FlashPlayer launching in
|
100
|
-
# order to overcome non-cli limitations.
|
101
|
-
#
|
102
|
-
module Sprout
|
103
|
-
module System
|
104
|
-
|
105
|
-
class WinSystem
|
106
|
-
def open_flashplayer_with exe, swf
|
107
|
-
return Thread.new {
|
108
|
-
system command
|
109
|
-
}
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
class OSXSystem
|
114
|
-
def open_flashplayer_with exe, swf
|
115
|
-
require 'flashplayer/clix_flash_player'
|
116
|
-
@clix_player = CLIXFlashPlayer.new
|
117
|
-
@clix_player.execute(exe, swf)
|
118
|
-
return @clix_player
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
class UnixSystem
|
123
|
-
def open_flashplayer_with exe, swf
|
124
|
-
return Thread.new {
|
125
|
-
require 'open4'
|
126
|
-
@player_pid, stdin, stdout, stderr = Open4.popen4(command)
|
127
|
-
stdout.read
|
128
|
-
}
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
97
|
def flashplayer *args, &block
|
135
98
|
FlashPlayer::Task.define_task *args, &block
|
136
99
|
end
|
data/lib/flashplayer.rb
CHANGED
data/lib/flashsdk/adl.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
module FlashSDK
|
2
|
+
|
3
|
+
class ADL
|
4
|
+
include Sprout::Executable
|
5
|
+
|
6
|
+
add_param :runtime, Path
|
7
|
+
|
8
|
+
add_param :pubid, String
|
9
|
+
|
10
|
+
add_param :nodebug, Boolean
|
11
|
+
|
12
|
+
add_param :profile, String
|
13
|
+
|
14
|
+
add_param :screensize, String
|
15
|
+
|
16
|
+
add_param :app_desc, String, { :hidden_name => true, :delimiter => ' ' }
|
17
|
+
|
18
|
+
add_param :root_dir, String, { :hidden_name => true, :delimiter => ' ' }
|
19
|
+
|
20
|
+
#add_param :shitty_dashes, String, { :hidden_name => true, :delimiter => ' ', :default => '--' }
|
21
|
+
|
22
|
+
add_param :input, File, { :hidden_name => true }
|
23
|
+
|
24
|
+
##
|
25
|
+
# The the Ruby file that will load the expected
|
26
|
+
# Sprout::Specification.
|
27
|
+
#
|
28
|
+
# Default value is 'flex4'
|
29
|
+
#
|
30
|
+
set :pkg_name, 'flex4'
|
31
|
+
|
32
|
+
##
|
33
|
+
# The default pkg version
|
34
|
+
#
|
35
|
+
set :pkg_version, ">= #{FlashSDK::VERSION}"
|
36
|
+
|
37
|
+
##
|
38
|
+
# The default executable target.
|
39
|
+
#
|
40
|
+
set :executable, :adl
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class Sprout::System::UnixSystem
|
45
|
+
|
46
|
+
def should_repair_executable path
|
47
|
+
return false
|
48
|
+
#return (File.exists?(path) && !File.directory?(path) && File.read(path).match(/^\#\!\/bin\/sh/))
|
49
|
+
end
|
50
|
+
end
|
data/lib/flashsdk/adt.rb
ADDED
@@ -0,0 +1,227 @@
|
|
1
|
+
module FlashSDK
|
2
|
+
|
3
|
+
##
|
4
|
+
# Creates AIR certificates and compiles AIR packages for distribution.
|
5
|
+
#
|
6
|
+
# Following is an example of how this tool might be used to create
|
7
|
+
# a certificate and AIR package:
|
8
|
+
#
|
9
|
+
# mxmlc 'bin/SomeProject.swf' do |t|
|
10
|
+
# t.input = 'src/SomeProject.as'
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# adt 'cert/SomeProject.pfx' do |t|
|
14
|
+
# t.certificate = true
|
15
|
+
# t.cn = 'SelfCertificate'
|
16
|
+
# t.key_type = '2048-RSA'
|
17
|
+
# t.pfx_file = 'cert/SomeProject.pfx'
|
18
|
+
# # Don't check the .password file into version control:
|
19
|
+
# t.password = File.read('cert/.password')
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# adt 'bin/SomeProject.air' => ['bin/SomeProject.swf', 'cert/SomeProject.pfx'] do |t|
|
23
|
+
# t.package = true
|
24
|
+
# t.package_input = 'SomeProject.xml'
|
25
|
+
# t.package_output = 'bin/SomeProject.air'
|
26
|
+
# t.storetype = 'PKCS12'
|
27
|
+
# t.keystore = 'cert/SomeProject.pfx'
|
28
|
+
# # Don't check the .password file into version control:
|
29
|
+
# t.storepass = File.read('cert/.password')
|
30
|
+
# t.included_files << 'bin/SomeProject.swf'
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# desc "Compile, certify and package the AIR application"
|
34
|
+
# task package => 'bin/SomeProject.air'
|
35
|
+
#
|
36
|
+
class ADT
|
37
|
+
include Sprout::Executable
|
38
|
+
#NOTE:
|
39
|
+
# The order of these parameters is important!
|
40
|
+
# Please do not alphabetize or rearrange unless you're
|
41
|
+
# fixing a bug related to how ADT actually expects
|
42
|
+
# the arguments...
|
43
|
+
|
44
|
+
##
|
45
|
+
# Create an AIR package.
|
46
|
+
#
|
47
|
+
add_param :package, Boolean, { :hidden_value => true }
|
48
|
+
|
49
|
+
##
|
50
|
+
# Set true to create a certificate.
|
51
|
+
#
|
52
|
+
# If this value is true, you can optionally set org_unit, org_name and country.
|
53
|
+
#
|
54
|
+
# If this value is true, you MUST set +cn+, +key_type+, and +pfx_file+.
|
55
|
+
#
|
56
|
+
# adt 'cert/SampleCert.pfx' do |t|
|
57
|
+
# t.certificate = true
|
58
|
+
# t.cn = 'SelfCertificate'
|
59
|
+
# t.key_type = '1024-RSA'
|
60
|
+
# t.pfx_file = 'cert/SampleCert.pfx'
|
61
|
+
# t.password = 'samplepassword'
|
62
|
+
# end
|
63
|
+
#
|
64
|
+
add_param :certificate, Boolean, { :hidden_value => true }
|
65
|
+
|
66
|
+
##
|
67
|
+
# A Signing Option
|
68
|
+
#
|
69
|
+
add_param :storetype, String, { :delimiter => ' ' }
|
70
|
+
|
71
|
+
|
72
|
+
##
|
73
|
+
# A Signing Option
|
74
|
+
#
|
75
|
+
add_param :keystore, String, { :delimiter => ' ' }
|
76
|
+
|
77
|
+
##
|
78
|
+
# Provide the password directly to the ADT task
|
79
|
+
# so that it doesn't attempt to prompt.
|
80
|
+
#
|
81
|
+
add_param :storepass, String, { :delimiter => ' ' }
|
82
|
+
|
83
|
+
|
84
|
+
##
|
85
|
+
# A Signing Option
|
86
|
+
#
|
87
|
+
add_param :keypass, String, { :delimiter => ' ' }
|
88
|
+
|
89
|
+
|
90
|
+
##
|
91
|
+
# A Signing Option
|
92
|
+
#
|
93
|
+
add_param :providername, String, { :delimiter => ' ' }
|
94
|
+
|
95
|
+
|
96
|
+
##
|
97
|
+
# A Signing Option
|
98
|
+
#
|
99
|
+
add_param :tsa, String
|
100
|
+
|
101
|
+
##
|
102
|
+
# Check Store Signing options
|
103
|
+
#
|
104
|
+
add_param :checkstore, String
|
105
|
+
|
106
|
+
##
|
107
|
+
# Expects two files:
|
108
|
+
#
|
109
|
+
# 1) The Airi file (?)
|
110
|
+
# 2) The application description
|
111
|
+
#add_param :prepare, Files
|
112
|
+
|
113
|
+
##
|
114
|
+
# Expects two files:
|
115
|
+
#
|
116
|
+
# 1) The Airi file (?)
|
117
|
+
# 2) The Air file
|
118
|
+
add_param :sign, Files, { :delimiter => ' ' }
|
119
|
+
|
120
|
+
|
121
|
+
##
|
122
|
+
# The AIR runtime version to use.
|
123
|
+
add_param :version, String, { :delimiter => ' ' }
|
124
|
+
|
125
|
+
##
|
126
|
+
# The AIR file that should be created
|
127
|
+
# after packaging is complete.
|
128
|
+
#
|
129
|
+
add_param :package_output, String, { :hidden_name => true }
|
130
|
+
|
131
|
+
##
|
132
|
+
# The XML application descriptor that
|
133
|
+
# should be used to create an AIR
|
134
|
+
# application.
|
135
|
+
#
|
136
|
+
add_param :package_input, File, { :hidden_name => true }
|
137
|
+
|
138
|
+
##
|
139
|
+
# Organization unit, follows certificate.
|
140
|
+
#
|
141
|
+
add_param :org_unit, String
|
142
|
+
|
143
|
+
##
|
144
|
+
# Organization name, follows certificate.
|
145
|
+
#
|
146
|
+
add_param :org_name, String
|
147
|
+
|
148
|
+
##
|
149
|
+
# Country, follows certificate.
|
150
|
+
#
|
151
|
+
add_param :country, String
|
152
|
+
|
153
|
+
##
|
154
|
+
# The Certificate name.
|
155
|
+
#
|
156
|
+
add_param :cn, String, { :delimiter => ' ' }
|
157
|
+
|
158
|
+
##
|
159
|
+
# Key Type, follows certificate.
|
160
|
+
#
|
161
|
+
add_param :key_type, String, { :hidden_name => true }
|
162
|
+
|
163
|
+
##
|
164
|
+
# PFX File
|
165
|
+
#
|
166
|
+
add_param :pfx_file, String, { :hidden_name => true }
|
167
|
+
|
168
|
+
##
|
169
|
+
# When creating a certificate, this is the file
|
170
|
+
# where the password can be found.
|
171
|
+
#
|
172
|
+
add_param :password, String, { :hidden_name => true, :delimiter => ' ' }
|
173
|
+
|
174
|
+
##
|
175
|
+
# Expects Signing Options, plus
|
176
|
+
# two files:
|
177
|
+
#
|
178
|
+
# 1) The Air file in
|
179
|
+
# 2) The Air file out
|
180
|
+
#
|
181
|
+
add_param :migrate, Files
|
182
|
+
|
183
|
+
##
|
184
|
+
# A list of files to include in the
|
185
|
+
#
|
186
|
+
add_param :included_files, Files, { :hidden_name => true }
|
187
|
+
|
188
|
+
##
|
189
|
+
# A list of paths (directories) to search
|
190
|
+
# for contents that will be included in the
|
191
|
+
# packaged AIR application.
|
192
|
+
#
|
193
|
+
# If files are hidden from the file system,
|
194
|
+
# they will not be included.
|
195
|
+
#
|
196
|
+
add_param :included_paths, Paths, { :hidden_name => true }
|
197
|
+
|
198
|
+
##
|
199
|
+
# The the Ruby file that will load the expected
|
200
|
+
# Sprout::Specification.
|
201
|
+
#
|
202
|
+
# Default value is 'flex4'
|
203
|
+
#
|
204
|
+
set :pkg_name, 'flex4'
|
205
|
+
|
206
|
+
##
|
207
|
+
# The default pkg version
|
208
|
+
#
|
209
|
+
set :pkg_version, ">= #{FlashSDK::VERSION}"
|
210
|
+
|
211
|
+
##
|
212
|
+
# The default executable target.
|
213
|
+
#
|
214
|
+
set :executable, :adt
|
215
|
+
|
216
|
+
##
|
217
|
+
# Ensure the default prefix is '-'
|
218
|
+
set :default_prefix, '-'
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
def adt *args, &block
|
223
|
+
exe = FlashSDK::ADT.new
|
224
|
+
exe.to_rake(*args, &block)
|
225
|
+
exe
|
226
|
+
end
|
227
|
+
|