From d0821daf40317084f331b4e05220dce6f0071ef4 Mon Sep 17 00:00:00 2001 From: "sky.oh" Date: Tue, 17 Mar 2026 03:18:48 +0900 Subject: [PATCH] Add CPU architecture support for Windows in schema and tests --- schemas/asconfig.schema.json | 5 +++++ src/com/as3mxml/asconfigc/AIROptionsParser.as | 6 +++++- test/src/tests/AIROptionsTests.as | 13 +++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/schemas/asconfig.schema.json b/schemas/asconfig.schema.json index b83af38..3d614d4 100644 --- a/schemas/asconfig.schema.json +++ b/schemas/asconfig.schema.json @@ -339,6 +339,11 @@ "type": "object", "additionalProperties": false, "properties": { + "arch": { + "type": "string", + "description": "Specifies the CPU architecture to target on Windows.", + "pattern": "^(x86|x64)$" + }, "extdir": { "$ref": "#/definitions/airOptionsExtdir" }, "files": { "$ref": "#/definitions/airOptionsFiles" }, "output": { "$ref": "#/definitions/airOptionsOutput" }, diff --git a/src/com/as3mxml/asconfigc/AIROptionsParser.as b/src/com/as3mxml/asconfigc/AIROptionsParser.as index 1e49381..ebad207 100644 --- a/src/com/as3mxml/asconfigc/AIROptionsParser.as +++ b/src/com/as3mxml/asconfigc/AIROptionsParser.as @@ -178,11 +178,15 @@ package com.as3mxml.asconfigc { setValueWithoutAssignment(AIROptions.AIR_DOWNLOAD_URL, options[platform][AIROptions.AIR_DOWNLOAD_URL], result); } + //Android options end + + //This option is commonly used for both Android and Windows + //Windows and Android options begin if(overridesOptionForPlatform(options, AIROptions.ARCH, platform)) { setValueWithoutAssignment(AIROptions.ARCH, options[platform][AIROptions.ARCH], result); } - //Android options end + //Windows and Android options end //NATIVE_SIGNING_OPTIONS begin //these are *mobile* signing options only diff --git a/test/src/tests/AIROptionsTests.as b/test/src/tests/AIROptionsTests.as index 2df24fd..e32ee0c 100644 --- a/test/src/tests/AIROptionsTests.as +++ b/test/src/tests/AIROptionsTests.as @@ -90,6 +90,19 @@ package tests Assert.assertStrictlyEquals(result.indexOf(value), optionIndex + 1); } + [Test] + public function testArchWindows():void + { + var value:String = "x64"; + var args:Object = {}; + args[AIRPlatformType.WINDOWS] = {} + args[AIRPlatformType.WINDOWS][AIROptions.ARCH] = value; + var result:Array = AIROptionsParser.parse(AIRPlatformType.WINDOWS, false, "application.xml", "test.swf", null, null, args); + var optionIndex:int = result.indexOf("-" + AIROptions.ARCH); + Assert.assertNotStrictlyEquals(optionIndex, -1); + Assert.assertStrictlyEquals(result.indexOf(value), optionIndex + 1); + } + [Test] public function testResdir():void {