diff --git a/ide/MoonshineDESKTOPevolved/src/actionScripts/plugins/as3project/mxmlc/MXMLCPlugin.as b/ide/MoonshineDESKTOPevolved/src/actionScripts/plugins/as3project/mxmlc/MXMLCPlugin.as index ed4d24da0..f95b249b0 100644 --- a/ide/MoonshineDESKTOPevolved/src/actionScripts/plugins/as3project/mxmlc/MXMLCPlugin.as +++ b/ide/MoonshineDESKTOPevolved/src/actionScripts/plugins/as3project/mxmlc/MXMLCPlugin.as @@ -436,6 +436,7 @@ package actionScripts.plugins.as3project.mxmlc sdkSelectionCancelled(null); // update swf version if a newer SDK now saved than previously saved one AS3ProjectVO(currentProject).swfOutput.swfVersion = SDKUtils.getSdkSwfMajorVersion(); + AS3ProjectVO(currentProject).swfOutput.swfMinorVersion = SDKUtils.getSdkSwfMinorVersion(); // continue with waiting build process again proceedWithBuild(currentProject); } diff --git a/ide/MoonshineDESKTOPevolved/src/actionScripts/utils/findAndCopyApplicationDescriptor.as b/ide/MoonshineDESKTOPevolved/src/actionScripts/utils/findAndCopyApplicationDescriptor.as index 098ed0bed..f60202b1f 100644 --- a/ide/MoonshineDESKTOPevolved/src/actionScripts/utils/findAndCopyApplicationDescriptor.as +++ b/ide/MoonshineDESKTOPevolved/src/actionScripts/utils/findAndCopyApplicationDescriptor.as @@ -65,7 +65,7 @@ import flash.filesystem.File; // replace if appropriate data = data.replace(/.*?<\/content>/, ""+ project.swfOutput.path.fileBridge.name +""); data = data.replace(currentAIRNamespaceVersion, "http://ns.adobe.com/air/application/"+ ( - (project.swfOutput.swfVersionStrict != 0) ? project.swfOutput.swfVersionStrict : project.swfOutput.swfVersion +".0" + (project.swfOutput.swfVersionStrict != 0) ? project.swfOutput.swfVersionStrict : project.swfOutput.swfVersion +"."+ project.swfOutput.swfMinorVersion )); if (data.indexOf("_") != -1) { diff --git a/ide/MoonshineSharedCore/src/actionScripts/utils/SDKUtils.as b/ide/MoonshineSharedCore/src/actionScripts/utils/SDKUtils.as index 66dfc4a89..e71276f5f 100644 --- a/ide/MoonshineSharedCore/src/actionScripts/utils/SDKUtils.as +++ b/ide/MoonshineSharedCore/src/actionScripts/utils/SDKUtils.as @@ -328,74 +328,66 @@ package actionScripts.utils return null; } + + public static function getSdkSwfFullVersion(sdkPath:String=null, providerToUpdateAsync:Object=null, fieldToUpdateAsync:String=null):Number + { + var currentSDKVersion: Number = 10; + var sdk:FileLocation; + if (sdkPath) + { + var isFound:SDKReferenceVO = UtilsCore.getUserDefinedSDK(sdkPath, "path"); + if (isFound) sdk = new FileLocation(isFound.path); + } + else + { + sdk = IDEModel.getInstance().defaultSDK; + } + + if (sdk && sdk.fileBridge.exists) + { + var configFile:FileLocation = getSDKConfig(sdk); + if (configFile.fileBridge.exists) + { + // for async type of read and update to specific object's field + if (providerToUpdateAsync) + { + providerToUpdateAsync[fieldToUpdateAsync] = currentSDKVersion; + configFile.fileBridge.readAsync(providerToUpdateAsync, XML, int, fieldToUpdateAsync, "target-player"); + } + // non-async direct return only + else + { + var tmpConfigXML: XML = XML(configFile.fileBridge.read()); + currentSDKVersion = Number(tmpConfigXML["target-player"]); + } + } + } + + return currentSDKVersion; + } public static function getSdkSwfMajorVersion(sdkPath:String=null, providerToUpdateAsync:Object=null, fieldToUpdateAsync:String=null):int { - var currentSDKVersion: int = 10; - var sdk:FileLocation; - if (sdkPath) - { - var isFound:SDKReferenceVO = UtilsCore.getUserDefinedSDK(sdkPath, "path"); - if (isFound) sdk = new FileLocation(isFound.path); - } - else - { - sdk = IDEModel.getInstance().defaultSDK; - } - - if (sdk && sdk.fileBridge.exists) - { - var configFile:FileLocation = getSDKConfig(sdk); - if (configFile.fileBridge.exists) - { - // for async type of read and update to specific object's field - if (providerToUpdateAsync) - { - providerToUpdateAsync[fieldToUpdateAsync] = currentSDKVersion; - configFile.fileBridge.readAsync(providerToUpdateAsync, XML, int, fieldToUpdateAsync, "target-player"); - } - // non-async direct return only - else - { - var tmpConfigXML: XML = XML(configFile.fileBridge.read()); - currentSDKVersion = int(tmpConfigXML["target-player"]); - } - } - } + var swfFullVersion:Number = getSdkSwfFullVersion(sdkPath, providerToUpdateAsync, fieldToUpdateAsync); + var versionParts:Array = swfFullVersion.toString().split("."); + if (versionParts.length > 1) + { + return int(versionParts[0]); + } - return currentSDKVersion; + return swfFullVersion; } public static function getSdkSwfMinorVersion(sdkPath:String=null):int { - var currentSdkMinorVersion: int = 0; - var sdk:FileLocation; - if (sdkPath) - { - var isFound:SDKReferenceVO = UtilsCore.getUserDefinedSDK(sdkPath, "path"); - if (isFound) sdk = new FileLocation(isFound.path); - } - else - { - sdk = IDEModel.getInstance().defaultSDK; - } - - if (sdk && sdk.fileBridge.exists) - { - var configFile:FileLocation = getSDKConfig(sdk); - if (configFile.fileBridge.exists) - { - var tmpConfigXML: XML = XML(configFile.fileBridge.read()); - var targetPlayerVersion:String = tmpConfigXML["target-player"].toString(); - var versionParts:Array = targetPlayerVersion.split("."); - if (versionParts.length > 1) - { - currentSdkMinorVersion = int(versionParts[1]); - } - } - } + var swfFullVersion:Number = getSdkSwfFullVersion(sdkPath); + var versionParts:Array = swfFullVersion.toString().split("."); + if (versionParts.length > 1) + { + return int(versionParts[1]); + } - return currentSdkMinorVersion; + return 0; } public static function checkSDKTypeInSDKList(type:String):SDKReferenceVO