Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'rake-update'

  • Loading branch information...
commit 1190f198261b2ee456ab07a35e87564423560471 2 parents 37898db + 218fc45
@lukebayes authored
View
2  Gemfile
@@ -1,6 +1,6 @@
source "http://rubygems.org"
-gem 'sprout', '>= 1.1.11.pre'
+gem 'sprout', '>= 1.1.13.pre'
group :development do
gem "shoulda"
View
2  VERSION
@@ -1 +1 @@
-1.0.27.pre
+1.0.28.pre
View
1  lib/flashsdk.rb
@@ -3,6 +3,7 @@
lib = File.expand_path File.dirname(__FILE__)
$:.unshift lib unless $:.include?(lib)
+require 'rake/dsl'
require 'benchmark'
require 'flashsdk/module'
require 'flashsdk/generators/flash_helper'
View
2  lib/flashsdk/asdoc.rb
@@ -131,7 +131,7 @@ def execute
# to get recreated with every run, instead of failing to
# create when the outer folder still exists.
def create_outer_task *args
- task *args do
+ Rake::Task.define_task *args do
execute
end
end
View
2  lib/flashsdk/compiler_base.rb
@@ -735,8 +735,6 @@ class CompilerBase < Sprout::Executable::Base
# The {#mxmlc} Rake task uses a Rake::File task under the covers, and
# will automatically set this value with the string passed into the task name.
#
- # This parameter should not be set directly within the task body.
- #
add_param :output, File, { :file_task_name => true }
##
View
11 test/fixtures/sdk/mxmlc
@@ -12,12 +12,15 @@ class FakeMXMLC
def initialize args
#puts ">> ARGS: #{args.inspect}"
- if(args.size == 2 &&
- args[0] == "-static-link-runtime-shared-libraries" &&
- args[1] == "test/fixtures/mxmlc/simple/SomeFile.as")
+ if(args.size == 3 &&
+ args[0].include?('SomeFile.swf') &&
+ args[1].include?('-static-link-runtime-shared-libraries') &&
+ args[2].include?('SomeFile.as'))
compile_simple_swf args
elsif args == ["-output=test/fixtures/air/simple/bin/SomeProject.swf", "-static-link-runtime-shared-libraries", "test/fixtures/air/simple/SomeProject.as"]
compile_amxmlc_swf args
+ else
+ raise "Unexpected args sent to mxmlc stub #{args.join(', ')}"
end
end
@@ -33,7 +36,7 @@ class FakeMXMLC
# Loading configuration file /Users/lbayes/Library/Sprouts/1.0/cache/flex4/4.1.0.16076/frameworks/flex-config.xml
# /Users/lbayes/Projects/Sprouts/flashsdk/test/fixtures/mxmlc/simple/SomeFile.swf (558 bytes)
def compile_simple_swf args
- path = File.expand_path(args[1].gsub(/\.as$/, '.swf'))
+ path = File.expand_path(args[0].gsub(/-output=/, ''))
compile_swf path
end
View
4 test/unit/fcsh_socket_test.rb
@@ -14,6 +14,10 @@ class FCSHSocketTest < Test::Unit::TestCase
@test_port = 12543
end
+ teardown do
+ clear_tasks
+ end
+
should "be instantiable" do
service_ready = false
# Create the remote side of the connection:
View
8 test/unit/flashplayer_task_test.rb
@@ -54,7 +54,7 @@ class TaskTest < Test::Unit::TestCase
t = flashplayer :run do |t|
t.input = @swf
end
- file @swf
+ Rake::FileTask.define_task @swf
configure_task t
t.invoke
assert_equal @swf, t.input
@@ -62,7 +62,7 @@ class TaskTest < Test::Unit::TestCase
should "work with swf as prerequisite" do
t = flashplayer :run => @swf
- file @swf
+ Rake::FileTask.define_task @swf
configure_task t
t.invoke
assert_equal @swf, t.input
@@ -70,9 +70,9 @@ class TaskTest < Test::Unit::TestCase
should "fire when declared as a dependency" do
t = flashplayer :run => @swf
- file @swf
+ Rake::FileTask.define_task @swf
configure_task t
- other = task :parent => :run
+ other = Rake::Task.define_task :parent => :run
other.invoke
end
end
View
32 test/unit/mxmlc_test.rb
@@ -9,7 +9,7 @@ class MXMLCTest < Test::Unit::TestCase
@original_use_fcsh_value = ENV['USE_FCSH']
@fixture = File.join fixtures, 'mxmlc', 'simple'
@input = File.join @fixture, 'SomeFile.as'
- @expected_output = File.join @fixture, 'SomeFile.swf'
+ @expected_output = File.join @fixture, "SomeFile.swf"
end
teardown do
@@ -17,6 +17,18 @@ class MXMLCTest < Test::Unit::TestCase
ENV['USE_FCSH'] = @original_use_fcsh_value
end
+ should "compile a swf" do
+ as_a_unix_system do
+ mxmlc = FlashSDK::MXMLC.new
+ # Comment out following line to use REAL Mxmlc:
+ mxmlc.binary_path = File.join fixtures, 'sdk', 'mxmlc'
+ mxmlc.input = @input
+ mxmlc.output = @expected_output
+ mxmlc.execute
+ assert_file @expected_output
+ end
+ end
+
should "accept input" do
as_a_unix_system do
mxmlc = FlashSDK::MXMLC.new
@@ -26,14 +38,6 @@ class MXMLCTest < Test::Unit::TestCase
end
end
- should "compile a swf" do
- mxmlc = FlashSDK::MXMLC.new
- mxmlc.binary_path = File.join fixtures, 'sdk', 'mxmlc'
- mxmlc.input = @input
- mxmlc.execute
- assert_file @expected_output
- end
-
should "assign default-size" do
mxmlc = FlashSDK::MXMLC.new
mxmlc.default_size = '800,500'
@@ -59,15 +63,5 @@ class MXMLCTest < Test::Unit::TestCase
end
end
-
- private
-
- def configure_mxmlc_fake exe_name
- # Comment the following and install the flashsdk
- # to run test against actual mxmlc:
- @fake = File.join(fixtures, 'mxmlc', exe_name)
- path_response = OpenStruct.new(:path => @fake)
- Sprout::Executable.expects(:load).with(:fdb, 'flex4', '>= 4.1.0.pre').returns path_response
- end
end
Please sign in to comment.
Something went wrong with that request. Please try again.