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
@@ -0,0 +1,29 @@
|
|
1
|
+
module FlashSDK
|
2
|
+
|
3
|
+
##
|
4
|
+
# This is a wrapper for the AIR MXMLC compiler.
|
5
|
+
class AMXMLC < MXMLC
|
6
|
+
include Sprout::Executable
|
7
|
+
|
8
|
+
##
|
9
|
+
# The default executable target.
|
10
|
+
#
|
11
|
+
set :executable, :amxmlc
|
12
|
+
|
13
|
+
##
|
14
|
+
# TODO: Remove this method once this bug is fixed:
|
15
|
+
# http://www.pivotaltracker.com/story/show/4194771
|
16
|
+
#
|
17
|
+
def execute *args
|
18
|
+
self.executable = :amxmlc
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def amxmlc *args, &block
|
25
|
+
exe = FlashSDK::AMXMLC.new
|
26
|
+
exe.to_rake *args, &block
|
27
|
+
exe
|
28
|
+
end
|
29
|
+
|
data/lib/flashsdk/compc.rb
CHANGED
@@ -65,17 +65,20 @@ module FlashSDK
|
|
65
65
|
add_param :namespace, String
|
66
66
|
|
67
67
|
##
|
68
|
-
# The
|
68
|
+
# The the Ruby file that will load the expected
|
69
|
+
# Sprout::Specification.
|
70
|
+
#
|
71
|
+
# Default value is 'flex4'
|
69
72
|
#
|
70
73
|
set :pkg_name, 'flex4'
|
71
74
|
|
72
75
|
##
|
73
|
-
# The default
|
76
|
+
# The default pkg version
|
74
77
|
#
|
75
78
|
set :pkg_version, ">= #{FlashSDK::VERSION}"
|
76
79
|
|
77
80
|
##
|
78
|
-
# The default executable target
|
81
|
+
# The default executable target.
|
79
82
|
#
|
80
83
|
set :executable, :compc
|
81
84
|
end
|
@@ -12,12 +12,12 @@ module FlashSDK
|
|
12
12
|
return test
|
13
13
|
end
|
14
14
|
|
15
|
-
# Glob that is used to search for test cases and build
|
15
|
+
# Glob that is used to search for test cases and build
|
16
16
|
# up the test suites
|
17
17
|
def test_glob
|
18
18
|
return @test_glob ||= File.join(path, test, '**', '?*Test.as')
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def test_glob= glob
|
22
22
|
@test_glob = glob
|
23
23
|
end
|
@@ -27,12 +27,12 @@ module FlashSDK
|
|
27
27
|
def test_cases
|
28
28
|
@test_cases ||= Dir.glob(test_glob)
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
def test_cases= collection
|
32
32
|
@test_cases = collection
|
33
33
|
end
|
34
|
-
|
35
|
-
# Get the list of test_cases (which are files) as a
|
34
|
+
|
35
|
+
# Get the list of test_cases (which are files) as a
|
36
36
|
# list of fully qualified class names
|
37
37
|
def test_case_classes
|
38
38
|
classes = self.test_cases.dup
|
@@ -52,7 +52,7 @@ module FlashSDK
|
|
52
52
|
name.gsub!(/#{File::SEPARATOR}/, '.')
|
53
53
|
return name
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
def class_directory
|
57
57
|
parts = input_in_parts
|
58
58
|
if parts.size > 1
|
@@ -88,6 +88,10 @@ module FlashSDK
|
|
88
88
|
source
|
89
89
|
end
|
90
90
|
|
91
|
+
def project_name
|
92
|
+
input.camel_case
|
93
|
+
end
|
94
|
+
|
91
95
|
def instance_name
|
92
96
|
# TODO: should uncapitalize class_name
|
93
97
|
# (not the same as lowercase)
|
@@ -113,6 +117,22 @@ module FlashSDK
|
|
113
117
|
def fully_qualified_class_name
|
114
118
|
input
|
115
119
|
end
|
120
|
+
|
121
|
+
def deploy_swf_name
|
122
|
+
"#{class_name}.swf"
|
123
|
+
end
|
124
|
+
|
125
|
+
def debug_swf_name
|
126
|
+
"#{class_name}-debug.swf"
|
127
|
+
end
|
128
|
+
|
129
|
+
def test_swf_name
|
130
|
+
"#{class_name}-test.swf"
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_runner_name
|
134
|
+
"#{class_name}Runner"
|
135
|
+
end
|
136
|
+
|
116
137
|
end
|
117
138
|
end
|
118
|
-
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module FlashSDK
|
2
|
+
class FlexProjectGenerator < ProjectGenerator
|
3
|
+
|
4
|
+
def manifest
|
5
|
+
directory input do
|
6
|
+
template 'Rakefile', 'Flex4Rakefile.rb'
|
7
|
+
template 'Gemfile'
|
8
|
+
|
9
|
+
directory src do
|
10
|
+
template "#{input.camel_case}.mxml", 'Flex4Application.mxml'
|
11
|
+
template "#{test_runner_name}.mxml", 'Flex4RunnerClass.mxml'
|
12
|
+
|
13
|
+
directory assets do
|
14
|
+
directory css do
|
15
|
+
file 'Main.css', 'Flex4Main.css'
|
16
|
+
end
|
17
|
+
directory images
|
18
|
+
directory fonts
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
# Create empty directories:
|
24
|
+
directory lib
|
25
|
+
directory bin
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -1,13 +1,18 @@
|
|
1
1
|
module FlashSDK
|
2
2
|
class ProjectGenerator < ClassGenerator
|
3
3
|
|
4
|
+
add_param :css, Path, { :default => 'css' }
|
5
|
+
add_param :images, Path, { :default => 'images' }
|
6
|
+
add_param :fonts, Path, { :default => 'fonts' }
|
7
|
+
|
4
8
|
def manifest
|
5
9
|
directory input do
|
6
10
|
template 'rakefile.rb'
|
7
11
|
template 'Gemfile'
|
8
12
|
|
9
13
|
directory src do
|
10
|
-
template "#{input}.as", 'ActionScript3MainClass.as'
|
14
|
+
template "#{input.camel_case}.as", 'ActionScript3MainClass.as'
|
15
|
+
template "#{test_runner_name}.as", 'ActionScript3RunnerClass.as'
|
11
16
|
end
|
12
17
|
|
13
18
|
directory assets do
|
@@ -22,10 +27,5 @@ module FlashSDK
|
|
22
27
|
end
|
23
28
|
end
|
24
29
|
|
25
|
-
protected
|
26
|
-
|
27
|
-
def debug_swf_name
|
28
|
-
"#{class_name}-debug.swf"
|
29
|
-
end
|
30
30
|
end
|
31
31
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
package {
|
2
|
+
import asunit.core.TextCore;
|
3
|
+
import flash.display.MovieClip;
|
4
|
+
|
5
|
+
public class <%= test_runner_name %> extends MovieClip {
|
6
|
+
|
7
|
+
private var core:TextCore;
|
8
|
+
|
9
|
+
public function <%= test_runner_name %>() {
|
10
|
+
core = new TextCore();
|
11
|
+
// You can run a single Test Case with:
|
12
|
+
// core.start(SomeTest, null, this);
|
13
|
+
// Or a single test method with:
|
14
|
+
// core.start(SomeTest, 'testMethod', this);
|
15
|
+
core.start(AllTests, null, this);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
|
2
|
+
xmlns:s="library://ns.adobe.com/flex/spark"
|
3
|
+
xmlns:mx="library://ns.adobe.com/flex/mx"
|
4
|
+
minWidth="800"
|
5
|
+
minHeight="600"
|
6
|
+
width="1024"
|
7
|
+
height="768"
|
8
|
+
pageTitle="<%= project_name %>"
|
9
|
+
applicationComplete="<%= project_name %>CompleteHandler()">
|
10
|
+
|
11
|
+
<fx:Declarations>
|
12
|
+
|
13
|
+
<!-- You have to put all non-visual object declarations here -->
|
14
|
+
|
15
|
+
</fx:Declarations>
|
16
|
+
|
17
|
+
<s:Label id="myLabel"
|
18
|
+
text="<%= project_name %>"
|
19
|
+
width="100%"
|
20
|
+
height="100%"
|
21
|
+
fontSize="200" />
|
22
|
+
|
23
|
+
<fx:Style source="./assets/css/Main.css" />
|
24
|
+
|
25
|
+
<fx:Script>
|
26
|
+
|
27
|
+
<![CDATA[
|
28
|
+
|
29
|
+
//---------------------------------------
|
30
|
+
// PRIVATE METHODS
|
31
|
+
//---------------------------------------
|
32
|
+
|
33
|
+
/**
|
34
|
+
* @private
|
35
|
+
*/
|
36
|
+
private function <%= project_name %>CompleteHandler():void
|
37
|
+
{
|
38
|
+
trace("<%= project_name %>.mxml::<%= project_name %>CompleteHandler()");
|
39
|
+
}
|
40
|
+
]]>
|
41
|
+
|
42
|
+
</fx:Script>
|
43
|
+
|
44
|
+
</s:Application>
|
45
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
Bundler.require
|
4
|
+
|
5
|
+
##############################
|
6
|
+
# Debug
|
7
|
+
|
8
|
+
# Compile the debug swf
|
9
|
+
mxmlc "<%= bin %>/<%= debug_swf_name %>" do |t|
|
10
|
+
t.input = "<%= src %>/<%= class_name %>.mxml"
|
11
|
+
t.debug = true
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "Compile and run the debug swf"
|
15
|
+
flashplayer :debug => "<%= bin %>/<%= debug_swf_name %>"
|
16
|
+
|
17
|
+
##############################
|
18
|
+
# Test
|
19
|
+
|
20
|
+
library :asunit4
|
21
|
+
|
22
|
+
# Compile the test swf
|
23
|
+
mxmlc "<%= bin %>/<%= test_swf_name %>" => :asunit4 do |t|
|
24
|
+
t.input = "<%= src %>/<%= test_runner_name %>.mxml"
|
25
|
+
t.library_path << "lib/asunit4/AsUnit-4.2.2.pre.swc"
|
26
|
+
t.source_path << "test"
|
27
|
+
t.default_size = "900,550"
|
28
|
+
t.debug = true
|
29
|
+
end
|
30
|
+
|
31
|
+
desc "Compile and run the test swf"
|
32
|
+
flashplayer :test => "<%= bin %>/<%= test_swf_name %>"
|
33
|
+
|
34
|
+
task :default => :debug
|
35
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
|
3
|
+
xmlns:s="library://ns.adobe.com/flex/spark"
|
4
|
+
xmlns:mx="library://ns.adobe.com/flex/mx"
|
5
|
+
creationComplete="creationCompleteHandler(event)">
|
6
|
+
|
7
|
+
<fx:Script>
|
8
|
+
|
9
|
+
<![CDATA[
|
10
|
+
import asunit.core.TextCore;
|
11
|
+
import mx.core.UIComponent;
|
12
|
+
|
13
|
+
private var core:TextCore;
|
14
|
+
|
15
|
+
private function creationCompleteHandler(event:Event):void
|
16
|
+
{
|
17
|
+
// Flex 4 complains when we use UICompenent from MXML... Boo.
|
18
|
+
var visualContext:UIComponent = new UIComponent();
|
19
|
+
addElement(visualContext);
|
20
|
+
|
21
|
+
core = new TextCore();
|
22
|
+
core.start(AllTests, null, visualContext);
|
23
|
+
}
|
24
|
+
]]>
|
25
|
+
|
26
|
+
</fx:Script>
|
27
|
+
|
28
|
+
</s:Application>
|
29
|
+
|
File without changes
|
@@ -1,11 +1,16 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'bundler'
|
3
|
-
|
3
|
+
require 'bundler/setup'
|
4
4
|
|
5
|
-
|
5
|
+
require 'rake/clean'
|
6
|
+
require 'flashsdk'
|
7
|
+
require 'asunit4'
|
8
|
+
|
9
|
+
##############################
|
10
|
+
# Debug
|
6
11
|
|
7
|
-
|
8
|
-
mxmlc "<%= bin %>/<%= debug_swf_name %>"
|
12
|
+
# Compile the debug swf
|
13
|
+
mxmlc "<%= bin %>/<%= debug_swf_name %>" do |t|
|
9
14
|
t.input = "<%= src %>/<%= class_name %>.as"
|
10
15
|
t.debug = true
|
11
16
|
end
|
@@ -13,5 +18,20 @@ end
|
|
13
18
|
desc "Compile and run the debug swf"
|
14
19
|
flashplayer :debug => "<%= bin %>/<%= debug_swf_name %>"
|
15
20
|
|
21
|
+
##############################
|
22
|
+
# Test
|
23
|
+
|
24
|
+
library :asunit4
|
25
|
+
|
26
|
+
# Compile the test swf
|
27
|
+
mxmlc "<%= bin %>/<%= test_swf_name %>" => :asunit4 do |t|
|
28
|
+
t.input = "<%= src %>/<%= test_runner_name %>.as"
|
29
|
+
t.source_path << 'test'
|
30
|
+
t.debug = true
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "Compile and run the test swf"
|
34
|
+
flashplayer :test => "<%= bin %>/<%= test_swf_name %>"
|
35
|
+
|
16
36
|
task :default => :debug
|
17
37
|
|
data/lib/flashsdk/module.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
|
2
2
|
module FlashSDK
|
3
|
-
# Do this
|
3
|
+
# Do this strip, otherwise we get a carriage return
|
4
4
|
# after our version, and that poops on our archive folder
|
5
5
|
# after downloading...
|
6
6
|
version_file = File.join(File.dirname(__FILE__), '..', '..', 'VERSION')
|
7
|
-
VERSION = File.read(version_file).
|
7
|
+
VERSION = File.read(version_file).strip
|
8
8
|
end
|
9
9
|
|
data/lib/flashsdk/mxmlc.rb
CHANGED
@@ -21,9 +21,9 @@ module FlashSDK
|
|
21
21
|
#
|
22
22
|
# # Create an MXMLC named for the output file that it creates. This task depends on the
|
23
23
|
# # corelib library and will automatically add the corelib.swc to it's library_path
|
24
|
-
# mxmlc 'SomeProject.swf' => :corelib do |t|
|
25
|
-
# t.input = 'SomeProject.as'
|
26
|
-
# t.default_size = '800
|
24
|
+
# mxmlc 'bin/SomeProject.swf' => :corelib do |t|
|
25
|
+
# t.input = 'src/SomeProject.as'
|
26
|
+
# t.default_size = '800,600'
|
27
27
|
# t.default_background_color = "#FFFFFF"
|
28
28
|
# t.library_path << 'lib/SomeLibrary.swc'
|
29
29
|
# t.source_path << 'lib/otherlib'
|
@@ -45,17 +45,20 @@ module FlashSDK
|
|
45
45
|
set :default_prefix, '-'
|
46
46
|
|
47
47
|
##
|
48
|
-
# The
|
48
|
+
# The the Ruby file that will load the expected
|
49
|
+
# Sprout::Specification.
|
50
|
+
#
|
51
|
+
# Default value is 'flex4'
|
49
52
|
#
|
50
53
|
set :pkg_name, 'flex4'
|
51
54
|
|
52
55
|
##
|
53
|
-
# The default
|
56
|
+
# The default pkg version
|
54
57
|
#
|
55
|
-
set :pkg_version, ">= #{VERSION}"
|
58
|
+
set :pkg_version, ">= #{FlashSDK::VERSION}"
|
56
59
|
|
57
60
|
##
|
58
|
-
# The default executable target
|
61
|
+
# The default executable target.
|
59
62
|
#
|
60
63
|
set :executable, :mxmlc
|
61
64
|
|
data/lib/flashsdk.rb
CHANGED
@@ -7,8 +7,12 @@ require 'flashsdk/module'
|
|
7
7
|
require 'flashsdk/generators/flash_helper'
|
8
8
|
require 'flashsdk/generators/class_generator'
|
9
9
|
require 'flashsdk/generators/project_generator'
|
10
|
+
require 'flashsdk/generators/flex_project_generator'
|
10
11
|
require 'flashsdk/compiler_base'
|
11
12
|
require 'flashsdk/mxmlc'
|
12
13
|
require 'flashsdk/compc'
|
14
|
+
require 'flashsdk/amxmlc'
|
15
|
+
require 'flashsdk/adt'
|
16
|
+
require 'flashsdk/adl'
|
13
17
|
require 'flashplayer'
|
14
18
|
|
data/lib/flex4.rb
CHANGED
@@ -9,8 +9,8 @@ Sprout::Specification.new do |s|
|
|
9
9
|
# Apply the shared platform configuration:
|
10
10
|
# Remote Archive:
|
11
11
|
t.archive_type = :zip
|
12
|
-
t.url = "http://
|
13
|
-
t.md5 = "
|
12
|
+
t.url = "http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16076.zip"
|
13
|
+
t.md5 = "4c5f3d3fa4e1f5be244679210cd852c0"
|
14
14
|
|
15
15
|
# Executables: (add .exe suffix if it was passed in)
|
16
16
|
t.add_executable :aasdoc, "bin/aasdoc"
|
data/mate
ADDED
File without changes
|
data/rakefile.rb
CHANGED
@@ -1,20 +1,39 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'bundler'
|
3
3
|
|
4
|
-
Bundler.
|
4
|
+
Bundler.require
|
5
5
|
|
6
6
|
require 'rake'
|
7
7
|
require 'rake/clean'
|
8
8
|
require 'rake/testtask'
|
9
9
|
|
10
|
-
|
10
|
+
require File.join(File.dirname(__FILE__), 'lib', 'flashsdk', 'module')
|
11
11
|
|
12
|
+
namespace :test do
|
12
13
|
Rake::TestTask.new(:units) do |t|
|
13
14
|
t.libs << "test/unit"
|
14
15
|
t.test_files = FileList["test/unit/*_test.rb"]
|
15
16
|
t.verbose = true
|
16
17
|
end
|
17
|
-
|
18
18
|
end
|
19
19
|
|
20
|
+
desc "Run the test harness"
|
20
21
|
task :test => 'test:units'
|
22
|
+
|
23
|
+
file 'pkg' do
|
24
|
+
FileUtils.makedirs 'pkg'
|
25
|
+
end
|
26
|
+
|
27
|
+
gem_package = "flashsdk-#{FlashSDK::VERSION}.gem"
|
28
|
+
|
29
|
+
file "pkg/#{gem_package}" => [:clean, 'pkg'] do
|
30
|
+
sh "gem build flashsdk.gemspec"
|
31
|
+
FileUtils.mv gem_package, "pkg/#{gem_package}"
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Create the gem package"
|
35
|
+
task :package => "pkg/#{gem_package}"
|
36
|
+
|
37
|
+
CLEAN.add gem_package
|
38
|
+
CLEAN.add 'pkg'
|
39
|
+
|
Binary file
|
Binary file
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<application xmlns="http://ns.adobe.com/air/application/2.0">
|
3
|
+
<id>sprouts.ADTTest</id>
|
4
|
+
<version>0.1</version>
|
5
|
+
<filename>SomeProject</filename>
|
6
|
+
<initialWindow>
|
7
|
+
<content>test/fixtures/air/simple/SomeProject.swf</content>
|
8
|
+
<visible>true</visible>
|
9
|
+
<width>400</width>
|
10
|
+
<height>200</height>
|
11
|
+
</initialWindow>
|
12
|
+
</application>
|
13
|
+
|
Binary file
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
|
+
|
3
|
+
class ADLTest < Test::Unit::TestCase
|
4
|
+
include SproutTestCase
|
5
|
+
|
6
|
+
context "An ADL tool" do
|
7
|
+
|
8
|
+
setup do
|
9
|
+
@fixture = File.join 'test', 'fixtures', 'air', 'simple'
|
10
|
+
@app_desc = File.join @fixture, 'SomeProject.xml'
|
11
|
+
|
12
|
+
#Sprout::Log.debug = false
|
13
|
+
end
|
14
|
+
|
15
|
+
teardown do
|
16
|
+
end
|
17
|
+
|
18
|
+
should "accept input" do
|
19
|
+
adl = FlashSDK::ADL.new
|
20
|
+
adl.app_desc = @app_desc
|
21
|
+
adl.root_dir = Dir.pwd
|
22
|
+
assert_equal "#{@app_desc} #{Dir.pwd}", adl.to_shell
|
23
|
+
# Uncomment to actually launch
|
24
|
+
# the AIR application:
|
25
|
+
#adl.execute
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
|
+
|
3
|
+
class ADTTest < Test::Unit::TestCase
|
4
|
+
include SproutTestCase
|
5
|
+
|
6
|
+
context "An ADT tool" do
|
7
|
+
|
8
|
+
setup do
|
9
|
+
@fixture = File.join 'test', 'fixtures', 'air', 'simple'
|
10
|
+
@application_xml = File.join @fixture, 'SomeProject.xml'
|
11
|
+
@expected_output = File.join @fixture, 'SomeProject.air'
|
12
|
+
@swf_input = File.join @fixture, 'SomeProject.swf'
|
13
|
+
@swf_main = File.join @fixture, 'SomeProject.mxml'
|
14
|
+
|
15
|
+
@certificate = File.join @fixture, 'SomeProject.pfx'
|
16
|
+
@cert_password = 'samplePassword'
|
17
|
+
|
18
|
+
#Sprout::Log.debug = false
|
19
|
+
end
|
20
|
+
|
21
|
+
teardown do
|
22
|
+
remove_file @expected_output
|
23
|
+
end
|
24
|
+
|
25
|
+
should "package a SWF with an application.xml" do
|
26
|
+
as_a_unix_system do
|
27
|
+
t = adt @expected_output do |t|
|
28
|
+
t.package = true
|
29
|
+
t.package_input = @application_xml
|
30
|
+
t.package_output = @expected_output
|
31
|
+
t.storetype = 'PKCS12'
|
32
|
+
t.keystore = @certificate
|
33
|
+
t.storepass = @cert_password
|
34
|
+
t.included_files << @swf_input
|
35
|
+
end
|
36
|
+
assert_equal '-package -storetype PKCS12 -keystore test/fixtures/air/simple/SomeProject.pfx -storepass samplePassword test/fixtures/air/simple/SomeProject.air test/fixtures/air/simple/SomeProject.xml test/fixtures/air/simple/SomeProject.swf', t.to_shell
|
37
|
+
|
38
|
+
#t.execute
|
39
|
+
#assert_file @expected_output
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
should "create a self-signed certificate" do
|
44
|
+
as_a_unix_system do
|
45
|
+
t = adt(@certificate) do |t|
|
46
|
+
t.certificate = true
|
47
|
+
t.cn = 'SelfCertificate'
|
48
|
+
t.key_type = '2048-RSA'
|
49
|
+
t.pfx_file = @certificate
|
50
|
+
t.password = @cert_password
|
51
|
+
end
|
52
|
+
assert_equal '-certificate -cn SelfCertificate 2048-RSA test/fixtures/air/simple/SomeProject.pfx samplePassword', t.to_shell
|
53
|
+
|
54
|
+
#t.execute
|
55
|
+
#assert_file @certificate
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# USE THIS METHOD TO CREATE THE INPUT SWF:
|
60
|
+
#should "create an input swf" do
|
61
|
+
#t = amxmlc @swf_input do |t|
|
62
|
+
#t.input = @swf_main
|
63
|
+
#end
|
64
|
+
#t.execute
|
65
|
+
#end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|