Class: FlashSDK::COMPC

Inherits:
CompilerBase show all
Defined in:
flashsdk/lib/flashsdk/compc.rb

Overview

The COMPC compiler is a tool that creates SWC libraries from source code.

Following is an example of the creation of a simple SWC file:

compc 'bin/SomeProject.swc' do |t|
  t.include_classes << 'SomeProject'
  t.source_path << 'src'
end

desc 'Compile the SWC'
task :swc => 'bin/SomeProject.swc'

Constant Summary

Constants included from Sprout::Executable

DEFAULT_FILE_EXPRESSION, DEFAULT_PREFIX, DEFAULT_SHORT_PREFIX

Instance Attribute Summary (collapse)

Method Summary

Methods inherited from CompilerBase

#execute, #execute_delegate, #execute_with_fcsh, #library_added, #prepare, #update_fcsh

Methods inherited from Sprout::Executable::Base

add_param, add_param_alias, #binary_path, #binary_path=, #create_outer_task, #default_file_expression, #execute, #execute_delegate, #from_hash, #initialize, #library_added, #parse!, #parse_extra_options!, #parse_rake_task_arg, #prepare, set, static_default_value_collection, static_parameter_collection, #stderr, #stderr=, #stdout, #stdout=, #system_execute, #to_hash, #to_help, #to_rake, #to_shell, #update_rake_task_name_from_args

Methods included from Sprout::Concern

#append_features, extended, #included

Constructor Details

This class inherits a constructor from Sprout::Executable::Base

Instance Attribute Details

- (Boolean) directory

Outputs the SWC content as a SWF into an open directory format rather than a SWC file.

This is especially useful for creating Runtime Shared Libraries.

compc "bin/rsls/foo" do |t|
  t.directory = true
  t.include_sources = 'src'
end

Returns:

  • (Boolean)

    An instance of Boolean

See Also:

  • Sprout::COMPC#include_sources


# File ''

add_param :directory, Boolean

- (Array<String>) include_classes

Specifies classes to include in the SWC file. You provide the class name (for example, MyClass) rather than the file name (for example, MyClass.as) to the file for this option. As a result, all classes specified with this option must be in the compiler's source path. You specify this by using the source-path compiler option.

You can use packaged and unpackaged classes. To use components in namespaces, use the include-namespaces option.

If the components are in packages, ensure that you use dot-notation rather than slashes to separate package levels.

This is the default option for the component compiler.

Returns:

  • (Array<String>)

    An instance of Array<String>



# File ''

add_param :include_classes, Strings

- (Array<String> [Files]) include_file

Adds the file to the SWC file. This option does not embed files inside the library.swf file. This is useful for skinning and theming, where you want to add non-compiled files that can be referenced in a style sheet or embedded as assets in MXML files.

If you use the [Embed] syntax to add a resource to your application, you are not required to use this option to also link it into the SWC file.

For more information, see Adding nonsource classes (livedocs.adobe.com/flex/201/html/compilers_123_39.html#158900).

Returns:

  • (Array<String> [Files])

    An instance of Array<String> [Files]



# File ''

add_param :include_file, Files

- (Boolean) include_lookup_only

An instance of Boolean

Returns:

  • (Boolean)

    An instance of Boolean



# File ''

add_param :include_lookup_only, Boolean

- (Array<String>) include_namespaces

Specifies namespace-style components in the SWC file. You specify a list of URIs to include in the SWC file. The uri argument must already be defined with the namespace option.

To use components in packages, use the include-classes option.

Returns:

  • (Array<String>)

    An instance of Array<String>



# File ''

add_param :include_namespaces, Strings

- (Array<String> [Files]) include_resource_bundles

Specifies the resource bundles to include in this SWC file. All resource bundles specified with this option must be in the compiler's source path. You specify this using the source-path compiler option.

For more information on using resource bundles, see Localizing Flex Applications (livedocs.adobe.com/flex/201/html/l10n_076_1.html#129288) in Flex 2 Developer's Guide.

Returns:

  • (Array<String> [Files])

    An instance of Array<String> [Files]



# File ''

add_param :include_resource_bundles, Files

- (Array<String> [Paths]) include_sources

Specifies classes or directories to add to the SWC file. When specifying classes, you specify the path to the class file (for example, MyClass.as) rather than the class name itself (for example, MyClass). This lets you add classes to the SWC file that are not in the source path. In general, though, use the include-classes option, which lets you add classes that are in the source path.

If you specify a directory, this option includes all files with an MXML or AS extension, and ignores all other files.

compc "bin/SomeProject.swc" do |t|
  t.include_sources << 'src'
  t.library_path << 'lib/somelib.swc'
end

You'll need to be sure your source path and library path are both set up properly for this work.

Returns:

  • (Array<String> [Paths])

    An instance of Array<String> [Paths]



# File ''

add_param :include_sources, Paths

- (String) input_class

Main source Class to send compiler. If used, this should be the last item in the list

Returns:

  • (String)

    An instance of String



# File ''

add_param :input_class, String, { :hidden_name => true }

- (String) namespace

Not sure about this option, it was in the CLI help, but not documented on the Adobe site

Returns:

  • (String)

    An instance of String



# File ''

add_param :namespace, String