Skip to content

Commit 34c2c1d

Browse files
committed
includes compiler option
1 parent c0d8fe3 commit 34c2c1d

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

schemas/asconfig.schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,13 @@
557557
"type": "string"
558558
}
559559
},
560+
"includes": {
561+
"type": "array",
562+
"description": "Specifies a list of classes or other symbols to link in the output, regardless of whether they are referenced.",
563+
"items": {
564+
"type": "string"
565+
}
566+
},
560567
"include-libraries": {
561568
"type": "array",
562569
"description": "Specifies a list of SWC files to link in the output, regardless of whether they are referenced.",

src/com/as3mxml/asconfigc/CompilerOptions.as

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ package com.as3mxml.asconfigc
3939
public static const DIRECTORY:String = "directory";
4040
public static const DUMP_CONFIG:String = "dump-config";
4141
public static const EXTERNAL_LIBRARY_PATH:String = "external-library-path";
42+
public static const INCLUDES:String = "includes";
4243
public static const INCLUDE_LIBRARIES:String = "include-libraries";
4344
public static const KEEP_ALL_TYPE_SELECTORS:String = "keep-all-type-selectors";
4445
public static const KEEP_AS3_METADATA:String = "keep-as3-metadata";

src/com/as3mxml/asconfigc/CompilerOptionsParser.as

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ package com.as3mxml.asconfigc
180180
parseIncludeFile(options[key], result);
181181
break;
182182
}
183+
case CompilerOptions.INCLUDES:
184+
{
185+
OptionsFormatter.appendValues(key, options[key], result);
186+
break;
187+
}
183188
case CompilerOptions.INCLUDE_LIBRARIES:
184189
{
185190
OptionsFormatter.appendPaths(key, options[key], result);

test/src/tests/CompilerOptionsTests.as

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,28 @@ package tests
431431
"Incorrect argument value for " + CompilerOptions.INCLUDE_FILE);
432432
}
433433

434+
[Test]
435+
public function testIncludes():void
436+
{
437+
var value:Array =
438+
[
439+
"com.example.MyClass",
440+
"com.example.AnotherClass",
441+
"TopLevel"
442+
];
443+
var args:Object = {};
444+
args[CompilerOptions.INCLUDES] = value;
445+
var result:Array = CompilerOptionsParser.parse(args);
446+
Assert.assertStrictlyEquals(result.length, 3,
447+
"Incorrect argument count for " + CompilerOptions.INCLUDES);
448+
Assert.assertStrictlyEquals(result[0], "--" + CompilerOptions.INCLUDES + "+=" + value[0],
449+
"Incorrect argument value for " + CompilerOptions.INCLUDES);
450+
Assert.assertStrictlyEquals(result[1], "--" + CompilerOptions.INCLUDES + "+=" + value[1],
451+
"Incorrect argument value for " + CompilerOptions.INCLUDES);
452+
Assert.assertStrictlyEquals(result[2], "--" + CompilerOptions.INCLUDES + "+=" + value[2],
453+
"Incorrect argument value for " + CompilerOptions.INCLUDES);
454+
}
455+
434456
[Test]
435457
public function testIncludeLibraries():void
436458
{

0 commit comments

Comments
 (0)