Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #9 from apinstein/master

I fixed the compiler options that were set up wrong and caused them to not be executed.
  • Loading branch information...
commit f606a02f47023ec4181be755275ac4e82c21c7e4 2 parents 9fc726c + aac08ac
@lukebayes authored
View
2  VERSION
@@ -1 +1 @@
-1.0.29.pre
+1.0.31.pre
View
9 flashsdk.gemspec
@@ -1,9 +1,9 @@
# -*- encoding: utf-8 -*-
-lib = File.expand_path File.dirname(__FILE__), 'lib'
+lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'bundler'
-require 'flashsdk'
+require 'flashsdk/module.rb'
Gem::Specification.new do |s|
s.name = 'flashsdk'
@@ -15,8 +15,9 @@ Gem::Specification.new do |s|
s.description = "The Flash SDK Rubygem is brought to you by Project Sprouts (http://projectsprouts.org)"
s.executables = ['sprout-as3', 'sprout-flex', 'flashplayer', 'flashlog']
s.post_install_message = File.read 'POSTINSTALL.rdoc'
- s.files = FileList['**/**/*'].exclude /.git|.svn|.DS_Store/
- s.add_bundler_dependencies
+ s.files = Dir['**/*']
+ s.files.reject! { |fn| fn.match /.git|.svn|.DS_Store/ }
+ s.add_dependency('sprout', '>= 1.1.15.pre')
s.require_paths << 'lib'
end
View
63 lib/flashsdk/compiler_base.rb
@@ -53,8 +53,8 @@ class CompilerBase < Sprout::Executable::Base
# t.as3 = false
# end
#
- add_param :as3, Boolean, { :default => true, :show_on_false => true }
-
+ add_param :as3, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
+
##
# Prints detailed compile times to the standard output. The default value is true.
#
@@ -65,8 +65,8 @@ class CompilerBase < Sprout::Executable::Base
# t.benchmark = true
# end
#
- add_param :benchmark, Boolean, { :default => true, :show_on_false => true }
-
+ add_param :benchmark, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
+
##
# Sets the value of the {context.root} token in channel definitions in the flex-services.xml file. If you do not specify the value of this option, Flex uses an empty string.
#
@@ -718,7 +718,7 @@ class CompilerBase < Sprout::Executable::Base
#
# @see #debug
#
- add_param :optimize, Boolean
+ add_param :optimize, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
##
# Specifies the output path and filename for the resulting file.
@@ -823,7 +823,7 @@ class CompilerBase < Sprout::Executable::Base
# t.show_actionscript_warnings = false
# end
#
- add_param :show_actionscript_warnings, Boolean, { :default => true, :show_on_false => true }
+ add_param :show_actionscript_warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
##
# Shows a warning when Flash Player cannot detect changes to a bound property.
@@ -837,7 +837,36 @@ class CompilerBase < Sprout::Executable::Base
# t.show_binding_warnings = false
# end
#
- add_param :show_binding_warnings, Boolean, { :default => true, :show_on_false => true }
+ add_param :show_binding_warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
+
+ ##
+ # Shows warnings when you try to embed a font with a family name that is the same as the operating system font name.
+ # The compiler normally warns you that you are shadowing a system font. Set this option to false to disable the warnings.
+ #
+ # The default value is true.
+ #
+ # desc "Compile the Application"
+ # mxmlc 'bin/SomeProject.swf' do |t|
+ # t.input = 'src/SomeProject.mxml'
+ # t.source_path << 'src'
+ # t.show_shadowed_device_font_warnings = false
+ # end
+ #
+ add_param :show_shadowed_device_font_warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
+
+ ##
+ # Shows warnings when a type selector in a style sheet or <mx:Style> block is not used by any components in the application.
+ #
+ # The default value is true.
+ #
+ # desc "Compile the Application"
+ # mxmlc 'bin/SomeProject.swf' do |t|
+ # t.input = 'src/SomeProject.mxml'
+ # t.source_path << 'src'
+ # t.show_unused_type_selector_warnings = false
+ # end
+ #
+ add_param :show_unused_type_selector_warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
##
# Shows deprecation warnings for Flex components. To see warnings for ActionScript classes, use the show-actionscript-warnings option.
@@ -882,9 +911,14 @@ class CompilerBase < Sprout::Executable::Base
##
# Statically link the libraries specified by the {#runtime_shared_libraries} option.
#
+ # Default changed to false in Flex 4: http://opensource.adobe.com/wiki/display/flexsdk/Linking+RSLs+by+Default
+ #
+ # We respect this new default.
+ #
# @see #runtime_shared_libraries
#
- add_param :static_link_runtime_shared_libraries, Boolean, { :default => true }
+ add_param :static_link_runtime_shared_libraries, Boolean, { :default => false, :hidden_value => false, :delimiter => '=' }
+
##
# Alias for {#static_link_runtime_shared_libraries}
@@ -905,7 +939,7 @@ class CompilerBase < Sprout::Executable::Base
# t.strict = false
# end
#
- add_param :strict, Boolean, { :default => true, :show_on_false => true }
+ add_param :strict, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
##
# Specifies the version of the player the application is targeting.
@@ -945,7 +979,14 @@ class CompilerBase < Sprout::Executable::Base
# with file: URLs) but not network services. In most circumstances, the
# value of this property should be true.
#
- add_param :use_network, Boolean, { :default => true, :show_on_false => true }
+ add_param :use_network, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
+
+ ##
+ # Enables resource bundles. Set to true to instruct the compiler to process the contents of the [ResourceBundle] metadata tag.
+ #
+ # The default value is true.
+ #
+ add_param :use_resource_bundle_metadata, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
##
# Generates source code that includes source files and line numbers. When
@@ -974,7 +1015,7 @@ class CompilerBase < Sprout::Executable::Base
#
# The default value is true.
#
- add_param :warnings, Boolean
+ add_param :warnings, Boolean, { :default => true, :show_on_false => true, :hidden_value => false, :delimiter => '=' }
##
# Set to true in order to compile with the Flex Compiler Shell (FCSH).
View
7 test/fixtures/sdk/mxmlc
@@ -12,12 +12,11 @@ class FakeMXMLC
def initialize args
#puts ">> ARGS: #{args.inspect}"
- if(args.size == 3 &&
+ if(args.size == 2 &&
args[0].include?('SomeFile.swf') &&
- args[1].include?('-static-link-runtime-shared-libraries') &&
- args[2].include?('SomeFile.as'))
+ args[1].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"]
+ elsif args == ["-output=test/fixtures/air/simple/bin/SomeProject.swf", "test/fixtures/air/simple/SomeProject.as"]
compile_amxmlc_swf args
else
raise "Unexpected args sent to mxmlc stub #{args.join(', ')}"
View
2  test/unit/acompc_test.rb
@@ -20,7 +20,7 @@ class ACOMPCTest < Test::Unit::TestCase
compc = FlashSDK::ACOMPC.new
compc.output = @expected_output
compc.include_sources << @fixture
- assert_equal '--output=test/fixtures/acompc/simple/SomeAirFile.swc --static-link-runtime-shared-libraries --include-sources+=test/fixtures/acompc/simple', compc.to_shell
+ assert_equal '--output=test/fixtures/acompc/simple/SomeAirFile.swc --include-sources+=test/fixtures/acompc/simple', compc.to_shell
end
end
View
5 test/unit/amxmlc_test.rb
@@ -20,7 +20,7 @@ class AMXMLCTest < Test::Unit::TestCase
amxmlc = FlashSDK::AMXMLC.new
amxmlc.input = @input
amxmlc.source_path << @fixture
- assert_equal '-source-path+=test/fixtures/air/simple -static-link-runtime-shared-libraries test/fixtures/air/simple/SomeProject.as', amxmlc.to_shell
+ assert_equal '-source-path+=test/fixtures/air/simple test/fixtures/air/simple/SomeProject.as', amxmlc.to_shell
end
end
@@ -39,7 +39,6 @@ class AMXMLCTest < Test::Unit::TestCase
should "assign default-size" do
amxmlc = FlashSDK::AMXMLC.new
amxmlc.default_size = '800,500'
- amxmlc.static_link_runtime_shared_libraries = false
assert_equal '-default-size=800,500', amxmlc.to_shell
end
@@ -48,7 +47,7 @@ class AMXMLCTest < Test::Unit::TestCase
t = amxmlc 'bin/SomeProject.swf' do |t|
t.input = @input
end
- assert_equal '-output=bin/SomeProject.swf -static-link-runtime-shared-libraries test/fixtures/air/simple/SomeProject.as', t.to_shell
+ assert_equal '-output=bin/SomeProject.swf test/fixtures/air/simple/SomeProject.as', t.to_shell
end
end
end
View
2  test/unit/compc_test.rb
@@ -20,7 +20,7 @@ class COMPCTest < Test::Unit::TestCase
compc = FlashSDK::COMPC.new
compc.output = @expected_output
compc.include_sources << @fixture
- assert_equal '--output=test/fixtures/compc/simple/SomeFile.swc --static-link-runtime-shared-libraries --include-sources+=test/fixtures/compc/simple', compc.to_shell
+ assert_equal '--output=test/fixtures/compc/simple/SomeFile.swc --include-sources+=test/fixtures/compc/simple', compc.to_shell
end
end
View
213 test/unit/flex_compiler_options_test.rb
@@ -0,0 +1,213 @@
+require 'test_helper'
+
+class FlexCompilerOptionsTest < Test::Unit::TestCase
+ include Sprout::TestHelper
+
+ # formal tests for a variety of Flex compiler options and how they should appear on the CLI based on true/false settings
+ context "A Flex compiler's options" do
+
+ setup do
+ @mxmlc = FlashSDK::MXMLC.new
+ end
+
+ teardown do
+ end
+
+ # -as3
+ should "default to as3=true" do
+ assert_equal true, @mxmlc.as3
+ end
+
+ should "not include a -as3 flag if :as3 is set to true" do
+ @mxmlc.as3 = true
+ assert_no_match /-as3/, @mxmlc.to_shell
+ end
+
+ should "include -as3=false flag if :as3 is set to false" do
+ @mxmlc.as3 = false
+ assert_equal '-as3=false', @mxmlc.to_shell
+ end
+
+ # -benchmark
+ should "default to benchmark=true" do
+ assert_equal true, @mxmlc.benchmark
+ end
+
+ should "not include a -benchmark flag if :benchmark is set to true" do
+ @mxmlc.benchmark = true
+ assert_no_match /-benchmark/, @mxmlc.to_shell
+ end
+
+ should "include -benchmark=false flag if :benchmark is set to false" do
+ @mxmlc.benchmark = false
+ assert_equal '-benchmark=false', @mxmlc.to_shell
+ end
+
+ # -debug
+ should "default to debug=false" do
+ assert_equal false, @mxmlc.debug
+ end
+
+ should "not include a -debug flag if :debug is set to false" do
+ assert_no_match /-debug/, @mxmlc.to_shell
+ end
+
+ should "include -debug flag if :debug is set to true" do
+ @mxmlc.debug = true
+ assert_equal '-debug', @mxmlc.to_shell
+ end
+
+ # -use-network
+ should "default to use_network=false" do
+ assert_equal true, @mxmlc.use_network
+ end
+
+ should "not include a -use-network flag if :use_network is set to true" do
+ @mxmlc.use_network = true
+ assert_no_match /-use-network/, @mxmlc.to_shell
+ end
+
+ should "include -use-network=false flag if :use_network is set to false" do
+ @mxmlc.use_network = false
+ assert_equal '-use-network=false', @mxmlc.to_shell
+ end
+
+ # -optimize
+ should "default to optimize=true" do
+ assert_equal true, @mxmlc.optimize
+ end
+
+ should "not include a -optimize flag if :optimize is set to true" do
+ @mxmlc.optimize = true
+ assert_no_match /-optimize/, @mxmlc.to_shell
+ end
+
+ should "include -optimize=false flag if :optimize is set to false" do
+ @mxmlc.optimize = false
+ assert_equal '-optimize=false', @mxmlc.to_shell
+ end
+
+ # -show-actionscript-warnings
+ should "default to show-actionscript-warnings=true" do
+ assert_equal true, @mxmlc.show_actionscript_warnings
+ end
+
+ should "not include a -show-actionscript-warnings flag if :show-actionscript-warnings is set to true" do
+ @mxmlc.show_actionscript_warnings = true
+ assert_no_match /-show-actionscript-warnings/, @mxmlc.to_shell
+ end
+
+ should "include -show-actionscript-warnings=false flag if :show-actionscript-warnings is set to false" do
+ @mxmlc.show_actionscript_warnings = false
+ assert_equal '-show-actionscript-warnings=false', @mxmlc.to_shell
+ end
+
+ # -show-binding-warnings
+ should "default to show-binding-warnings=true" do
+ assert_equal true, @mxmlc.show_binding_warnings
+ end
+
+ should "not include a -show-binding-warnings flag if :show-binding-warnings is set to true" do
+ @mxmlc.show_binding_warnings = true
+ assert_no_match /-show-binding-warnings/, @mxmlc.to_shell
+ end
+
+ should "include -show-binding-warnings=false flag if :show-binding-warnings is set to false" do
+ @mxmlc.show_binding_warnings = false
+ assert_equal '-show-binding-warnings=false', @mxmlc.to_shell
+ end
+
+ # -show-shadowed-device-font-warnings
+ should "default to show-shadowed-device-font-warnings=true" do
+ assert_equal true, @mxmlc.show_shadowed_device_font_warnings
+ end
+
+ should "not include a -show-shadowed-device-font-warnings flag if :show-shadowed-device-font-warnings is set to true" do
+ @mxmlc.show_shadowed_device_font_warnings = true
+ assert_no_match /-show-shadowed-device-font-warnings/, @mxmlc.to_shell
+ end
+
+ should "include -show-shadowed-device-font-warnings=false flag if :show-shadowed-device-font-warnings is set to false" do
+ @mxmlc.show_shadowed_device_font_warnings = false
+ assert_equal '-show-shadowed-device-font-warnings=false', @mxmlc.to_shell
+ end
+
+ # -show-unused-type-selector-warnings
+ should "default to show-unused-type-selector-warnings=true" do
+ assert_equal true, @mxmlc.show_unused_type_selector_warnings
+ end
+
+ should "not include a -show-unused-type-selector-warnings flag if :show-unused-type-selector-warnings is set to true" do
+ @mxmlc.show_unused_type_selector_warnings = true
+ assert_no_match /-show-unused-type-selector-warnings/, @mxmlc.to_shell
+ end
+
+ should "include -show-unused-type-selector-warnings=false flag if :show-unused-type-selector-warnings is set to false" do
+ @mxmlc.show_unused_type_selector_warnings = false
+ assert_equal '-show-unused-type-selector-warnings=false', @mxmlc.to_shell
+ end
+
+ # -static-link-runtime-shared-libraries
+ should "default to static-link-runtime-shared-libraries=false" do
+ assert_equal false, @mxmlc.static_link_runtime_shared_libraries
+ end
+
+ should "include a -static-link-runtime-shared-libraries=true flag if :static-link-runtime-shared-libraries is set to true" do
+ @mxmlc.static_link_runtime_shared_libraries = true
+ assert_equal '-static-link-runtime-shared-libraries=true', @mxmlc.to_shell
+ end
+
+ should "not include -static-link-runtime-shared-libraries=false flag if :static-link-runtime-shared-libraries is set to false" do
+ @mxmlc.static_link_runtime_shared_libraries = false
+ assert_no_match /-static-link-runtime-shared-libraries/, @mxmlc.to_shell
+ end
+
+ # -strict
+ should "default to strict=true" do
+ assert_equal true, @mxmlc.strict
+ end
+
+ should "not include a -strict flag if :strict is set to true" do
+ @mxmlc.strict = true
+ assert_no_match /-strict/, @mxmlc.to_shell
+ end
+
+ should "include -strict=false flag if :strict is set to false" do
+ @mxmlc.strict = false
+ assert_equal '-strict=false', @mxmlc.to_shell
+ end
+
+ # -use-resource-bundle-metadata
+ should "default to use-resource-bundle-metadata=true" do
+ assert_equal true, @mxmlc.use_resource_bundle_metadata
+ end
+
+ should "not include a -use-resource-bundle-metadata flag if :use-resource-bundle-metadata is set to true" do
+ @mxmlc.use_resource_bundle_metadata = true
+ assert_no_match /-use-resource-bundle-metadata/, @mxmlc.to_shell
+ end
+
+ should "include -use-resource-bundle-metadata=false flag if :use-resource-bundle-metadata is set to false" do
+ @mxmlc.use_resource_bundle_metadata = false
+ assert_equal '-use-resource-bundle-metadata=false', @mxmlc.to_shell
+ end
+
+ # -warnings
+ should "default to warnings=true" do
+ assert_equal true, @mxmlc.warnings
+ end
+
+ should "not include a -warnings flag if :warnings is set to true" do
+ @mxmlc.warnings = true
+ assert_no_match /-warnings/, @mxmlc.to_shell
+ end
+
+ should "include -warnings=false flag if :warnings is set to false" do
+ @mxmlc.warnings = false
+ assert_equal '-warnings=false', @mxmlc.to_shell
+ end
+
+
+ end
+end
+
View
3  test/unit/mxmlc_test.rb
@@ -34,14 +34,13 @@ class MXMLCTest < Test::Unit::TestCase
mxmlc = FlashSDK::MXMLC.new
mxmlc.input = 'test/fixtures/mxmlc/simple/SomeFile.as'
mxmlc.source_path << 'test/fixtures/mxmlc/simple'
- assert_equal '-source-path+=test/fixtures/mxmlc/simple -static-link-runtime-shared-libraries test/fixtures/mxmlc/simple/SomeFile.as', mxmlc.to_shell
+ assert_equal '-source-path+=test/fixtures/mxmlc/simple test/fixtures/mxmlc/simple/SomeFile.as', mxmlc.to_shell
end
end
should "assign default-size" do
mxmlc = FlashSDK::MXMLC.new
mxmlc.default_size = '800,500'
- mxmlc.static_link_runtime_shared_libraries = false
assert_equal '-default-size=800,500', mxmlc.to_shell
end
Please sign in to comment.
Something went wrong with that request. Please try again.