-
-
Notifications
You must be signed in to change notification settings - Fork 41
asconfig.json
Add a file named asconfig.json in the root folder of your project to enable the ActionScript & MXML extension for Visual Studio Code. This file configures the project for code intelligence in the editor, and it stores the compiler options used to build the project and options for packaging an Adobe AIR application.
The asconfigc utility can also use the same asconfig.json file to compile your project from the command line.
An example asconfig.json file for an Apache Royale project appears below:
{
"compilerOptions": {
"targets": [
"JSRoyale"
],
"source-path": [
"src"
],
"source-map": true
},
"mainClass": "HelloRoyale"
}
For a complete tutorial, see Create a new ActionScript project in Visual Studio Code that targets Apache Royale.
Here's another sample asconfig.json file for a pure ActionScript project targeting Adobe AIR on mobile:
{
"config": "airmobile",
"compilerOptions": {
"source-path": [
"src"
],
"output": "bin/HelloAIR.swf"
},
"mainClass": "HelloAIR",
"application": "src/HelloAIR-app.xml",
"airOptions": {
"android": {
"output": "bin/HelloAIR.apk",
"signingOptions": {
"storetype": "pkcs12",
"keystore": "android_certificate.p12"
}
},
"ios": {
"output": "bin/HelloAIR.ipa",
"signingOptions": {
"storetype": "pkcs12",
"keystore": "ios_certificate.p12",
"provisioning-profile": "example.mobileprovision"
}
}
}
}
For a complete tutorial, see Create a new ActionScript project in Visual Studio Code that targets Adobe AIR for mobile platforms.
The default configuration file to use from the SDK.
{
"config": "airmobile"
}
The following values for "config"
are supported:
"flex"
"air"
"airmobile"
-
"royale"
(Apache Royale only) -
"js"
(Apache Royale only) -
"node"
(Apache Royale only)
When compiling Apache Royale projects, "royale"
is the default value. For all other SDKs, "flex"
is the default.
The type of project being built. Defaults to "app"
.
{
"type": "lib"
}
The following values for "type"
are supported:
-
"app"
- an application -
"lib"
- a library (SWC)
The main entry point of an application project.
{
"mainClass": "Main"
}
Resolved using the values specified using the source-path
compiler option. The following example will try to find either src/Main.as or src/Main.mxml.
{
"compilerOptions": {
"source-path": [
"src"
]
},
"mainClass": "Main"
}
The specified source files will be included in the compiled output, including all of their dependencies — even if they are not referenced anywhere else. If the mainClass
field is omitted in an application project, the final item in the files
array will be used as the application entry point.
{
"files": [
"src/MyProject.as"
]
}
The files
property is for source files only (.as and .mxml files). If you are building an Adobe AIR application and you want to include extra asset files in your package, they should not be added here. See Adobe AIR options for details about how to include extra asset files with your application.
Optional path to an Adobe AIR application descriptor file. When compiling, the descriptor's <content>
element will be automatically populated, and the file will be copied into the output folder.
In the simplest case, you may specify a single application descriptor file for all platforms:
{
"application": "src/MyProject-app.xml"
}
Alternatively, you may specify separate application descriptor files for each platform:
{
"application": {
"ios": "src/MyProjectIOS-app.xml",
"android": "src/MyProjectAndroid-app.xml",
"windows": "src/MyProjectWindows-app.xml",
"mac": "src/MyProjectMacOS-app.xml"
}
}
Warning: If the output folder overlaps with the source path, the application descriptor will not be copied.
References another asconfig.json file to use as a template, allowing some of the values to be overridden.
{
"extends": "./asconfig.other.json"
}
See example of extends
.
Specify command line options to instruct the compiler how to build the project.
{
"compilerOptions": {
"output": "bin/MyApp.swf",
"library-path": [
"libs"
]
}
}
See Compiler Options below for complete details.
Additional options to send to the compiler, formatted as command line arguments. Useful for testing new or advanced compiler options that are not yet supported within the compilerOptions
field of asconfig.json.
You may specify additional options as a single string:
{
"additionalOptions": "-cool-new-option=true -another-option+=path/to/something"
}
If you prefer, you may specify additional options as an array of strings instead:
{
"additionalOptions": [
"-cool-new-option=true",
"-another-option+=path/to/something"
]
}
Specify command line options to instruct the AIR Developer Tool (ADT) how to package an Adobe AIR application.
{
"airOptions": {
"output": "bin/MyApp.air",
"signingOptions": {
"storetype": "pkcs12",
"keystore": "path/to/certificate.p12"
}
}
}
See Adobe AIR Options below for complete details.
Copies all files in the source path that don't have .as
or .mxml
extensions into the output folder.
{
"copySourcePathAssets": true
}
For Adobe AIR apps, the files will be copied to the output folder, but they will not be included in the packaged app. Use the files
field to include specific files or folders.
Warning: If the output folder overlaps with the source path, no files will be copied.
Copies a folder containing a template for HTML that embeds a .swf file to the output folder. Files such as index.template.html containing tokens like ${bgcolor}
will be populated automatically based on the project's compiler options.
{
"htmlTemplate": "./html-template"
}
The values for the following tokens will be populated based on your compiler options:
-
default-background-color
populates${bgcolor}
. Defaults to#ffffff
. -
default-size
populates${width}
and${height}
. Defaults to100%
for both values. -
target-player
populates${version_major}
,${version_minor}
, and${version_revision}
. Defaults to9.0.124
. -
output
populates${swf}
. - The name of your main class populates
${application}
.
Your workspace's SDK should contain a number of supported templates that you may copy into your project's workspace. For instance, many SDKs contain a template that uses SWFObject at <SDK path>/template/swfobject.
One or more modules that will be compiled along with the application.
{
"modules": [
{
"file": "src/MyModule.mxml",
"output": "bin/MyModule.swf",
"optimize": true
},
{
"file": "src/AnotherModule.mxml",
"output": "bin/AnotherModule.swf",
"optimize": true
}
]
}
See example of modules
.
One or more SWF workers that will be compiled along with the application.
{
"workers": [
{
"file": "src/MyWorker.as",
"output": "bin/MyWorker.swf"
},
{
"file": "src/AnotherWorker.as",
"output": "bin/AnotherWorker.swf"
}
]
}
See example of workers
.
The following options apply to all projects. See Library Compiler Options, JavaScript Compiler Options, or SWF Compiler Options for options that are specific to different project types.
Prints detailed compile times to the standard output. The default value is true
.
"compilerOptions": {
"benchmark": true
}
The generated output of the build will contain extra debug data.
"compilerOptions": {
"debug": true
}
When building an ActionScript project inside Visual Studio Code, the debug
compiler option in asconfig.json will be ignored because you can choose between debug or release from the list of tasks.
Defines a global constant at compile time. May be a boolean, number, string, or expression.
"define": [
{
"name": "CONFIG::debugging",
"value": true
},
{
"name": "CONFIG::release",
"value": false
}
]
For boolean and numeric values, you may pass in literals like true
, false
, or 123
. String values must be formatted with nested quotes, like "'hello'"
, because the compiler will attempt to evaluate an expression when it encounters quotes.
Combines all configuration options and saves them to the specified file.
"compilerOptions": {
"dump-config": "path/to/dumped-config.xml"
}
Specifies a list of .swc files, .ane files, or folders containing .swc or .ane files, to exclude from linking in the generated output. This option provides compile-time link checking for external components that are dynamically linked.
"compilerOptions": {
"external-library-path": [
"typedefs"
]
}
Warning: Some ActionScript compilers require that you add each .ane file to
external-library-path
separately, while other compilers can also search for .ane files inside folders. For maximum compatibility, it's better to specify individual .ane files in theexternal-library-path
. All compilers can search folders for .swc files, so this applies to native extensions only.
This option supports the ${flexlib}
and ${royalelib}
tokens to reference files from the frameworks folder inside the project's SDK.
Disables the pruning of unused type selectors. The default value is false
.
"compilerOptions": {
"keep-all-type-selectors": true
}
Specifies a list of .swc files, .ane files, or folders containing .swc or .ane files to link into the generated output of the build. The compiler only links in those classes that are referenced.
"compilerOptions": {
"library-path": [
"libs",
"path/to/file.swc",
"another_file.ane"
]
}
Warning: Some ActionScript compilers require that you add each .ane file to
library-path
separately, while other compilers can also search for .ane files inside folders. For maximum compatibility, it's better to specify individual .ane files in thelibrary-path
. All compilers can search folders for .swc files, so this applies to native extensions only.
This option supports the ${flexlib}
and ${royalelib}
tokens to reference files from the frameworks folder inside the project's SDK.
Specifies the locations of XML configuration files that define extra compiler options.
"compilerOptions": {
"load-config": [
"path/to/project-config.xml"
]
}
Specifies the locations of XML files that define extra symbols to omit from the output.
"compilerOptions": {
"load-externs": [
"path/to/externs.xml"
]
}
Specifies MXML namespaces. Each namespace must include a URI and the location of the manifest file that defines the contents of the namespace.
"compilerOptions": {
"namespace": [
{
"uri": "http://ns.example.com",
"manifest": "manifest.xml"
},
{
"uri": "library://example.com/library",
"manifest": "path/to/library-manifest.xml"
},
]
}
The path where the generated output should be saved.
"compilerOptions": {
"output": "bin/MyApp.swf"
}
Determines if warnings generated from unused CSS type selectors are displayed. The default value is true
.
"compilerOptions": {
"show-unused-type-selector-warnings": false
}
Generates a report that summarizes the size of each type of data in the application and saves it to the specified output file.
"compilerOptions": {
"size-report": "path/to/size-report.xml"
}
Adds folders or files to the source path. The compiler searches folders in the source path for .mxml, .as, or .css source files that are used in your applications and includes those that are required at compile time.
"compilerOptions": {
"source-path": [
"src"
]
}
This option supports the ${flexlib}
and ${royalelib}
tokens to reference files from the frameworks folder inside the project's SDK.
Performs compile-time type checking on assignments and options supplied to method calls. The default value is true
.
"compilerOptions": {
"strict": false
}
Specifies a theme file to use with this application.
"compilerOptions": {
"theme": "path/to/Theme.swc"
}
Enables or disables all warnings.
"compilerOptions": {
"warnings": false
}
The following options apply only when compiling library projects.
Outputs the library as a directory/folder instead of a .swc file.
"compilerOptions": {
"directory": true
}
Specifies classes to include in the .swc file. You provide the class name (for instance, com.example.MyClass) rather than the file name (for instance, com/example/MyClass.as) to the file for this option.
"compilerOptions": {
"include-classes": [
"com.example.SomeClass",
"com.example.utils.AnotherClass"
]
}
Specifies a list of files to include in the .swc file. Each entry in this array must be an object with two fields, file
and path
. The file
field refers to the source location of a file on your computer. The path
field refers to the destination location of the file inside the .swc library.
"compilerOptions": {
"include-file": [
{
"file": "path/to/myfile.png",
"path": "myfile.png"
}
]
}
Specifies namespace-style components in the .swc file. You specify a list of URIs to include in the .swc file. The uri argument must also be defined with the namespace
option.
"compilerOptions": {
"include-namespaces": [
"http://ns.example.com",
"library://example.com/library"
]
}
Specifies classes or folders to add to the .swc file. When specifying classes, you specify the path to the class file (for instance, com/example/MyClass.as) rather than the fully-qualified class name (such as com.example.MyClass
).
"compilerOptions": {
"include-sources": [
"source",
"third-party/library"
]
}
The following compiler options apply only when transpiling ActionScript to JavaScript with Apache Royale.
👑 This compiler option is available for Apache Royale applications only.
Specifies the file name of the HTML file generated by the compiler to load the Apache Royale application in the browser.
"compilerOptions": {
"html-output-filename": "custom.html"
}
Note: this is a simple file name and not a path. Do not include a folder name in the value.
👑 This compiler option is available for Apache Royale applications only.
Specifies the path to an optional template for the the HTML file generated by the compiler to load the Apache Royale application in the browser.
"compilerOptions": {
"html-template": "./path/to/template.html"
}
👑 This compiler option is available for Apache Royale applications only.
Specifies one or more custom compiler options to pass to the Google Closure Compiler, which is used to create the release build of an Apache Royale application.
"compilerOptions": {
"js-compiler-option": [
"--compilation_level SIMPLE_OPTIMIZATIONS"
]
}
👑 This compiler option is available for Apache Royale applications only.
Enables or disables initialization of primitive (Number, Boolean, etc.) variables with default values in the generated JavaScript.
"compilerOptions": {
"js-default-initializers": true
}
👑 This compiler option is available for Apache Royale applications only.
Defines a global constant at compile time for the JavaScript output. May be a boolean, number, string, or expression.
"js-define": [
{
"name": "CONFIG::debugging",
"value": true
},
{
"name": "CONFIG::release",
"value": false
}
]
For boolean and numeric values, you may pass in literals like true
, false
, or 123
. String values must be formatted with nested quotes, like "'hello'"
, because the compiler will attempt to evaluate an expression when it encounters quotes.
👑 This compiler option is available for Apache Royale applications only.
Specifies the locations of XML configuration files that define extra compiler options for JavaScript output.
"compilerOptions": {
"js-load-config": [
"path/to/project-config.xml"
]
}
👑 This compiler option is available for Apache Royale applications only.
The path where the generated JavaScript output should be saved, if output
is also being used for the .swf output path.
"compilerOptions": {
"js-output": "path/to/output"
}
👑 This compiler option is available for Apache Royale applications only.
Tells the Apache Royale compiler to remove circular dependencies in the generated JavaScript, where possible.
"compilerOptions": {
"remove-circulars": true
}
👑 This compiler option is available for Apache Royale applications only.
Emits source maps in the debug build for each ActionScript file. The default value is false
.
"compilerOptions": {
"source-map": true
}
👑 This compiler option is available for Apache Royale applications only.
Specifies the target format of the code generated by the Apache Royale compiler. Multiple targets may be specified.
"compilerOptions": {
"targets": [
"JSRoyale",
"SWF"
]
}
The following values for "targets"
are supported:
"JSRoyale"
"JS"
"JSNode"
"JSNodeModule"
"SWF"
👑 This compiler option is available for Apache Royale applications only.
Enables or disables warnings about using public variables.
"compilerOptions": {
"warn-public-vars": true
}
The following options apply only when compiling ActionScript to SWF format.
In a SWF project, enables advanced telemetry for Adobe Scout. The default value is false
.
"compilerOptions": {
"advanced-telemetry": true
}
Sets the SWF application's stage background color. The default value is #ffffff
.
"compilerOptions": {
"default-background-color": "#000000"
}
Sets the SWF application's frame rate. The default value is 24
.
"compilerOptions": {
"default-frame-rate": 30
}
Defines the default application size, in pixels.
"compilerOptions": {
"default-size": {
"width": 960,
"height": 640
}
}
Determines whether to keep the generated ActionScript class files. The default value is false
.
"compilerOptions": {
"keep-generated-actionscript": true
}
In a Flex project, specify a download progress bar for your application. The value must be the name of a class that implements the IPreloaderDisplay
interface.
"compilerOptions": {
"preloader": "com.example.CustomPreloader"
}
In a SWF project, determines whether to compile against libraries statically or use RSLs.
"compilerOptions": {
"static-link-runtime-shared-libraries": true
}
Specifies the SWF file format version. Features requiring a later version of the SWF file format are not compiled into the application. This is different from the target-player
version in that it refers to the SWF specification versioning scheme.
"compilerOptions": {
"swf-version": 34
}
If you're unsure which value to use for the swf-version
compiler option, see this table of runtime versions and their associated swf-version
values.
Specifies the Adobe Flash Player runtime version. Features requiring a later version of the runtime are not compiled into the application.
"compilerOptions": {
"target-player": "28.0"
}
Specifies options for packaging an Adobe AIR application. For complete details about each of the available options, see ADT package command in the official Adobe AIR documentation.
The following example shows how to specify options for a simple Adobe AIR desktop application that uses the shared runtime:
{
"airOptions": {
"output": "bin/MyApp.air",
"signingOptions": {
"keystore": "certificate.p12",
"storetype": "pkcs12"
}
}
}
See Adobe AIR Options for Multiple Platforms below for instructions to specify custom options for each targeted platform.
One or more specified folders that contain .ane files for native extensions that should be packaged with the Adobe AIR application for deployment.
"airOptions": {
"extdir": [
"./extensions"
]
}
Note: This field is used for packaging only. To specify "unpackaged" native extensions for debugging in the Adobe AIR simulator, use the extdir
field in launch.json instead.
Additional files to package with the Adobe AIR application. Each entry in this array must be an object with two fields, file
and path
. The file
field refers to the source location of a file (or folder) on your computer. The path
field refers to the destination location of the file inside the application package.
"airOptions": {
"files": [
{
"file": "icons/icon48.png",
"path": "icon48.png"
},
{
"file": "icons/icon128.png",
"path": "icon128.png"
}
]
}
The output file name of the application package.
"airOptions": {
"output": "bin/MyApp.air"
}
Specify signing options to instruct the compiler how to sign the application package.
"airOptions": {
"signingOptions": {
"keystore": "certificate.p12",
"storetype": "pkcs12"
}
}
See Signing Options below for complete details.
Specifies signing options for an Adobe AIR application, such as the path to a certificate file and its type. For complete details about each of the available options, see ADT code signing options in the official Adobe AIR documentation.
One or two sets of signing options may be specified. If only one set of signing options is provided, it will be used for both debug and release builds:
{
"airOptions": {
"signingOptions": {
"keystore": "certificate.p12",
"storetype": "pkcs12"
}
}
}
If required, you may specify different signing options for debug and release builds:
{
"airOptions": {
"signingOptions": {
"debug": {
"keystore": "debug_certificate.p12",
"storetype": "pkcs12"
},
"release": {
"keystore": "release_certificate.p12",
"storetype": "pkcs12"
}
}
}
}
The alias of a key in the keystore.
"signingOptions": {
"alias": "aliasName"
}
The type of keystore.
"signingOptions": {
"storetype": "pkcs12"
}
The path to the keystore file.
"signingOptions": {
"keystore": "path/to/certificate.p12"
}
The JCA provider for the specified keystore type.
"signingOptions": {
"providerName": "ProviderName"
}
Specifies the URL of an RFC3161-compliant timestamp server to time-stamp the digital signature, or "none" to disable timestamping.
"signingOptions": {
"tsa": "none"
}
The path to a provisioning profile for iOS.
"signingOptions": {
"providerName": "path/to/file.mobileprovision"
}
If the application targets multiple platforms, the airOptions
section may specify options for each platform separately. Some platforms may need to be packaged using different options. For example, applications often need to be signed with a different certificate on each platform. The following platforms may have their own sub-section with custom options to package an Adobe AIR application:
android
ios
ios_simulator
windows
mac
air
The following example demonstrates how to specify separate options for an Adobe AIR mobile application that targets both iOS and Android:
{
"airOptions": {
"ios": {
"output": "bin/MyApp.ipa",
"signingOptions": {
"keystore": "ios_certificate.p12",
"storetype": "pkcs12",
"provisioning-profile": "profile.mobileprovision"
}
},
"android": {
"output": "bin/MyApp.apk",
"signingOptions": {
"keystore": "android_certificate.p12",
"storetype": "pkcs12"
}
}
}
}
Some platforms have unique options that are not available on other platforms. These are described below in the following sections:
The following Adobe AIR options apply to iOS applications only, and they must be specified in the ios
or ios_simulator
fields of the airOptions
section. Additionally, all of the basic options in Adobe AIR Options may be added to the ios
and ios_simulator
fields to specify values that apply to the iOS platform only.
Specify whether to embed iOS bitcode or not.
"airOptions": {
"ios": {
"embedBitcode": true
}
}
Specify whether iOS native extension library symbols are visible only to that library's sources or globally.
"airOptions": {
"ios": {
"hideAneLibSymbols": true
}
}
Enables the telemetry-based ActionScript sampler in iOS applications.
"airOptions": {
"ios": {
"sampler": true
}
}
Specifies if the app will attempt to connect to a remote debugger (usually over Wi-Fi). Set to true
or false
, or optionally specify the host string of the computer running the debugger.
"airOptions": {
"ios": {
"connect": true
}
}
For a debug build, connect
defaults to true
, unless another value for connect
or listen
is provided to override the default behavior.
Specifies if the app will listen for an incoming connection to a debugger over USB. Set to true
or false
, or optionally specify the port to listen on.
"airOptions": {
"ios": {
"listen": true
}
}
When setting the listen
field to true
in asconfig.json, you must also set the connect
field to true
in launch.json.
The path to the iOS SDK.
"airOptions": {
"ios": {
"platformsdk": "/path/to/platform_sdk"
}
}
The package target for iOS. When omitted, defaults to ipa-app-store
for release builds. Debug builds always use ipa-debug
, even when this field is not omitted.
"airOptions": {
"ios": {
"target": "ipa-ad-hoc"
}
}
The following values for "target"
are supported on iOS:
ipa-app-store
ipa-ad-hoc
ipa-debug
ipa-test
ipa-debug-interpreter
ipa-test-interpreter
ipa-debug-interpreter-simulator
ipa-test-interpreter-simulator
The following Adobe AIR options apply to Android applications only, and they must be specified in the android
field of the airOptions
section. Additionally, all of the basic options in Adobe AIR Options may be added to the android
field to specify values that apply to the Android platform only.
Specifies the CPU architecture to target on Android.
"airOptions": {
"android": {
"arch": "armv8"
}
}
The following values for "arch"
are supported:
"armv7"
"armv8"
"x86"
Specifies an alternate URL for downloading and installing the AIR runtime on Android devices.
"airOptions": {
"android": {
"airDownloadURL": "http://www.amazon.com/gp/mas/dl/android?p=com.adobe.air"
}
}
Specifies if the app will attempt to connect to a remote debugger (usually over Wi-Fi). Set to true or false, or optionally specify the host string of the computer running the debugger.
"airOptions": {
"android": {
"connect": true
}
}
For a debug build, connect
defaults to true
, unless another value for connect
or listen
is provided to override the default behavior.
Specifies if the app will listen for an incoming connection to a debugger over USB. Set to true or false, or optionally specify the port to listen on.
"airOptions": {
"android": {
"listen": true
}
}
When setting the listen
field to true
in asconfig.json, you must also set the connect
field to true
in launch.json.
The path to the Android SDK.
"airOptions": {
"android": {
"platformsdk": "/path/to/platform_sdk"
}
}
The path to a folder containing Android resources.
"airOptions": {
"android": {
"resdir": "/path/to/resdir"
}
}
The package target for Android. When omitted, defaults to apk-captive-runtime
for release builds. Debug builds always use apk-debug
, even when this field is not omitted.
"airOptions": {
"android": {
"target": "apk-profile"
}
}
The following values for "target"
are supported on Android:
apk-captive-runtime
aab
apk
apk-debug
apk-profile
The following Adobe AIR options apply to Windows applications only, and they must be specified in the windows
field of the airOptions
section. Additionally, all of the basic options in Adobe AIR Options may be added to the windows
field to specify values that apply to the Windows platform only.
The package target for a Windows desktop application. If omitted, the default value is "bundle"
.
"airOptions": {
"windows": {
"target": "native"
}
}
The following values for "target"
are supported on Windows:
-
bundle
creates a desktop application using captive runtime -
native
creates a desktop application with a native installer.
The following Adobe AIR options apply to macOS applications only, and they must be specified in the mac
field of the airOptions
section. Additionally, all of the basic options in Adobe AIR Options may be added to the mac
field to specify values that apply to the macOS platform only.
The package target for a macOS desktop application. If omitted, the default value is "bundle"
.
"airOptions": {
"mac": {
"target": "native"
}
}
The following values for "target"
are supported on macOS:
-
bundle
creates a desktop application using captive runtime -
native
creates a desktop application with a native installer.
Specifies options for integrating with ActionScript 3 projects in Adobe Animate. When a .fla file is specified, Visual Studio Code may be used for editing code, but building and publishing are passed to Adobe Animate. You may choose the debug using either Visual Studio Code or Adobe Animate.
The following example shows how to specify options for a simple Adobe Animate project:
{
"animateOptions": {
"file": "MyApp.fla"
}
}
The path to the project's .fla file, relative to the folder containing asconfig.json.
"animateOptions": {
"file": "MyApp.fla"
}
- Adobe AIR (Mobile)
- Adobe AIR (Desktop)
- Adobe Flash Player
- Apache Royale
- HTML and JS (no framework)
- Node.js
- Feathers SDK
- Adobe Animate
- Classic Flex SDK
- Library (SWC)
- Royale Library (SWC)