Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

acompc #6

Merged
merged 4 commits into from

2 participants

@simongregory

The acompc executable is now linked and working from rake.

Additionally I have bumped the FlexSDK up to 4.5.1.21328

simongregory added some commits
@simongregory simongregory Upgrading to use Flex SDK 4.5.1.21328 e9c48ba
@simongregory simongregory Merge branch 'lb-master' 65ec8c6
@simongregory simongregory Created an executable wrapper for the acompc tool. d07ce8c
@simongregory simongregory • Adding file options.
This means it is now possible to define a sequence of directories, and the files they contain,
to be included in the packaging task.
4005c60
@lukebayes lukebayes merged commit 9fc726c into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 25, 2011
  1. @simongregory
  2. @simongregory

    Merge branch 'lb-master'

    simongregory authored
Commits on Jun 28, 2011
  1. @simongregory
Commits on Jun 29, 2011
  1. @simongregory

    • Adding file options.

    simongregory authored
    This means it is now possible to define a sequence of directories, and the files they contain,
    to be included in the packaging task.
This page is out of date. Refresh to see the latest.
View
1  lib/flashsdk.rb
@@ -15,6 +15,7 @@
require 'flashsdk/asdoc'
require 'flashsdk/mxmlc'
require 'flashsdk/compc'
+require 'flashsdk/acompc'
require 'flashsdk/amxmlc'
require 'flashsdk/adt'
require 'flashsdk/adl'
View
29 lib/flashsdk/acompc.rb
@@ -0,0 +1,29 @@
+module FlashSDK
+
+ ##
+ # The ACOMPC tool is a wrapper for the acompc tool.
+ #
+ class ACOMPC < COMPC
+
+ ##
+ # The default executable target.
+ #
+ set :executable, :acompc
+
+ ##
+ # TODO: Remove this method once this bug is fixed:
+ # http://www.pivotaltracker.com/story/show/4194771
+ #
+ def execute *args
+ self.executable = :acompc
+ super
+ end
+ end
+end
+
+def acompc args, &block
+ exe = FlashSDK::ACOMPC.new
+ exe.to_rake(args, &block)
+ exe
+end
+
View
16 lib/flashsdk/adt.rb
@@ -228,6 +228,21 @@ class ADT < Sprout::Executable::Base
# they will not be included.
#
add_param :included_paths, Paths, { :hidden_name => true }
+
+ ##
+ # Allows file options in the form of -C <dir> <fileOrDir>+
+ #
+ # For example if you defined:
+ #
+ # t.file_options << 'dir path/to/asset.xml'
+ #
+ # In your adt task defintion, then:
+ #
+ # -C dir path/to/asset.xml
+ #
+ # Would be appended to your arguments.
+ #
+ add_param :file_options, Strings, { :shell_name => '-C', :delimiter => ' ' }
##
# The the Ruby file that will load the expected
@@ -258,4 +273,3 @@ def adt *args, &block
exe.to_rake(*args, &block)
exe
end
-
View
9 lib/flex4.rb
@@ -30,14 +30,13 @@
# end
#
s.name = 'flex4'
- s.version = '4.5.0.20967'
+ s.version = '4.5.1.21328'
s.add_remote_file_target do |t|
t.platform = :universal
t.archive_type = :zip
-
- t.url = "http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4.5/flex_sdk_4.5.0.20967.zip"
- t.md5 = "c92b661eb7b00bb568262851885274dc"
+ t.url = "http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4.5/flex_sdk_4.5.1.21328.zip"
+ t.md5 = "55a59986092195a88cfe7b5796ec8619"
# Executables: (add .exe suffix if it was passed in)
t.add_executable :aasdoc, "bin/aasdoc"
@@ -81,5 +80,3 @@
end
end
end
-
-
View
11 test/fixtures/acompc/simple/SomeAirFile.as
@@ -0,0 +1,11 @@
+package {
+ import flash.display.Sprite;
+
+ public class SomeAirFile extends Sprite {
+
+ public function SomeAirFile() {
+ trace(">> SomeFile instantiated");
+ }
+ }
+}
+
View
37 test/unit/acompc_test.rb
@@ -0,0 +1,37 @@
+require 'test_helper'
+
+class ACOMPCTest < Test::Unit::TestCase
+ include Sprout::TestHelper
+
+ context "An ACOMPC tool" do
+
+ setup do
+ @fixture = File.join 'test', 'fixtures', 'acompc', 'simple'
+ @input = File.join @fixture, 'SomeAirFile.as'
+ @expected_output = File.join @fixture, 'SomeAirFile.swc'
+ end
+
+ teardown do
+ remove_file @expected_output
+ end
+
+ should "accept input" do
+ as_a_unix_system do
+ 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
+ end
+ end
+
+ should "compile a swc" do
+ compc = FlashSDK::ACOMPC.new
+ compc.include_sources << @fixture
+ compc.output = @expected_output
+ compc.execute
+ assert_file @expected_output
+ end
+
+ end
+end
+
View
20 test/unit/adt_test.rb
@@ -45,6 +45,26 @@ class ADTTest < Test::Unit::TestCase
#assert_file @expected_output
end
end
+
+ should "package a SWF and complex assets with an application.xml" do
+ as_a_unix_system do
+ t = adt @expected_output do |t|
+ t.package = true
+ t.target = @target
+ t.package_input = @application_xml
+ t.package_output = @expected_output
+ t.storetype = 'PKCS12'
+ t.keystore = @certificate
+ t.storepass = @cert_password
+ t.included_files << @swf_input
+ t.file_options << 'bin path/to/asset.xml'
+ end
+ 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 -C bin path/to/asset.xml", t.to_shell
+
+ #t.execute
+ #assert_file @expected_output
+ end
+ end
should "package an iOS swf with a provisioning profile" do
as_a_unix_system do
Something went wrong with that request. Please try again.