Skip to content

Commit 18bd35d

Browse files
committed
asconfigc: fixed isSWFTargetOnly not getting populated from compiler options
1 parent 1760de5 commit 18bd35d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

asconfigc/src/main/java/com/as3mxml/asconfigc/ASConfigC.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
import com.fasterxml.jackson.core.JsonProcessingException;
8585
import com.fasterxml.jackson.databind.JsonNode;
8686
import com.fasterxml.jackson.databind.ObjectMapper;
87+
import com.fasterxml.jackson.databind.node.ArrayNode;
8788
import com.networknt.schema.JsonSchema;
8889
import com.networknt.schema.JsonSchemaFactory;
8990
import com.networknt.schema.SpecVersion.VersionFlag;
@@ -104,6 +105,7 @@ public class ASConfigC {
104105
private static final String FILE_NAME_BIN_JS_DEBUG = "bin/js-debug";
105106
private static final String FILE_NAME_BIN_JS_RELEASE = "bin/js-release";
106107
private static final Pattern COMPILER_OPTION_OUTPUT_PATTERN = Pattern.compile("^-{1,2}output\\b");
108+
private static final String TARGET_SWF = "SWF";
107109

108110
public static void main(String[] args) {
109111
CommandLineParser parser = new DefaultParser();
@@ -864,6 +866,12 @@ private void readCompilerOptions(JsonNode compilerOptionsJson) throws ASConfigCE
864866
}
865867
if (compilerOptionsJson.has(CompilerOptions.TARGETS)) {
866868
configRequiresRoyale = true;
869+
870+
JsonNode targetsJson = compilerOptionsJson.get(CompilerOptions.TARGETS);
871+
if (targetsJson.isArray()) {
872+
ArrayNode targetsArray = (ArrayNode) targetsJson;
873+
isSWFTargetOnly = targetsArray.size() == 1 && targetsArray.get(0).asText().equals(TARGET_SWF);
874+
}
867875
}
868876
if (compilerOptionsJson.has(CompilerOptions.SOURCE_MAP)) {
869877
// source-map compiler option is supported by Royale

0 commit comments

Comments
 (0)