Skip to main content

Tasks

AIR provides a series of Ant tasks for each of the main commands used when compiling and packaging actionscript code and AIR applications.

These tasks are made available to your ant script by using the taskdef pointed to the AIR SDK as follows:

<taskdef resource="flexTasks.tasks" classpath="${env.AIR_HOME}/ant"/>

This makes the following tasks available

  • mxmlc: actionscript/mxml compiler for generating swf files;
  • compc: actionscript component compiler, for generating swc libraries;
  • asdoc: ASDoc documentation generator;
  • adt and adl: AIR developer tool and the AIR debug launcher via an exec task.

mxmlc

The mxmlc task gives you access to a task that implements all of the features of the mxmlc command for compiling as (AS3) and mxml files into a swf.

For example:

<mxmlc file="src/Main.as" output="output.swf">
<source-path path-element="src"/>
<source-path path-element="${AIR_HOME}/frameworks"/>
</mxmlc>

The tags for the mxmlc task align with the parameters for the mxmlc command line utility. You can see these by running mxmlc -help list (or mxmlc -help advanced) on the command line.

mxmlc parameter list

$ mxmlc -help advanced
Adobe ActionScript Compiler (mxmlc)
Version 2.0.0 build 1234
Copyright 2004-2012 Adobe Systems Incorporated. All rights reserved.

-advanced-telemetry
-advanced-telemetry-password <string>
-compiler.accessible
-compiler.actionscript-file-encoding <string>
-compiler.allow-source-path-overlap
-compiler.as3
-compiler.compress
-compiler.context-root <context-path>
-compiler.debug
-compiler.defaults-css-files [filename] [...]
-compiler.defaults-css-url <string>
-compiler.define <name> <value>
-compiler.enable-runtime-design-layers
-compiler.es
-compiler.external-library-path [path-element] [...]
-compiler.fonts.advanced-anti-aliasing
-compiler.fonts.languages.language-range <lang> <range>
-compiler.fonts.local-font-paths [path-element] [...]
-compiler.fonts.local-fonts-snapshot <string>
-compiler.fonts.managers [manager-class] [...]
-compiler.fonts.max-cached-fonts <string>
-compiler.fonts.max-glyphs-per-face <string>
-compiler.headless-server
-compiler.include-libraries [library] [...]
-compiler.inline
-compiler.isolate-styles
-compiler.keep-all-type-selectors
-compiler.keep-as3-metadata [name] [...]
-compiler.library-path [path-element] [...]
-compiler.locale [locale-element] [...]
-compiler.minimum-supported-version <string>
-compiler.mobile
-compiler.mxml.compatibility-version <version>
-compiler.mxml.minimum-supported-version <string>
-compiler.namespaces.namespace [uri] [manifest] [...]
-compiler.omit-trace-statements
-compiler.optimize
-compiler.preloader <string>
-compiler.remove-dead-code
-compiler.report-invalid-styles-as-warnings
-compiler.report-missing-required-skin-parts-as-warnings
-compiler.services <filename>
-compiler.show-actionscript-warnings
-compiler.show-binding-warnings
-compiler.show-invalid-css-property-warnings
-compiler.show-multiple-definition-warnings
-compiler.show-shadowed-device-font-warnings
-compiler.show-unused-type-selector-warnings
-compiler.source-path [path-element] [...]
-compiler.strict
-compiler.theme [filename] [...]
-compiler.verbose-stacktraces
-compiler.warn-array-tostring-changes
-compiler.warn-assignment-within-conditional
-compiler.warn-bad-array-cast
-compiler.warn-bad-bool-assignment
-compiler.warn-bad-date-cast
-compiler.warn-bad-es3-type-method
-compiler.warn-bad-es3-type-prop
-compiler.warn-bad-nan-comparison
-compiler.warn-bad-null-assignment
-compiler.warn-bad-null-comparison
-compiler.warn-bad-undefined-comparison
-compiler.warn-boolean-constructor-with-no-args
-compiler.warn-changes-in-resolve
-compiler.warn-class-is-sealed
-compiler.warn-const-not-initialized
-compiler.warn-constructor-returns-value
-compiler.warn-deprecated-event-handler-error
-compiler.warn-deprecated-function-error
-compiler.warn-deprecated-property-error
-compiler.warn-duplicate-argument-names
-compiler.warn-duplicate-variable-def
-compiler.warn-for-var-in-changes
-compiler.warn-import-hides-class
-compiler.warn-instance-of-changes
-compiler.warn-internal-error
-compiler.warn-level-not-supported
-compiler.warn-missing-namespace-decl
-compiler.warn-negative-uint-literal
-compiler.warn-no-constructor
-compiler.warn-no-explicit-super-call-in-constructor
-compiler.warn-no-type-decl
-compiler.warn-number-from-string-changes
-compiler.warn-scoping-change-in-this
-compiler.warn-slow-text-field-addition
-compiler.warn-unlikely-function-value
-compiler.warn-xml-class-has-changed
-debug-password <string>
-default-background-color <int>
-default-frame-rate <int>
-default-script-limits <max-recursion-depth> <max-execution-time>
-default-size <width> <height>
-dependency-graph <filename>
-dump-config <filename>
-error-problems [class] [...]
-externs [symbol] [...]
-frames.frame [label] [classname] [...]
-help [keyword] [...]
-ignore-problems [class] [...]
-include-inheritance-dependencies-only
-include-resource-bundles [bundle] [...]
-includes [symbol] [...]
-link-report <filename>
-load-config <filename>
-load-externs <filename>
-metadata.contributor <name>
-metadata.creator <name>
-metadata.date <text>
-metadata.description <text>
-metadata.language <code>
-metadata.localized-description <text> <lang>
-metadata.localized-title <title> <lang>
-metadata.publisher <name>
-metadata.title <text>
-output <filename>
-raw-metadata <text>
-remove-unused-rsls
-resource-bundle-list <filename>
-runtime-shared-libraries [url] [...]
-runtime-shared-library-path [path-element] [rsl-url] [policy-file-url] [rsl-url] [policy-file-url]
-runtime-shared-library-settings.application-domain [path-element] [application-domain-target] [...]
-runtime-shared-library-settings.force-rsls [path-element] [...]
-single-thread
-size-report <filename>
-static-link-runtime-shared-libraries
-swf-version <int>
-target-player <version>
-tools-locale <string>
-use-direct-blit
-use-gpu
-use-network
-verify-digests
-version
-warning-problems [class] [...]
-warnings

To describe one of these parameters in detail you can call mxmlc -help <parameter>, eg:

$ mxmlc -help use-network
Adobe ActionScript Compiler (mxmlc)
Version 2.0.0 build 1234
Copyright 2004-2012 Adobe Systems Incorporated. All rights reserved.

-use-network
toggle whether the SWF is flagged for access to network resources

compc

The compc (component compiler) task is used to generate swc component libraries from source code and asset files (such as images, css etc).

For example:

<compc output="output.swc">
<source-path path-element="src"/>
<include-sources dir="src" includes="*"/>
</compc>

The tags for the compc task align with the parameters for the compc command line utility. You can see these by running compc -help list (or compc -help advanced) on the command line.

compc parameter list

$ compc -help advanced
Adobe SWC Component Compiler (compc)
Version 2.0.0 build 1234
Copyright 2004-2012 Adobe Systems Incorporated. All rights reserved.

-advanced-telemetry
-advanced-telemetry-password <string>
-compiler.accessible
-compiler.actionscript-file-encoding <string>
-compiler.allow-source-path-overlap
-compiler.as3
-compiler.compress
-compiler.context-root <context-path>
-compiler.debug
-compiler.defaults-css-files [filename] [...]
-compiler.defaults-css-url <string>
-compiler.define <name> <value>
-compiler.enable-runtime-design-layers
-compiler.es
-compiler.external-library-path [path-element] [...]
-compiler.fonts.advanced-anti-aliasing
-compiler.fonts.languages.language-range <lang> <range>
-compiler.fonts.local-font-paths [path-element] [...]
-compiler.fonts.local-fonts-snapshot <string>
-compiler.fonts.managers [manager-class] [...]
-compiler.fonts.max-cached-fonts <string>
-compiler.fonts.max-glyphs-per-face <string>
-compiler.headless-server
-compiler.include-libraries [library] [...]
-compiler.inline
-compiler.isolate-styles
-compiler.keep-all-type-selectors
-compiler.keep-as3-metadata [name] [...]
-compiler.library-path [path-element] [...]
-compiler.locale [locale-element] [...]
-compiler.minimum-supported-version <string>
-compiler.mobile
-compiler.mxml.compatibility-version <version>
-compiler.mxml.minimum-supported-version <string>
-compiler.namespaces.namespace [uri] [manifest] [...]
-compiler.omit-trace-statements
-compiler.optimize
-compiler.preloader <string>
-compiler.remove-dead-code
-compiler.report-invalid-styles-as-warnings
-compiler.report-missing-required-skin-parts-as-warnings
-compiler.services <filename>
-compiler.show-actionscript-warnings
-compiler.show-binding-warnings
-compiler.show-invalid-css-property-warnings
-compiler.show-multiple-definition-warnings
-compiler.show-shadowed-device-font-warnings
-compiler.show-unused-type-selector-warnings
-compiler.source-path [path-element] [...]
-compiler.strict
-compiler.theme [filename] [...]
-compiler.verbose-stacktraces
-compiler.warn-array-tostring-changes
-compiler.warn-assignment-within-conditional
-compiler.warn-bad-array-cast
-compiler.warn-bad-bool-assignment
-compiler.warn-bad-date-cast
-compiler.warn-bad-es3-type-method
-compiler.warn-bad-es3-type-prop
-compiler.warn-bad-nan-comparison
-compiler.warn-bad-null-assignment
-compiler.warn-bad-null-comparison
-compiler.warn-bad-undefined-comparison
-compiler.warn-boolean-constructor-with-no-args
-compiler.warn-changes-in-resolve
-compiler.warn-class-is-sealed
-compiler.warn-const-not-initialized
-compiler.warn-constructor-returns-value
-compiler.warn-deprecated-event-handler-error
-compiler.warn-deprecated-function-error
-compiler.warn-deprecated-property-error
-compiler.warn-duplicate-argument-names
-compiler.warn-duplicate-variable-def
-compiler.warn-for-var-in-changes
-compiler.warn-import-hides-class
-compiler.warn-instance-of-changes
-compiler.warn-internal-error
-compiler.warn-level-not-supported
-compiler.warn-missing-namespace-decl
-compiler.warn-negative-uint-literal
-compiler.warn-no-constructor
-compiler.warn-no-explicit-super-call-in-constructor
-compiler.warn-no-type-decl
-compiler.warn-number-from-string-changes
-compiler.warn-scoping-change-in-this
-compiler.warn-slow-text-field-addition
-compiler.warn-unlikely-function-value
-compiler.warn-xml-class-has-changed
-debug-password <string>
-default-background-color <int>
-default-frame-rate <int>
-default-script-limits <max-recursion-depth> <max-execution-time>
-default-size <width> <height>
-dependency-graph <filename>
-directory
-dump-config <filename>
-error-problems [class] [...]
-externs [symbol] [...]
-frames.frame [label] [classname] [...]
-help [keyword] [...]
-ignore-problems [class] [...]
-include-classes [class] [...]
-include-file [name] [path] [...]
-include-inheritance-dependencies-only
-include-lookup-only
-include-namespaces [uri] [...]
-include-resource-bundles [bundle] [...]
-include-sources [path-element] [...]
-include-stylesheet [name] [path] [...]
-includes [symbol] [...]
-link-report <filename>
-load-config <filename>
-load-externs <filename>
-metadata.contributor <name>
-metadata.creator <name>
-metadata.date <text>
-metadata.description <text>
-metadata.language <code>
-metadata.localized-description <text> <lang>
-metadata.localized-title <title> <lang>
-metadata.publisher <name>
-metadata.title <text>
-output <filename>
-raw-metadata <text>
-remove-unused-rsls
-resource-bundle-list <filename>
-runtime-shared-libraries [url] [...]
-runtime-shared-library-path [path-element] [rsl-url] [policy-file-url] [rsl-url] [policy-file-url]
-runtime-shared-library-settings.application-domain [path-element] [application-domain-target] [...]
-runtime-shared-library-settings.force-rsls [path-element] [...]
-single-thread
-size-report <filename>
-static-link-runtime-shared-libraries
-swf-version <int>
-target-player <version>
-tools-locale <string>
-use-direct-blit
-use-gpu
-use-network
-verify-digests
-version
-warning-problems [class] [...]
-warnings

To describe one of these parameters in detail you can call compc -help <parameter>, eg:

$ compc -help include-sources
Adobe SWC Component Compiler (compc)
Version 2.0.0 build 1234
Copyright 2004-2012 Adobe Systems Incorporated. All rights reserved.

-include-sources [path-element] [...]
a list of directories and source files to include in the output SWC
(repeatable)

asdoc

The asdoc task is a command-line tool that you can use to create API language reference documentation as HTML pages from the ActionScript classes and MXML files.

adt

The adt task is the AIR Developer Tool and represents the key packaging tool for creating AIR applications and components. You can use adt to:

  • Package an AIR application in a variety of formats
    • .air installation file;
    • iOS ipa;
    • Android apk / aab;
    • native installer eg exe on Windows or dmg on macOS
  • Package a native extension as an AIR Native Extension (ANE) file;
  • Sign an AIR application with a digital certificate;
  • Install, uninstall and launch applications on connected devices;
<exec executable="${env.AIR_HOME}/bin/adt">
<arg line="-package"/>
<arg line="-storetype pkcs12"/>
<arg line="-keystore certificate.p12"/>
<arg line="-storepass password"/>
...
</exec>

adl

ADL is a command line debugger for Adobe® AIR™ applications in the AIR SDK. You can use this to launch an AIR application without packaging into a captive runtime application or using the AIR Runtime.

This command can be called through an exec task similar to adt:

<exec executable="${env.AIR_HOME}/bin/adl">
...
</exec>