flashsdk 1.0.27.pre → 1.0.28.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'sprout', '>= 1.1.11.pre'
3
+ gem 'sprout', '>= 1.1.13.pre'
4
4
 
5
5
  group :development do
6
6
  gem "shoulda"
@@ -2,13 +2,12 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  archive-tar-minitar (0.5.2)
5
- mocha (0.9.10)
6
- rake
5
+ mocha (0.9.12)
7
6
  open4 (1.0.1)
8
- rake (0.8.7)
7
+ rake (0.9.0)
9
8
  rubyzip (0.9.4)
10
9
  shoulda (2.11.3)
11
- sprout (1.1.11.pre)
10
+ sprout (1.1.13.pre)
12
11
  archive-tar-minitar (= 0.5.2)
13
12
  bundler (>= 0.9.19)
14
13
  open4 (>= 0.9.6)
@@ -21,4 +20,4 @@ PLATFORMS
21
20
  DEPENDENCIES
22
21
  mocha
23
22
  shoulda
24
- sprout (>= 1.1.11.pre)
23
+ sprout (>= 1.1.13.pre)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.27.pre
1
+ 1.0.28.pre
@@ -3,6 +3,7 @@ require 'sprout'
3
3
  lib = File.expand_path File.dirname(__FILE__)
4
4
  $:.unshift lib unless $:.include?(lib)
5
5
 
6
+ require 'rake/dsl'
6
7
  require 'benchmark'
7
8
  require 'flashsdk/module'
8
9
  require 'flashsdk/generators/flash_helper'
@@ -8,9 +8,9 @@ module FlashSDK
8
8
 
9
9
  add_param :nodebug, Boolean
10
10
 
11
- add_param :profile, String
11
+ add_param :profile, String, { :delimiter => ' ' }
12
12
 
13
- add_param :screensize, String
13
+ add_param :screensize, String, { :delimiter => ' ' }
14
14
 
15
15
  add_param :app_desc, String, { :hidden_name => true, :delimiter => ' ' }
16
16
 
@@ -37,9 +37,20 @@ module FlashSDK
37
37
  # The default executable target.
38
38
  #
39
39
  set :executable, :adl
40
+
41
+ ##
42
+ # The default prefix
43
+ #
44
+ set :default_prefix, '-'
40
45
  end
41
46
  end
42
47
 
48
+ def adl *args, &block
49
+ exe = FlashSDK::ADL.new
50
+ exe.to_rake(*args, &block)
51
+ exe
52
+ end
53
+
43
54
  ##
44
55
  # TODO: This should NOT be here!
45
56
  # This is preventing that method from working
@@ -39,12 +39,42 @@ module FlashSDK
39
39
  # Please do not alphabetize or rearrange unless you're
40
40
  # fixing a bug related to how ADT actually expects
41
41
  # the arguments...
42
-
42
+
43
+ ##
44
+ # Install an app on a device
45
+ #
46
+ add_param :installApp, Boolean, { :hidden_value => true }
47
+
48
+ ##
49
+ # Uninstall an app from a device
50
+ #
51
+ add_param :uninstallApp, Boolean, { :hidden_value => true }
52
+
53
+ ##
54
+ # Launch an app on a device
55
+ #
56
+ add_param :launchApp, Boolean, { :hidden_value => true }
57
+
58
+ ##
59
+ # The platform to use (ex: android)
60
+ #
61
+ add_param :platform, String, { :delimiter => ' ' }
62
+
63
+ ##
64
+ # The appid of the app being installed/uninstalled (ex: com.foo.Bar)
65
+ #
66
+ add_param :appid, String, { :delimiter => ' ' }
67
+
43
68
  ##
44
69
  # Create an AIR package.
45
70
  #
46
71
  add_param :package, Boolean, { :hidden_value => true }
47
72
 
73
+ ##
74
+ # Use a specific target, like apk-debug for Android or ipa-debug for iOS
75
+ #
76
+ add_param :target, String, { :delimiter => ' ' }
77
+
48
78
  ##
49
79
  # Set true to create a certificate.
50
80
  #
@@ -102,6 +132,11 @@ module FlashSDK
102
132
  #
103
133
  add_param :checkstore, String
104
134
 
135
+ ##
136
+ # Provisioning profile for iOS apps
137
+ #
138
+ add_param :provisioning_profile, String, { :delimiter => ' ' }
139
+
105
140
  ##
106
141
  # Expects two files:
107
142
  #
@@ -131,7 +131,7 @@ module FlashSDK
131
131
  # to get recreated with every run, instead of failing to
132
132
  # create when the outer folder still exists.
133
133
  def create_outer_task *args
134
- task *args do
134
+ Rake::Task.define_task *args do
135
135
  execute
136
136
  end
137
137
  end
@@ -735,8 +735,6 @@ module FlashSDK
735
735
  # The {#mxmlc} Rake task uses a Rake::File task under the covers, and
736
736
  # will automatically set this value with the string passed into the task name.
737
737
  #
738
- # This parameter should not be set directly within the task body.
739
- #
740
738
  add_param :output, File, { :file_task_name => true }
741
739
 
742
740
  ##
@@ -30,13 +30,14 @@ Sprout::Specification.new do |s|
30
30
  # end
31
31
  #
32
32
  s.name = 'flex4'
33
- s.version = '4.1.0.16076'
33
+ s.version = '4.5.0.20967'
34
34
 
35
35
  s.add_remote_file_target do |t|
36
36
  t.platform = :universal
37
37
  t.archive_type = :zip
38
- t.url = "http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16076.zip"
39
- t.md5 = "4c5f3d3fa4e1f5be244679210cd852c0"
38
+
39
+ t.url = "http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4.5/flex_sdk_4.5.0.20967.zip"
40
+ t.md5 = "c92b661eb7b00bb568262851885274dc"
40
41
 
41
42
  # Executables: (add .exe suffix if it was passed in)
42
43
  t.add_executable :aasdoc, "bin/aasdoc"
@@ -12,12 +12,15 @@ class FakeMXMLC
12
12
 
13
13
  def initialize args
14
14
  #puts ">> ARGS: #{args.inspect}"
15
- if(args.size == 2 &&
16
- args[0] == "-static-link-runtime-shared-libraries" &&
17
- args[1] == "test/fixtures/mxmlc/simple/SomeFile.as")
15
+ if(args.size == 3 &&
16
+ args[0].include?('SomeFile.swf') &&
17
+ args[1].include?('-static-link-runtime-shared-libraries') &&
18
+ args[2].include?('SomeFile.as'))
18
19
  compile_simple_swf args
19
20
  elsif args == ["-output=test/fixtures/air/simple/bin/SomeProject.swf", "-static-link-runtime-shared-libraries", "test/fixtures/air/simple/SomeProject.as"]
20
21
  compile_amxmlc_swf args
22
+ else
23
+ raise "Unexpected args sent to mxmlc stub #{args.join(', ')}"
21
24
  end
22
25
  end
23
26
 
@@ -33,7 +36,7 @@ class FakeMXMLC
33
36
  # Loading configuration file /Users/lbayes/Library/Sprouts/1.0/cache/flex4/4.1.0.16076/frameworks/flex-config.xml
34
37
  # /Users/lbayes/Projects/Sprouts/flashsdk/test/fixtures/mxmlc/simple/SomeFile.swf (558 bytes)
35
38
  def compile_simple_swf args
36
- path = File.expand_path(args[1].gsub(/\.as$/, '.swf'))
39
+ path = File.expand_path(args[0].gsub(/-output=/, ''))
37
40
  compile_swf path
38
41
  end
39
42
 
@@ -8,6 +8,8 @@ class ADLTest < Test::Unit::TestCase
8
8
  setup do
9
9
  @fixture = File.join 'test', 'fixtures', 'air', 'simple'
10
10
  @app_desc = File.join @fixture, 'SomeProject.xml'
11
+ @profile = 'mobileDevice'
12
+ @screensize = 'NexusOne'
11
13
  end
12
14
 
13
15
  teardown do
@@ -17,7 +19,9 @@ class ADLTest < Test::Unit::TestCase
17
19
  adl = FlashSDK::ADL.new
18
20
  adl.app_desc = @app_desc
19
21
  adl.root_dir = Dir.pwd
20
- assert_equal "#{@app_desc} #{Dir.pwd}", adl.to_shell
22
+ adl.screensize = @screensize
23
+ adl.profile = @profile
24
+ assert_equal "-profile #{@profile} -screensize #{@screensize} #{@app_desc} #{Dir.pwd}", adl.to_shell
21
25
  # Uncomment to actually launch
22
26
  # the AIR application:
23
27
  #adl.execute
@@ -9,10 +9,17 @@ class ADTTest < Test::Unit::TestCase
9
9
  @fixture = File.join 'test', 'fixtures', 'air', 'simple'
10
10
  @application_xml = File.join @fixture, 'SomeProject.xml'
11
11
  @expected_output = File.join @fixture, 'SomeProject.air'
12
+ @apk_input = File.join @fixture, 'SomeProject.apk'
13
+ @ipa_output = File.join @fixture, 'SomeProject.ipa'
12
14
  @swf_input = File.join @fixture, 'SomeProject.swf'
13
15
  @swf_main = File.join @fixture, 'SomeProject.mxml'
14
16
 
15
17
  @certificate = File.join @fixture, 'SomeProject.pfx'
18
+ @ipa_cert = File.join @fixture, 'SomeProject.p12'
19
+ @provisioning_profile = File.join @fixture, 'Profile.mobileprovision'
20
+ @platform = 'android'
21
+ @target = 'apk-debug'
22
+ @appid = 'com.foo.bar.SomeProject'
16
23
  @cert_password = 'samplePassword'
17
24
  end
18
25
 
@@ -25,6 +32,7 @@ class ADTTest < Test::Unit::TestCase
25
32
  as_a_unix_system do
26
33
  t = adt @expected_output do |t|
27
34
  t.package = true
35
+ t.target = @target
28
36
  t.package_input = @application_xml
29
37
  t.package_output = @expected_output
30
38
  t.storetype = 'PKCS12'
@@ -32,7 +40,70 @@ class ADTTest < Test::Unit::TestCase
32
40
  t.storepass = @cert_password
33
41
  t.included_files << @swf_input
34
42
  end
35
- 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
43
+ assert_equal "-package -target #{@target} -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
44
+
45
+ #t.execute
46
+ #assert_file @expected_output
47
+ end
48
+ end
49
+
50
+ should "package an iOS swf with a provisioning profile" do
51
+ as_a_unix_system do
52
+ t = adt @ipa_output do |t|
53
+ t.package = true
54
+ t.target = 'ipa-test'
55
+ t.package_input = @application_xml
56
+ t.package_output = @ipa_output
57
+ t.storetype = 'PKCS12'
58
+ t.keystore = @ipa_cert
59
+ t.storepass = @cert_password
60
+ t.provisioning_profile = @provisioning_profile
61
+ t.included_files << @swf_input
62
+ end
63
+ assert_equal "-package -target ipa-test -storetype PKCS12 -keystore #{@ipa_cert} -storepass #{@cert_password} -provisioning-profile #{@provisioning_profile} #{@ipa_output} #{@application_xml} #{@swf_input}", t.to_shell
64
+
65
+ #t.execute
66
+ #assert_file @expected_output
67
+ end
68
+ end
69
+
70
+ should "install an APK" do
71
+ as_a_unix_system do
72
+ t = adt @expected_output do |t|
73
+ t.installApp = true
74
+ t.platform = @platform
75
+ t.package = true
76
+ t.package_input = @apk_input
77
+ end
78
+ assert_equal "-installApp -platform #{@platform} -package #{@apk_input}", t.to_shell
79
+
80
+ #t.execute
81
+ #assert_file @expected_output
82
+ end
83
+ end
84
+
85
+ should "uninstall an APK" do
86
+ as_a_unix_system do
87
+ t = adt @expected_output do |t|
88
+ t.uninstallApp = true
89
+ t.platform = @platform
90
+ t.appid = @appid
91
+ end
92
+ assert_equal "-uninstallApp -platform #{@platform} -appid #{@appid}", t.to_shell
93
+
94
+ #t.execute
95
+ #assert_file @expected_output
96
+ end
97
+ end
98
+
99
+ should "launch an app" do
100
+ as_a_unix_system do
101
+ t = adt @expected_output do |t|
102
+ t.launchApp = true
103
+ t.platform = @platform
104
+ t.appid = @appid
105
+ end
106
+ assert_equal "-launchApp -platform #{@platform} -appid #{@appid}", t.to_shell
36
107
 
37
108
  #t.execute
38
109
  #assert_file @expected_output
@@ -14,6 +14,10 @@ class FCSHSocketTest < Test::Unit::TestCase
14
14
  @test_port = 12543
15
15
  end
16
16
 
17
+ teardown do
18
+ clear_tasks
19
+ end
20
+
17
21
  should "be instantiable" do
18
22
  service_ready = false
19
23
  # Create the remote side of the connection:
@@ -54,7 +54,7 @@ class TaskTest < Test::Unit::TestCase
54
54
  t = flashplayer :run do |t|
55
55
  t.input = @swf
56
56
  end
57
- file @swf
57
+ Rake::FileTask.define_task @swf
58
58
  configure_task t
59
59
  t.invoke
60
60
  assert_equal @swf, t.input
@@ -62,7 +62,7 @@ class TaskTest < Test::Unit::TestCase
62
62
 
63
63
  should "work with swf as prerequisite" do
64
64
  t = flashplayer :run => @swf
65
- file @swf
65
+ Rake::FileTask.define_task @swf
66
66
  configure_task t
67
67
  t.invoke
68
68
  assert_equal @swf, t.input
@@ -70,9 +70,9 @@ class TaskTest < Test::Unit::TestCase
70
70
 
71
71
  should "fire when declared as a dependency" do
72
72
  t = flashplayer :run => @swf
73
- file @swf
73
+ Rake::FileTask.define_task @swf
74
74
  configure_task t
75
- other = task :parent => :run
75
+ other = Rake::Task.define_task :parent => :run
76
76
  other.invoke
77
77
  end
78
78
  end
@@ -9,7 +9,7 @@ class MXMLCTest < Test::Unit::TestCase
9
9
  @original_use_fcsh_value = ENV['USE_FCSH']
10
10
  @fixture = File.join fixtures, 'mxmlc', 'simple'
11
11
  @input = File.join @fixture, 'SomeFile.as'
12
- @expected_output = File.join @fixture, 'SomeFile.swf'
12
+ @expected_output = File.join @fixture, "SomeFile.swf"
13
13
  end
14
14
 
15
15
  teardown do
@@ -17,6 +17,18 @@ class MXMLCTest < Test::Unit::TestCase
17
17
  ENV['USE_FCSH'] = @original_use_fcsh_value
18
18
  end
19
19
 
20
+ should "compile a swf" do
21
+ as_a_unix_system do
22
+ mxmlc = FlashSDK::MXMLC.new
23
+ # Comment out following line to use REAL Mxmlc:
24
+ mxmlc.binary_path = File.join fixtures, 'sdk', 'mxmlc'
25
+ mxmlc.input = @input
26
+ mxmlc.output = @expected_output
27
+ mxmlc.execute
28
+ assert_file @expected_output
29
+ end
30
+ end
31
+
20
32
  should "accept input" do
21
33
  as_a_unix_system do
22
34
  mxmlc = FlashSDK::MXMLC.new
@@ -26,14 +38,6 @@ class MXMLCTest < Test::Unit::TestCase
26
38
  end
27
39
  end
28
40
 
29
- should "compile a swf" do
30
- mxmlc = FlashSDK::MXMLC.new
31
- mxmlc.binary_path = File.join fixtures, 'sdk', 'mxmlc'
32
- mxmlc.input = @input
33
- mxmlc.execute
34
- assert_file @expected_output
35
- end
36
-
37
41
  should "assign default-size" do
38
42
  mxmlc = FlashSDK::MXMLC.new
39
43
  mxmlc.default_size = '800,500'
@@ -59,15 +63,5 @@ class MXMLCTest < Test::Unit::TestCase
59
63
  end
60
64
 
61
65
  end
62
-
63
- private
64
-
65
- def configure_mxmlc_fake exe_name
66
- # Comment the following and install the flashsdk
67
- # to run test against actual mxmlc:
68
- @fake = File.join(fixtures, 'mxmlc', exe_name)
69
- path_response = OpenStruct.new(:path => @fake)
70
- Sprout::Executable.expects(:load).with(:fdb, 'flex4', '>= 4.1.0.pre').returns path_response
71
- end
72
66
  end
73
67
 
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 27
8
+ - 28
9
9
  - pre
10
- version: 1.0.27.pre
10
+ version: 1.0.28.pre
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Bayes
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-29 00:00:00 -07:00
18
+ date: 2011-06-12 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -28,9 +28,9 @@ dependencies:
28
28
  segments:
29
29
  - 1
30
30
  - 1
31
- - 11
31
+ - 13
32
32
  - pre
33
- version: 1.1.11.pre
33
+ version: 1.1.13.pre
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: *id001
@@ -124,6 +124,7 @@ files:
124
124
  - POSTINSTALL.rdoc
125
125
  - rakefile.rb
126
126
  - README.textile
127
+ - test/fixtures/air/simple/SomeProject.apk
127
128
  - test/fixtures/air/simple/SomeProject.as
128
129
  - test/fixtures/air/simple/SomeProject.mxml
129
130
  - test/fixtures/air/simple/SomeProject.pfx