From 5251dd1ef525b6e3fd4c39dffb300b37408fcdf7 Mon Sep 17 00:00:00 2001 From: marchbold Date: Thu, 22 Jun 2023 11:53:34 +1000 Subject: [PATCH 1/2] feat(platforms): initial pass over handling platforms in packages and projects to limit the packages that get deployed to a project --- client/src/APMConsoleApp.as | 2 +- client/src/airsdk/AIRSDKVersion.as | 2 +- client/src/airsdk/lib/ADTConfig.as | 2 +- client/src/com/apm/SemVer.as | 2 +- client/src/com/apm/SemVerRange.as | 2 +- client/src/com/apm/client/APM.as | 2 +- .../src/com/apm/client/analytics/Analytics.as | 2 +- client/src/com/apm/client/commands/Command.as | 2 +- .../commands/airsdk/AIRSDKInstallCommand.as | 2 +- .../commands/airsdk/AIRSDKListCommand.as | 2 +- .../commands/airsdk/AIRSDKViewCommand.as | 2 +- .../airsdk/processes/DownloadAIRSDKProcess.as | 2 +- .../processes/InstallAIRSDKFinaliseProcess.as | 2 +- .../client/commands/general/ConfigCommand.as | 2 +- .../client/commands/general/HelpCommand.as | 2 +- .../client/commands/general/UpgradeCommand.as | 2 +- .../client/commands/general/VersionCommand.as | 2 +- .../client/commands/packages/BuildCommand.as | 2 +- .../client/commands/packages/CreateCommand.as | 2 +- .../commands/packages/InstallCommand.as | 2 +- .../client/commands/packages/ListCommand.as | 2 +- .../commands/packages/OutdatedCommand.as | 2 +- .../packages/PackageAddDependencyCommand.as | 2 +- .../commands/packages/PublishCommand.as | 117 ++++++++--------- .../client/commands/packages/SearchCommand.as | 2 +- .../commands/packages/UninstallCommand.as | 2 +- .../client/commands/packages/ViewCommand.as | 2 +- .../processes/DownloadPackageProcess.as | 2 +- .../processes/InstallDataValidationProcess.as | 2 +- .../processes/InstallDeployProcess.as | 28 ++++- .../processes/InstallFinaliseProcess.as | 2 +- .../processes/InstallLocalPackageProcess.as | 2 +- .../processes/InstallPackageProcess.as | 2 +- .../processes/InstallQueryPackageProcess.as | 2 +- .../processes/PackageContentCreateProcess.as | 2 +- .../processes/PackageContentVerifyProcess.as | 5 +- .../PackageDefinitionCreateProcess.as | 2 +- .../processes/PackageDefinitionLoadProcess.as | 2 +- .../PackageDependenciesVerifyProcess.as | 2 +- .../PackageExtractDefinitionProcess.as | 2 +- .../PackageGenerateChecksumProcess.as | 2 +- .../processes/PackagePublishProcess.as | 2 +- .../PackageRemoteContentVerifyProcess.as | 2 +- .../packages/processes/QueryPackageProcess.as | 2 +- .../UninstallFilesForPackageProcess.as | 2 +- ...ninstallPackageFromAppDescriptorProcess.as | 2 +- .../processes/UninstallPackageProcess.as | 2 +- .../packages/processes/ViewPackageProcess.as | 2 +- .../packages/utils/InstallDataValidator.as | 2 +- .../packages/utils/PackageRequestUtils.as | 2 +- .../utils/ProjectDefinitionValidator.as | 2 +- .../project/GenerateAppDescriptorCommand.as | 44 ++++--- .../commands/project/GenerateConfigCommand.as | 24 +++- .../client/commands/project/InitCommand.as | 2 +- .../client/commands/project/ProjectCommand.as | 24 +++- .../commands/project/ProjectConfigCommand.as | 2 +- .../project/processes/AndroidManifestMerge.as | 2 +- ...roidManifestMergeDependencyCheckProcess.as | 2 +- .../processes/AndroidManifestMergeProcess.as | 2 +- .../AndroidManifestMergeRunProcess.as | 2 +- .../ApplicationDescriptorGenerationProcess.as | 11 +- .../processes/GenerateConfigAndroidProcess.as | 2 +- .../processes/GenerateConfigIOSProcess.as | 2 +- .../IOSAdditionsMergeMacOSRunProcess.as | 2 +- .../processes/IOSAdditionsMergeProcess.as | 2 +- .../processes/IOSEntitlementsMergeProcess.as | 2 +- .../project/processes/IOSPlistMergeProcess.as | 2 +- .../project/processes/ProjectAddProcess.as | 116 +++++++++++++++++ .../processes/ProjectConfigDescribeProcess.as | 2 +- .../processes/ProjectConfigGetProcess.as | 2 +- .../processes/ProjectConfigSetProcess.as | 2 +- .../ProjectDefinitionCreateProcess.as | 2 +- ...jectDefinitionImportGetExtensionProcess.as | 2 +- .../ProjectDefinitionImportProcess.as | 2 +- .../project/processes/ProjectGetProcess.as | 24 +++- .../project/processes/ProjectSetProcess.as | 21 +++- .../processes/ValidatePackageCacheProcess.as | 2 +- .../ValidateProjectParametersProcess.as | 2 +- client/src/com/apm/client/config/RunConfig.as | 7 +- .../config/processes/CheckNetworkProcess.as | 2 +- .../config/processes/DebugDelayProcess.as | 2 +- .../LoadMacOSEnvironmentVariablesProcess.as | 2 +- .../processes/LoadMacOSJavaHomeProcess.as | 2 +- .../processes/LoadProjectDefinitionProcess.as | 2 +- .../processes/LoadUserSettingsProcess.as | 2 +- .../LoadWindowsEnvironmentVariablesProcess.as | 2 +- .../processes/LoadWindowsJavaHomeProcess.as | 2 +- .../LoadWindowsPowershellVersionProcess.as | 2 +- client/src/com/apm/client/events/APMEvent.as | 2 +- .../src/com/apm/client/events/CommandEvent.as | 2 +- client/src/com/apm/client/io/IO.as | 2 +- client/src/com/apm/client/io/IOColour.as | 2 +- client/src/com/apm/client/io/IO_MacOS.as | 2 +- client/src/com/apm/client/io/IO_Windows.as | 2 +- client/src/com/apm/client/logging/Log.as | 2 +- .../src/com/apm/client/processes/Process.as | 2 +- .../com/apm/client/processes/ProcessBase.as | 2 +- .../apm/client/processes/ProcessCallback.as | 2 +- .../com/apm/client/processes/ProcessQueue.as | 2 +- .../client/processes/events/ProcessEvent.as | 2 +- .../processes/generic/ChecksumAS3Process.as | 2 +- .../processes/generic/ChecksumMacOSProcess.as | 2 +- .../processes/generic/ChecksumProcess.as | 2 +- .../generic/ChecksumWindowsProcess.as | 2 +- .../processes/generic/ExtractZipAS3Process.as | 2 +- .../generic/ExtractZipMacOSProcess.as | 2 +- .../processes/generic/ExtractZipProcess.as | 2 +- .../generic/ExtractZipWindowsProcess.as | 2 +- .../upgrade/UpgradeClientDownloadProcess.as | 2 +- .../upgrade/UpgradeClientFinaliseProcess.as | 2 +- .../processes/upgrade/UpgradeClientProcess.as | 2 +- .../client/repositories/PackageResolver.as | 2 +- .../repositories/PackageResolverResult.as | 2 +- .../client/repositories/RepositoryResolver.as | 2 +- .../RepositoryGetPackageVersionProcess.as | 2 +- client/src/com/apm/data/common/Platform.as | 119 ++++++++++++++++++ .../src/com/apm/data/install/InstallData.as | 2 +- .../apm/data/install/InstallPackageData.as | 2 +- .../data/install/InstallPackageDataGroup.as | 2 +- .../com/apm/data/install/InstallRequest.as | 2 +- .../apm/data/packages/PackageDefinition.as | 2 +- .../data/packages/PackageDefinitionFile.as | 20 ++- .../apm/data/packages/PackageDependency.as | 2 +- .../apm/data/packages/PackageIdentifier.as | 2 +- .../com/apm/data/packages/PackageLicense.as | 2 +- .../com/apm/data/packages/PackageParameter.as | 2 +- .../com/apm/data/packages/PackageVersion.as | 24 +++- .../apm/data/packages/RepositoryDefinition.as | 2 +- .../apm/data/project/ApplicationDescriptor.as | 2 +- .../com/apm/data/project/ProjectBuildType.as | 4 +- .../com/apm/data/project/ProjectDefinition.as | 85 ++++++++++++- .../src/com/apm/data/project/ProjectLock.as | 2 +- .../com/apm/data/project/ProjectParameter.as | 2 +- client/src/com/apm/data/user/UserSettings.as | 2 +- client/src/com/apm/remote/airsdk/AIRSDKAPI.as | 2 +- .../src/com/apm/remote/airsdk/AIRSDKBuild.as | 2 +- .../remote/airsdk/events/AIRSDKAPIEvent.as | 2 +- client/src/com/apm/remote/github/GitHubAPI.as | 2 +- .../apm/remote/repository/LocalRepository.as | 2 +- .../com/apm/remote/repository/Repository.as | 2 +- .../apm/remote/repository/RepositoryAPI.as | 2 +- .../repository/RepositoryQueryOptions.as | 2 +- client/src/com/apm/utils/Checksum.as | 2 +- client/src/com/apm/utils/DeployFileUtils.as | 2 +- client/src/com/apm/utils/FileUtils.as | 2 +- client/src/com/apm/utils/JSONUtils.as | 2 +- client/src/com/apm/utils/PackageFileUtils.as | 2 +- .../src/com/apm/utils/ProjectPackageCache.as | 2 +- client/src/com/apm/utils/WindowsShellPaths.as | 2 +- client/src/com/apple/plist/Plist.as | 2 +- client/src/com/apple/plist/PlistUtils.as | 2 +- .../apple/plist/entries/PlistArrayEntry.as | 2 +- .../apple/plist/entries/PlistBooleanEntry.as | 2 +- .../apple/plist/entries/PlistCommentEntry.as | 2 +- .../com/apple/plist/entries/PlistDictEntry.as | 2 +- .../src/com/apple/plist/entries/PlistEntry.as | 2 +- .../apple/plist/entries/PlistStringEntry.as | 2 +- .../src/org/as3commons/file/PropertiesFile.as | 2 +- 158 files changed, 704 insertions(+), 253 deletions(-) create mode 100644 client/src/com/apm/client/commands/project/processes/ProjectAddProcess.as create mode 100644 client/src/com/apm/data/common/Platform.as diff --git a/client/src/APMConsoleApp.as b/client/src/APMConsoleApp.as index 7362d5e..88a6461 100644 --- a/client/src/APMConsoleApp.as +++ b/client/src/APMConsoleApp.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package { diff --git a/client/src/airsdk/AIRSDKVersion.as b/client/src/airsdk/AIRSDKVersion.as index b3ed22b..bd87ce3 100644 --- a/client/src/airsdk/AIRSDKVersion.as +++ b/client/src/airsdk/AIRSDKVersion.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/8/21 + * @created 28/8/2021 */ package airsdk { diff --git a/client/src/airsdk/lib/ADTConfig.as b/client/src/airsdk/lib/ADTConfig.as index 7415d4a..0220d44 100644 --- a/client/src/airsdk/lib/ADTConfig.as +++ b/client/src/airsdk/lib/ADTConfig.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 5/10/21 + * @created 5/10/2021 */ package airsdk.lib { diff --git a/client/src/com/apm/SemVer.as b/client/src/com/apm/SemVer.as index bef4318..e28afde 100644 --- a/client/src/com/apm/SemVer.as +++ b/client/src/com/apm/SemVer.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 4/6/21 + * @created 4/6/2021 */ package com.apm { diff --git a/client/src/com/apm/SemVerRange.as b/client/src/com/apm/SemVerRange.as index 2024c97..dc4e5b7 100644 --- a/client/src/com/apm/SemVerRange.as +++ b/client/src/com/apm/SemVerRange.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 4/6/21 + * @created 4/6/2021 */ package com.apm { diff --git a/client/src/com/apm/client/APM.as b/client/src/com/apm/client/APM.as index db63bcf..59e8735 100644 --- a/client/src/com/apm/client/APM.as +++ b/client/src/com/apm/client/APM.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client { diff --git a/client/src/com/apm/client/analytics/Analytics.as b/client/src/com/apm/client/analytics/Analytics.as index 351d6f5..4d1ae04 100644 --- a/client/src/com/apm/client/analytics/Analytics.as +++ b/client/src/com/apm/client/analytics/Analytics.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 6/8/21 + * @created 6/8/2021 */ package com.apm.client.analytics { diff --git a/client/src/com/apm/client/commands/Command.as b/client/src/com/apm/client/commands/Command.as index 1be2eb9..cf87156 100644 --- a/client/src/com/apm/client/commands/Command.as +++ b/client/src/com/apm/client/commands/Command.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands { diff --git a/client/src/com/apm/client/commands/airsdk/AIRSDKInstallCommand.as b/client/src/com/apm/client/commands/airsdk/AIRSDKInstallCommand.as index e4608bf..95dcf79 100644 --- a/client/src/com/apm/client/commands/airsdk/AIRSDKInstallCommand.as +++ b/client/src/com/apm/client/commands/airsdk/AIRSDKInstallCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.airsdk { diff --git a/client/src/com/apm/client/commands/airsdk/AIRSDKListCommand.as b/client/src/com/apm/client/commands/airsdk/AIRSDKListCommand.as index aae065c..2d1118f 100644 --- a/client/src/com/apm/client/commands/airsdk/AIRSDKListCommand.as +++ b/client/src/com/apm/client/commands/airsdk/AIRSDKListCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.airsdk { diff --git a/client/src/com/apm/client/commands/airsdk/AIRSDKViewCommand.as b/client/src/com/apm/client/commands/airsdk/AIRSDKViewCommand.as index 33f47ef..1565933 100644 --- a/client/src/com/apm/client/commands/airsdk/AIRSDKViewCommand.as +++ b/client/src/com/apm/client/commands/airsdk/AIRSDKViewCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.airsdk { diff --git a/client/src/com/apm/client/commands/airsdk/processes/DownloadAIRSDKProcess.as b/client/src/com/apm/client/commands/airsdk/processes/DownloadAIRSDKProcess.as index 5ad26c2..567f6db 100644 --- a/client/src/com/apm/client/commands/airsdk/processes/DownloadAIRSDKProcess.as +++ b/client/src/com/apm/client/commands/airsdk/processes/DownloadAIRSDKProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.commands.airsdk.processes { diff --git a/client/src/com/apm/client/commands/airsdk/processes/InstallAIRSDKFinaliseProcess.as b/client/src/com/apm/client/commands/airsdk/processes/InstallAIRSDKFinaliseProcess.as index 9efd979..187e451 100644 --- a/client/src/com/apm/client/commands/airsdk/processes/InstallAIRSDKFinaliseProcess.as +++ b/client/src/com/apm/client/commands/airsdk/processes/InstallAIRSDKFinaliseProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 8/9/21 + * @created 8/9/2021 */ package com.apm.client.commands.airsdk.processes { diff --git a/client/src/com/apm/client/commands/general/ConfigCommand.as b/client/src/com/apm/client/commands/general/ConfigCommand.as index 8a42e8e..03dc8ac 100644 --- a/client/src/com/apm/client/commands/general/ConfigCommand.as +++ b/client/src/com/apm/client/commands/general/ConfigCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.general { diff --git a/client/src/com/apm/client/commands/general/HelpCommand.as b/client/src/com/apm/client/commands/general/HelpCommand.as index 67a8a91..7446419 100644 --- a/client/src/com/apm/client/commands/general/HelpCommand.as +++ b/client/src/com/apm/client/commands/general/HelpCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.general { diff --git a/client/src/com/apm/client/commands/general/UpgradeCommand.as b/client/src/com/apm/client/commands/general/UpgradeCommand.as index a19d9f5..45486d5 100644 --- a/client/src/com/apm/client/commands/general/UpgradeCommand.as +++ b/client/src/com/apm/client/commands/general/UpgradeCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.general { diff --git a/client/src/com/apm/client/commands/general/VersionCommand.as b/client/src/com/apm/client/commands/general/VersionCommand.as index bb5dd2e..904dc33 100644 --- a/client/src/com/apm/client/commands/general/VersionCommand.as +++ b/client/src/com/apm/client/commands/general/VersionCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.general { diff --git a/client/src/com/apm/client/commands/packages/BuildCommand.as b/client/src/com/apm/client/commands/packages/BuildCommand.as index 078b23a..5052e75 100644 --- a/client/src/com/apm/client/commands/packages/BuildCommand.as +++ b/client/src/com/apm/client/commands/packages/BuildCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.packages { diff --git a/client/src/com/apm/client/commands/packages/CreateCommand.as b/client/src/com/apm/client/commands/packages/CreateCommand.as index 7751de1..d8ba629 100644 --- a/client/src/com/apm/client/commands/packages/CreateCommand.as +++ b/client/src/com/apm/client/commands/packages/CreateCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.packages { diff --git a/client/src/com/apm/client/commands/packages/InstallCommand.as b/client/src/com/apm/client/commands/packages/InstallCommand.as index 499e2bc..2d622bc 100644 --- a/client/src/com/apm/client/commands/packages/InstallCommand.as +++ b/client/src/com/apm/client/commands/packages/InstallCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.packages { diff --git a/client/src/com/apm/client/commands/packages/ListCommand.as b/client/src/com/apm/client/commands/packages/ListCommand.as index 0dce13b..412f4e0 100644 --- a/client/src/com/apm/client/commands/packages/ListCommand.as +++ b/client/src/com/apm/client/commands/packages/ListCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.packages { diff --git a/client/src/com/apm/client/commands/packages/OutdatedCommand.as b/client/src/com/apm/client/commands/packages/OutdatedCommand.as index 5ea90a8..260c324 100644 --- a/client/src/com/apm/client/commands/packages/OutdatedCommand.as +++ b/client/src/com/apm/client/commands/packages/OutdatedCommand.as @@ -10,7 +10,7 @@ * * @brief * @author marchbold - * @created 27/10/21 + * @created 27/10/2021 * @copyright http://distriqt.com/copyright/license.txt */ package com.apm.client.commands.packages diff --git a/client/src/com/apm/client/commands/packages/PackageAddDependencyCommand.as b/client/src/com/apm/client/commands/packages/PackageAddDependencyCommand.as index e4a8fb4..58458b6 100644 --- a/client/src/com/apm/client/commands/packages/PackageAddDependencyCommand.as +++ b/client/src/com/apm/client/commands/packages/PackageAddDependencyCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.packages { diff --git a/client/src/com/apm/client/commands/packages/PublishCommand.as b/client/src/com/apm/client/commands/packages/PublishCommand.as index 80314f9..f58d642 100644 --- a/client/src/com/apm/client/commands/packages/PublishCommand.as +++ b/client/src/com/apm/client/commands/packages/PublishCommand.as @@ -8,18 +8,15 @@ * \/ * http://distriqt.com * - * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @author Michael Archbold (https://github.com/marchbold) + * @created 18/5/2021 */ package com.apm.client.commands.packages { import com.apm.client.APM; - import com.apm.client.Consts; import com.apm.client.commands.Command; - import com.apm.client.commands.packages.processes.PackageContentCreateProcess; import com.apm.client.commands.packages.processes.PackageContentVerifyProcess; import com.apm.client.commands.packages.processes.PackageDefinitionLoadProcess; - import com.apm.client.commands.packages.processes.PackageDependenciesVerifyProcess; import com.apm.client.commands.packages.processes.PackageGenerateChecksumProcess; import com.apm.client.commands.packages.processes.PackagePublishProcess; import com.apm.client.commands.packages.processes.PackageRemoteContentVerifyProcess; @@ -27,82 +24,79 @@ package com.apm.client.commands.packages import com.apm.client.processes.ProcessQueue; import com.apm.client.processes.generic.ExtractZipProcess; import com.apm.data.packages.PackageDefinitionFile; - import com.apm.data.packages.PackageDependency; import com.apm.utils.FileUtils; import com.apm.utils.PackageFileUtils; - + import flash.events.EventDispatcher; - import flash.filesystem.File; - - + public class PublishCommand extends EventDispatcher implements Command { - + //////////////////////////////////////////////////////// // CONSTANTS // - + private static const TAG:String = "PublishCommand"; - + public static const NAME:String = "publish"; - - + + //////////////////////////////////////////////////////// // VARIABLES // - + private var _parameters:Array; private var _queue:ProcessQueue; - - + + //////////////////////////////////////////////////////// // FUNCTIONALITY // - + public function PublishCommand() { super(); _queue = new ProcessQueue(); } - - + + public function setParameters( parameters:Array ):void { _parameters = parameters; } - - + + public function get name():String { return NAME; } - - + + public function get category():String { return ""; } - - + + public function get requiresNetwork():Boolean { return true; } - - + + public function get requiresProject():Boolean { return false; } - - + + public function get description():String { return "publish a package in the repository"; } - - + + public function get usage():String { return description + "\n" + @@ -110,32 +104,32 @@ package com.apm.client.commands.packages "apm publish publish a package in the current directory\n" + "apm publish publish a package in a directory named \n"; } - - + + public function execute():void { var path:String = ""; if (_parameters != null && _parameters.length > 0) { - path = _parameters[ 0 ]; + path = _parameters[0]; } APM.io.writeLine( "Publishing package: " + path ); - + var tmpDir:File = new File( APM.config.workingDirectory + File.separator + ".apm__tmp" ); if (tmpDir.exists) { cleanup( tmpDir ); } - + var source:File = FileUtils.getSourceForPath( path ); if (!source.exists) { APM.io.writeError( source.name, "Specified package directory / file does not exist" ); - dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR )); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR ) ); return; } - + var packageDefinitionFile:PackageDefinitionFile = new PackageDefinitionFile(); if (source.isDirectory) { @@ -143,49 +137,48 @@ package com.apm.client.commands.packages if (!f.exists) { APM.io.writeError( PackageDefinitionFile.DEFAULT_FILENAME, "Package definition file does not exist" ); - dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR )); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR ) ); return; } - - _queue.addProcess( new PackageContentVerifyProcess( source )); - _queue.addProcess( new PackageDefinitionLoadProcess( packageDefinitionFile, f )); + + _queue.addProcess( new PackageContentVerifyProcess( source ) ); + _queue.addProcess( new PackageDefinitionLoadProcess( packageDefinitionFile, f ) ); } else if (source.extension == "zip" || source.extension == PackageFileUtils.AIRPACKAGEEXTENSION) { var pf:File = tmpDir.resolvePath( PackageDefinitionFile.DEFAULT_FILENAME ); - + _queue.addProcess( new ExtractZipProcess( source, tmpDir ) ); - _queue.addProcess( new PackageContentVerifyProcess( tmpDir )); - _queue.addProcess( new PackageDefinitionLoadProcess( packageDefinitionFile, pf )); - _queue.addProcess( new PackageGenerateChecksumProcess( packageDefinitionFile, source )); + _queue.addProcess( new PackageContentVerifyProcess( tmpDir ) ); + _queue.addProcess( new PackageDefinitionLoadProcess( packageDefinitionFile, pf ) ); + _queue.addProcess( new PackageGenerateChecksumProcess( packageDefinitionFile, source ) ); } else { APM.io.writeError( source.name, "Cannot publish this file / directory" ); - dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR )); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR ) ); return; } - + _queue.addProcess( new PackageRemoteContentVerifyProcess( packageDefinitionFile ) ); _queue.addProcess( new PackagePublishProcess( packageDefinitionFile ) ); - + _queue.start( - function ():void { + function ():void + { cleanup( tmpDir ); - dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_OK )); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_OK ) ); }, - function ( message:String ):void { + function ( message:String ):void + { cleanup( tmpDir ); APM.io.writeError( "ERROR", message ); - dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR )); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR ) ); } ); } - - - - - + + private function cleanup( tmpDir:File ):void { if (tmpDir.exists) @@ -193,7 +186,7 @@ package com.apm.client.commands.packages tmpDir.deleteDirectory( true ); } } - + } - + } diff --git a/client/src/com/apm/client/commands/packages/SearchCommand.as b/client/src/com/apm/client/commands/packages/SearchCommand.as index c76f29d..5bbaa8c 100644 --- a/client/src/com/apm/client/commands/packages/SearchCommand.as +++ b/client/src/com/apm/client/commands/packages/SearchCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.packages { diff --git a/client/src/com/apm/client/commands/packages/UninstallCommand.as b/client/src/com/apm/client/commands/packages/UninstallCommand.as index 88834ac..e3cc54f 100644 --- a/client/src/com/apm/client/commands/packages/UninstallCommand.as +++ b/client/src/com/apm/client/commands/packages/UninstallCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.packages { diff --git a/client/src/com/apm/client/commands/packages/ViewCommand.as b/client/src/com/apm/client/commands/packages/ViewCommand.as index 1e1c3ec..7b63ed7 100644 --- a/client/src/com/apm/client/commands/packages/ViewCommand.as +++ b/client/src/com/apm/client/commands/packages/ViewCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.packages { diff --git a/client/src/com/apm/client/commands/packages/processes/DownloadPackageProcess.as b/client/src/com/apm/client/commands/packages/processes/DownloadPackageProcess.as index 252ec67..b3a2e38 100644 --- a/client/src/com/apm/client/commands/packages/processes/DownloadPackageProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/DownloadPackageProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/InstallDataValidationProcess.as b/client/src/com/apm/client/commands/packages/processes/InstallDataValidationProcess.as index aa49237..3c696df 100644 --- a/client/src/com/apm/client/commands/packages/processes/InstallDataValidationProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/InstallDataValidationProcess.as @@ -10,7 +10,7 @@ * * @brief * @author marchbold - * @created 16/7/21 + * @created 16/7/2021 * @copyright http://distriqt.com/copyright/license.txt */ package com.apm.client.commands.packages.processes diff --git a/client/src/com/apm/client/commands/packages/processes/InstallDeployProcess.as b/client/src/com/apm/client/commands/packages/processes/InstallDeployProcess.as index 675bbbc..c6851c6 100644 --- a/client/src/com/apm/client/commands/packages/processes/InstallDeployProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/InstallDeployProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/6/21 + * @created 22/6/2021 */ package com.apm.client.commands.packages.processes { @@ -58,6 +58,11 @@ package com.apm.client.commands.packages.processes super.start( completeCallback, failureCallback ); for each (var p:InstallPackageData in _installData.packagesToInstall) { + if (!APM.config.projectDefinition.shouldIncludePackage( p.packageVersion )) + { + continue; + } + var packageDir:File = PackageFileUtils.contentsDirForPackage( APM.config.packagesDirectory, p.packageVersion.packageDef.identifier ); if (packageDir == null || !packageDir.exists) @@ -73,8 +78,27 @@ package com.apm.client.commands.packages.processes var deployLocation:File = DeployFileUtils.getDeployLocation( APM.config, ref.name ); if (deployLocation != null) { - FileUtils.copyDirectoryTo( ref, deployLocation, true ); + switch (ref.name) + { + case PackageFileUtils.AIRPACKAGE_ASSETS: + // Check each asset directory (named after the platform) for inclusion in project + for each (var assetsDir:File in ref.getDirectoryListing()) + { + var assetsPlatform:String = assetsDir.name.toLowerCase(); + var assetsDeployLocation:File = deployLocation.resolvePath( assetsPlatform ); + if (APM.config.projectDefinition.shouldIncludePlatform( assetsPlatform )) + { + FileUtils.copyDirectoryTo( assetsDir, assetsDeployLocation, true ); + } + } + break; + + default: + FileUtils.copyDirectoryTo( ref, deployLocation, true ); + break; + } } + } } APM.io.stopSpinner( true, "Deployed: " + p.packageVersion.toStringWithIdentifier() ); diff --git a/client/src/com/apm/client/commands/packages/processes/InstallFinaliseProcess.as b/client/src/com/apm/client/commands/packages/processes/InstallFinaliseProcess.as index fca109a..e0b96fd 100644 --- a/client/src/com/apm/client/commands/packages/processes/InstallFinaliseProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/InstallFinaliseProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/6/21 + * @created 22/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/InstallLocalPackageProcess.as b/client/src/com/apm/client/commands/packages/processes/InstallLocalPackageProcess.as index 09a3eb0..3f1dcc1 100644 --- a/client/src/com/apm/client/commands/packages/processes/InstallLocalPackageProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/InstallLocalPackageProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/InstallPackageProcess.as b/client/src/com/apm/client/commands/packages/processes/InstallPackageProcess.as index 6d43414..3cebf62 100644 --- a/client/src/com/apm/client/commands/packages/processes/InstallPackageProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/InstallPackageProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/InstallQueryPackageProcess.as b/client/src/com/apm/client/commands/packages/processes/InstallQueryPackageProcess.as index b5b552a..c1c0c12 100644 --- a/client/src/com/apm/client/commands/packages/processes/InstallQueryPackageProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/InstallQueryPackageProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/PackageContentCreateProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageContentCreateProcess.as index a5c4828..6309119 100644 --- a/client/src/com/apm/client/commands/packages/processes/PackageContentCreateProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/PackageContentCreateProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/PackageContentVerifyProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageContentVerifyProcess.as index 2ccf611..63cbf2a 100644 --- a/client/src/com/apm/client/commands/packages/processes/PackageContentVerifyProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/PackageContentVerifyProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { @@ -99,7 +99,8 @@ package com.apm.client.commands.packages.processes APM.io.writeLine( "- status: " + f.version.status ); APM.io.writeLine( "- publishedAt: " + f.version.publishedAt ); APM.io.writeLine( "- sourceUrl: " + f.version.sourceUrl ); - + APM.io.writeLine( "- platforms: " + f.version.platforms.join(",") ); + APM.io.showSpinner( "Verifying package content" ); diff --git a/client/src/com/apm/client/commands/packages/processes/PackageDefinitionCreateProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageDefinitionCreateProcess.as index 1dae033..8f3a10e 100644 --- a/client/src/com/apm/client/commands/packages/processes/PackageDefinitionCreateProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/PackageDefinitionCreateProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/PackageDefinitionLoadProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageDefinitionLoadProcess.as index b6e1ce5..ccb9feb 100644 --- a/client/src/com/apm/client/commands/packages/processes/PackageDefinitionLoadProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/PackageDefinitionLoadProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/PackageDependenciesVerifyProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageDependenciesVerifyProcess.as index 5640a11..c01a8f5 100644 --- a/client/src/com/apm/client/commands/packages/processes/PackageDependenciesVerifyProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/PackageDependenciesVerifyProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/PackageExtractDefinitionProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageExtractDefinitionProcess.as index 36f4824..9c07fe2 100644 --- a/client/src/com/apm/client/commands/packages/processes/PackageExtractDefinitionProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/PackageExtractDefinitionProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 16/9/21 + * @created 16/9/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/PackageGenerateChecksumProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageGenerateChecksumProcess.as index 970c67c..53ef9cf 100644 --- a/client/src/com/apm/client/commands/packages/processes/PackageGenerateChecksumProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/PackageGenerateChecksumProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/PackagePublishProcess.as b/client/src/com/apm/client/commands/packages/processes/PackagePublishProcess.as index 439b03d..3e1f0cc 100644 --- a/client/src/com/apm/client/commands/packages/processes/PackagePublishProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/PackagePublishProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/PackageRemoteContentVerifyProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageRemoteContentVerifyProcess.as index 3d50b15..e4994b2 100644 --- a/client/src/com/apm/client/commands/packages/processes/PackageRemoteContentVerifyProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/PackageRemoteContentVerifyProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/QueryPackageProcess.as b/client/src/com/apm/client/commands/packages/processes/QueryPackageProcess.as index ed1981c..952eb92 100644 --- a/client/src/com/apm/client/commands/packages/processes/QueryPackageProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/QueryPackageProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/UninstallFilesForPackageProcess.as b/client/src/com/apm/client/commands/packages/processes/UninstallFilesForPackageProcess.as index 9810d81..3f26f44 100644 --- a/client/src/com/apm/client/commands/packages/processes/UninstallFilesForPackageProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/UninstallFilesForPackageProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/UninstallPackageFromAppDescriptorProcess.as b/client/src/com/apm/client/commands/packages/processes/UninstallPackageFromAppDescriptorProcess.as index 5e6311d..e9c91e1 100644 --- a/client/src/com/apm/client/commands/packages/processes/UninstallPackageFromAppDescriptorProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/UninstallPackageFromAppDescriptorProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 03/12/21 + * @created 03/12/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/UninstallPackageProcess.as b/client/src/com/apm/client/commands/packages/processes/UninstallPackageProcess.as index 1d2f330..4bfb1f2 100644 --- a/client/src/com/apm/client/commands/packages/processes/UninstallPackageProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/UninstallPackageProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/processes/ViewPackageProcess.as b/client/src/com/apm/client/commands/packages/processes/ViewPackageProcess.as index 2976d20..856fde2 100644 --- a/client/src/com/apm/client/commands/packages/processes/ViewPackageProcess.as +++ b/client/src/com/apm/client/commands/packages/processes/ViewPackageProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.packages.processes { diff --git a/client/src/com/apm/client/commands/packages/utils/InstallDataValidator.as b/client/src/com/apm/client/commands/packages/utils/InstallDataValidator.as index 1d9c1b4..0d59439 100644 --- a/client/src/com/apm/client/commands/packages/utils/InstallDataValidator.as +++ b/client/src/com/apm/client/commands/packages/utils/InstallDataValidator.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/6/21 + * @created 18/6/2021 */ package com.apm.client.commands.packages.utils { diff --git a/client/src/com/apm/client/commands/packages/utils/PackageRequestUtils.as b/client/src/com/apm/client/commands/packages/utils/PackageRequestUtils.as index 3f88939..4151bc0 100644 --- a/client/src/com/apm/client/commands/packages/utils/PackageRequestUtils.as +++ b/client/src/com/apm/client/commands/packages/utils/PackageRequestUtils.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/6/21 + * @created 28/6/2021 */ package com.apm.client.commands.packages.utils { diff --git a/client/src/com/apm/client/commands/packages/utils/ProjectDefinitionValidator.as b/client/src/com/apm/client/commands/packages/utils/ProjectDefinitionValidator.as index 5b78758..d01553c 100644 --- a/client/src/com/apm/client/commands/packages/utils/ProjectDefinitionValidator.as +++ b/client/src/com/apm/client/commands/packages/utils/ProjectDefinitionValidator.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/6/21 + * @created 18/6/2021 */ package com.apm.client.commands.packages.utils { diff --git a/client/src/com/apm/client/commands/project/GenerateAppDescriptorCommand.as b/client/src/com/apm/client/commands/project/GenerateAppDescriptorCommand.as index af9133e..11a7819 100644 --- a/client/src/com/apm/client/commands/project/GenerateAppDescriptorCommand.as +++ b/client/src/com/apm/client/commands/project/GenerateAppDescriptorCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 20/8/21 + * @created 20/8/2021 */ package com.apm.client.commands.project { @@ -26,8 +26,10 @@ package com.apm.client.commands.project import com.apm.client.events.CommandEvent; import com.apm.client.logging.Log; import com.apm.client.processes.ProcessQueue; + import com.apm.data.common.Platform; import com.apm.data.project.ApplicationDescriptor; import com.apm.data.project.ProjectDefinition; + import com.apm.data.common.Platform; import flash.events.EventDispatcher; import flash.filesystem.File; @@ -138,33 +140,29 @@ package com.apm.client.commands.project { Log.d( TAG, "execute(): " + (_parameters.length > 0 ? _parameters.join( "," ) : "...") + "\n" ); - var excludeAndroid:Boolean = false; - var excludeIOS:Boolean = false; + var platforms:Vector. = new []; var stripComments:Boolean = false; for each (var option:String in _options) { switch (option) { case "--ios": - { - excludeAndroid = true; - break; - } case "--android": + case "--windows": + case "--linux": + case "--macos": { - excludeIOS = true; + platforms.push( new Platform( option.substr( 2 ), true ) ); break; } + case "--exclude-android": - { - excludeAndroid = true; - break; - } case "--exclude-ios": { - excludeIOS = true; + APM.io.writeError( NAME, "Deprecated option: " + option + " Specify your required platforms instead" ); break; } + case "--strip-comments": { stripComments = true; @@ -173,6 +171,11 @@ package com.apm.client.commands.project } } + if (platforms.length == 0) + { + platforms = APM.config.projectDefinition.platforms; + } + // Get AIR SDK version for app descriptor var airSDKVersion:AIRSDKVersion = null; if (APM.config.airDirectory != null) @@ -202,15 +205,16 @@ package com.apm.client.commands.project _queue.addProcess( new ValidateProjectParametersProcess() ); _queue.addProcess( new ValidatePackageCacheProcess() ); - if (!excludeAndroid) + if (shouldProcessPlatform( platforms, Platform.ANDROID )) { _queue.addProcess( new AndroidManifestMergeProcess( appDescriptor ) ); } - if (!excludeIOS) + if (shouldProcessPlatform( platforms, Platform.IOS )) { _queue.addProcess( new IOSAdditionsMergeProcess( appDescriptor ) ); _queue.addProcess( new IOSEntitlementsMergeProcess( appDescriptor ) ); } + _queue.addProcess( new ApplicationDescriptorGenerationProcess( appDescriptor, outputPath ) ); _queue.start( @@ -248,6 +252,16 @@ package com.apm.client.commands.project } + private function shouldProcessPlatform( platforms:Vector., platform:String ):Boolean + { + for each (var item:Platform in platforms) + { + if (item.name == platform) return true; + } + return false; + } + + } } diff --git a/client/src/com/apm/client/commands/project/GenerateConfigCommand.as b/client/src/com/apm/client/commands/project/GenerateConfigCommand.as index 4beb0e4..913232f 100644 --- a/client/src/com/apm/client/commands/project/GenerateConfigCommand.as +++ b/client/src/com/apm/client/commands/project/GenerateConfigCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 20/8/21 + * @created 20/8/2021 */ package com.apm.client.commands.project { @@ -30,7 +30,9 @@ package com.apm.client.commands.project import com.apm.data.project.ProjectDefinition; import airsdk.AIRSDKVersion; import airsdk.AIRSDKVersion; - + + import com.apm.data.common.Platform; + import flash.events.EventDispatcher; import flash.filesystem.File; @@ -137,11 +139,21 @@ package com.apm.client.commands.project } else { - _queue.addProcess( new GenerateConfigAndroidProcess() ); - _queue.addProcess( new GenerateConfigIOSProcess() ); + for each (var p:Platform in APM.config.projectDefinition.platforms) + { + switch (p.name) + { + case Platform.ANDROID: + _queue.addProcess( new GenerateConfigAndroidProcess() ); + break; + + case Platform.IOS: + _queue.addProcess( new GenerateConfigIOSProcess() ); + break; + } + } } - - + _queue.start( function ():void { dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_OK ) ); diff --git a/client/src/com/apm/client/commands/project/InitCommand.as b/client/src/com/apm/client/commands/project/InitCommand.as index d324509..7025f68 100644 --- a/client/src/com/apm/client/commands/project/InitCommand.as +++ b/client/src/com/apm/client/commands/project/InitCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.project { diff --git a/client/src/com/apm/client/commands/project/ProjectCommand.as b/client/src/com/apm/client/commands/project/ProjectCommand.as index de3cc60..c0a53b6 100644 --- a/client/src/com/apm/client/commands/project/ProjectCommand.as +++ b/client/src/com/apm/client/commands/project/ProjectCommand.as @@ -8,13 +8,14 @@ * \/ * http://distriqt.com * - * @author Michael (https://github.com/marchbold) + * @author Michael Archbold (https://github.com/marchbold) * @created 24/2/2023 */ package com.apm.client.commands.project { import com.apm.client.APM; import com.apm.client.commands.Command; + import com.apm.client.commands.project.processes.ProjectAddProcess; import com.apm.client.commands.project.processes.ProjectGetProcess; import com.apm.client.commands.project.processes.ProjectSetProcess; import com.apm.client.events.CommandEvent; @@ -94,9 +95,11 @@ package com.apm.client.commands.project return description + "\n" + "\n" + "apm project Prints all project parameters \n" + + "apm project get Prints the project parameter value for the parameter \n" + "apm project set Sets a project parameter to the specified \n" + "apm project set Asks for input to set the value for the project parameter \n" + - "apm project get Prints the project parameter value for the parameter \n" + "apm project add Adds the to the specified project parameter array \n" + + "apm project add Asks for input to add a value to the project parameter array \n" ; } @@ -143,6 +146,23 @@ package com.apm.client.commands.project break; } + case "add": + { + if (_parameters.length < 2) + { + dispatchEvent( new CommandEvent( CommandEvent.PRINT_USAGE, name ) ); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR ) ); + return; + } + + queue.addProcess( new ProjectAddProcess( + _parameters.length < 2 ? null : _parameters[1], + _parameters.length < 3 ? null : _parameters.slice( 2 ).join( " " ) + ) ); + + break; + } + default: { dispatchEvent( new CommandEvent( CommandEvent.PRINT_USAGE, name ) ); diff --git a/client/src/com/apm/client/commands/project/ProjectConfigCommand.as b/client/src/com/apm/client/commands/project/ProjectConfigCommand.as index 231c2cf..bc0e834 100644 --- a/client/src/com/apm/client/commands/project/ProjectConfigCommand.as +++ b/client/src/com/apm/client/commands/project/ProjectConfigCommand.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.commands.project { diff --git a/client/src/com/apm/client/commands/project/processes/AndroidManifestMerge.as b/client/src/com/apm/client/commands/project/processes/AndroidManifestMerge.as index 87e77ef..c4b4bd9 100644 --- a/client/src/com/apm/client/commands/project/processes/AndroidManifestMerge.as +++ b/client/src/com/apm/client/commands/project/processes/AndroidManifestMerge.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 31/8/21 + * @created 31/8/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeDependencyCheckProcess.as b/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeDependencyCheckProcess.as index fbc3faf..0bbc7ed 100644 --- a/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeDependencyCheckProcess.as +++ b/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeDependencyCheckProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 27/8/21 + * @created 27/8/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeProcess.as b/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeProcess.as index c953e93..7f75d62 100644 --- a/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeProcess.as +++ b/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 23/8/21 + * @created 23/8/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeRunProcess.as b/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeRunProcess.as index 61925c8..7c341a0 100644 --- a/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeRunProcess.as +++ b/client/src/com/apm/client/commands/project/processes/AndroidManifestMergeRunProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 27/8/21 + * @created 27/8/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/ApplicationDescriptorGenerationProcess.as b/client/src/com/apm/client/commands/project/processes/ApplicationDescriptorGenerationProcess.as index 3f5a445..4f78425 100644 --- a/client/src/com/apm/client/commands/project/processes/ApplicationDescriptorGenerationProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ApplicationDescriptorGenerationProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 23/8/21 + * @created 23/8/2021 */ package com.apm.client.commands.project.processes { @@ -113,9 +113,12 @@ package com.apm.client.commands.project.processes { if (packageDefinition.packageDef.type == PackageDefinition.TYPE_ANE) { - _appDescriptor.addExtension( - PackageIdentifier.identifierWithoutVariant( packageDefinition.packageDef.identifier ) - ); + if (APM.config.projectDefinition.shouldIncludePackage( packageDefinition.version )) + { + _appDescriptor.addExtension( + PackageIdentifier.identifierWithoutVariant( packageDefinition.packageDef.identifier ) + ); + } } } diff --git a/client/src/com/apm/client/commands/project/processes/GenerateConfigAndroidProcess.as b/client/src/com/apm/client/commands/project/processes/GenerateConfigAndroidProcess.as index f45c70c..883fa2a 100644 --- a/client/src/com/apm/client/commands/project/processes/GenerateConfigAndroidProcess.as +++ b/client/src/com/apm/client/commands/project/processes/GenerateConfigAndroidProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 29/9/21 + * @created 29/9/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/GenerateConfigIOSProcess.as b/client/src/com/apm/client/commands/project/processes/GenerateConfigIOSProcess.as index c505e8a..27bf6da 100644 --- a/client/src/com/apm/client/commands/project/processes/GenerateConfigIOSProcess.as +++ b/client/src/com/apm/client/commands/project/processes/GenerateConfigIOSProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 29/9/21 + * @created 29/9/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/IOSAdditionsMergeMacOSRunProcess.as b/client/src/com/apm/client/commands/project/processes/IOSAdditionsMergeMacOSRunProcess.as index 2ad623a..c8f196d 100644 --- a/client/src/com/apm/client/commands/project/processes/IOSAdditionsMergeMacOSRunProcess.as +++ b/client/src/com/apm/client/commands/project/processes/IOSAdditionsMergeMacOSRunProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 27/8/21 + * @created 27/8/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/IOSAdditionsMergeProcess.as b/client/src/com/apm/client/commands/project/processes/IOSAdditionsMergeProcess.as index b55baba..f5b4e30 100644 --- a/client/src/com/apm/client/commands/project/processes/IOSAdditionsMergeProcess.as +++ b/client/src/com/apm/client/commands/project/processes/IOSAdditionsMergeProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 23/8/21 + * @created 23/8/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/IOSEntitlementsMergeProcess.as b/client/src/com/apm/client/commands/project/processes/IOSEntitlementsMergeProcess.as index b356aa6..d3f5814 100644 --- a/client/src/com/apm/client/commands/project/processes/IOSEntitlementsMergeProcess.as +++ b/client/src/com/apm/client/commands/project/processes/IOSEntitlementsMergeProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 23/8/21 + * @created 23/8/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/IOSPlistMergeProcess.as b/client/src/com/apm/client/commands/project/processes/IOSPlistMergeProcess.as index 06cc5a0..f764b91 100644 --- a/client/src/com/apm/client/commands/project/processes/IOSPlistMergeProcess.as +++ b/client/src/com/apm/client/commands/project/processes/IOSPlistMergeProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 10/9/21 + * @created 10/9/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/ProjectAddProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectAddProcess.as new file mode 100644 index 0000000..e68dc95 --- /dev/null +++ b/client/src/com/apm/client/commands/project/processes/ProjectAddProcess.as @@ -0,0 +1,116 @@ +/** + * __ __ __ + * ____/ /_ ____/ /______ _ ___ / /_ + * / __ / / ___/ __/ ___/ / __ `/ __/ + * / /_/ / (__ ) / / / / / /_/ / / + * \__,_/_/____/_/ /_/ /_/\__, /_/ + * / / + * \/ + * http://distriqt.com + * + * @author Michael Archbold (https://github.com/marchbold) + * @created 16/6/2023 + */ +package com.apm.client.commands.project.processes +{ + import com.apm.client.APM; + import com.apm.client.processes.ProcessBase; + import com.apm.data.project.ProjectDefinition; + import com.apm.data.common.Platform; + + public class ProjectAddProcess extends ProcessBase + { + //////////////////////////////////////////////////////// + // CONSTANTS + // + + private static const TAG:String = "ProjectSetProcess"; + + + //////////////////////////////////////////////////////// + // VARIABLES + // + + + private var _paramName:String; + private var _paramValue:String; + + + //////////////////////////////////////////////////////// + // FUNCTIONALITY + // + + public function ProjectAddProcess( paramName:String, paramValue:String ) + { + _paramName = paramName; + _paramValue = paramValue; + } + + + override public function start( completeCallback:Function = null, failureCallback:Function = null ):void + { + super.start( completeCallback, failureCallback ); + + var project:ProjectDefinition = APM.config.projectDefinition; + if (project == null) + { + failure( "No project file found" ); + return; + } + + if (_paramName == null) + { + failure( "No parameter name specified" ); + return; + } + else if (_paramValue == null) + { + var value:String = APM.io.question( "Add", _paramName ); + addProjectValue( project, _paramName, value ) + } + else + { + addProjectValue( project, _paramName, _paramValue ) + } + + project.save(); + complete(); + } + + + private function addProjectValue( project:ProjectDefinition, name:String, value:String ):void + { + switch (_paramName) + { + case "platforms": + { + var platformName:String = value.toLowerCase(); + if (!Platform.isKnownPlatformName(platformName)) + { + APM.io.writeError( name, "Invalid platform name" ); + return; + } + + for each (var platform:Platform in project.platforms) + { + if (platform.name == platformName) + { + APM.io.writeError( name, "This value already exists" ); + return; + } + } + + project.platforms.push( new Platform( platformName, true ) ); + break; + } + default: + { + APM.io.writeError( name, "This parameter is not an array or is invalid" ); + } + } + } + + + } + +} diff --git a/client/src/com/apm/client/commands/project/processes/ProjectConfigDescribeProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectConfigDescribeProcess.as index 0061e89..82429ef 100644 --- a/client/src/com/apm/client/commands/project/processes/ProjectConfigDescribeProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ProjectConfigDescribeProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/10/21 + * @created 22/10/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/ProjectConfigGetProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectConfigGetProcess.as index d9dc9ef..b9a3b9c 100644 --- a/client/src/com/apm/client/commands/project/processes/ProjectConfigGetProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ProjectConfigGetProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/10/21 + * @created 22/10/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/ProjectConfigSetProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectConfigSetProcess.as index 2e88784..b88463e 100644 --- a/client/src/com/apm/client/commands/project/processes/ProjectConfigSetProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ProjectConfigSetProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/10/21 + * @created 22/10/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/ProjectDefinitionCreateProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectDefinitionCreateProcess.as index ae2d99a..ece43a7 100644 --- a/client/src/com/apm/client/commands/project/processes/ProjectDefinitionCreateProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ProjectDefinitionCreateProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/ProjectDefinitionImportGetExtensionProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectDefinitionImportGetExtensionProcess.as index e0949ad..237acbe 100644 --- a/client/src/com/apm/client/commands/project/processes/ProjectDefinitionImportGetExtensionProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ProjectDefinitionImportGetExtensionProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 29/9/21 + * @created 29/9/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/ProjectDefinitionImportProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectDefinitionImportProcess.as index 5d861d4..47c6310 100644 --- a/client/src/com/apm/client/commands/project/processes/ProjectDefinitionImportProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ProjectDefinitionImportProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 29/9/21 + * @created 29/9/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/ProjectGetProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectGetProcess.as index 71ffb2d..d69a436 100644 --- a/client/src/com/apm/client/commands/project/processes/ProjectGetProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ProjectGetProcess.as @@ -17,6 +17,7 @@ package com.apm.client.commands.project.processes import com.apm.client.processes.ProcessBase; import com.apm.data.project.ProjectDefinition; import com.apm.data.project.ProjectParameter; + import com.apm.data.common.Platform; public class ProjectGetProcess extends ProcessBase { @@ -66,9 +67,24 @@ package com.apm.client.commands.project.processes APM.io.writeValue( "version", project.getVersion( APM.config.buildType ) ); APM.io.writeValue( "versionLabel", project.getVersionLabel( APM.config.buildType ) ); + APM.io.writeLine( "platforms" ); + if (project.platforms.length == 0) + { + APM.io.writeLine( "└── (all)" ); + } + else + { + for (var p:int = 0; p < project.platforms.length; p++) + { + APM.io.writeLine( + (p == project.platforms.length - 1 ? "└──" : "├──") + + project.platforms[p].toString() ); + } + } + APM.io.writeLine( "" ); APM.io.writeLine( "configuration" ); - for each (var param:ProjectParameter in APM.config.projectDefinition.getConfiguration( APM.config.buildType )) + for each (var param:ProjectParameter in project.getConfiguration( APM.config.buildType )) { APM.io.writeValue( param.name, param.value ); } @@ -81,11 +97,11 @@ package com.apm.client.commands.project.processes } else { - for (var i:int = 0; i < project.dependencies.length; i++) + for (var d:int = 0; d < project.dependencies.length; d++) { APM.io.writeLine( - (i == project.dependencies.length - 1 ? "└──" : "├──") + - project.dependencies[i].toString() ); + (d == project.dependencies.length - 1 ? "└──" : "├──") + + project.dependencies[d].toString() ); } } } diff --git a/client/src/com/apm/client/commands/project/processes/ProjectSetProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectSetProcess.as index 70f0b33..35ac9cb 100644 --- a/client/src/com/apm/client/commands/project/processes/ProjectSetProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ProjectSetProcess.as @@ -15,11 +15,8 @@ package com.apm.client.commands.project.processes { import com.apm.client.APM; import com.apm.client.processes.ProcessBase; - import com.apm.data.packages.PackageDefinitionFile; - import com.apm.data.packages.PackageParameter; import com.apm.data.project.ProjectDefinition; - import com.apm.data.project.ProjectParameter; - import com.apm.utils.ProjectPackageCache; + import com.apm.data.common.Platform; public class ProjectSetProcess extends ProcessBase { @@ -111,6 +108,22 @@ package com.apm.client.commands.project.processes project.setVersionLabel( value, APM.config.buildType ); break; } + case "platforms": + { + project.platforms.length = 0; + var platforms:Array = value.split( "," ); + for each (var platform:String in platforms) + { + if (!Platform.isKnownPlatformName(platform)) + { + APM.io.writeError( name, "Invalid platform name: " + platform ); + continue; + } + + project.platforms.push( new Platform( platform, true ) ); + } + break; + } default: { APM.io.writeError( name, "Invalid project parameter name" ); diff --git a/client/src/com/apm/client/commands/project/processes/ValidatePackageCacheProcess.as b/client/src/com/apm/client/commands/project/processes/ValidatePackageCacheProcess.as index c4f73ee..807e927 100644 --- a/client/src/com/apm/client/commands/project/processes/ValidatePackageCacheProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ValidatePackageCacheProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 29/9/21 + * @created 29/9/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/commands/project/processes/ValidateProjectParametersProcess.as b/client/src/com/apm/client/commands/project/processes/ValidateProjectParametersProcess.as index 76b607b..867f040 100644 --- a/client/src/com/apm/client/commands/project/processes/ValidateProjectParametersProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ValidateProjectParametersProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 29/9/21 + * @created 29/9/2021 */ package com.apm.client.commands.project.processes { diff --git a/client/src/com/apm/client/config/RunConfig.as b/client/src/com/apm/client/config/RunConfig.as index b0da2c6..bfb6307 100644 --- a/client/src/com/apm/client/config/RunConfig.as +++ b/client/src/com/apm/client/config/RunConfig.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.config { @@ -45,8 +45,9 @@ package com.apm.client.config private static const TAG:String = "RunConfig"; - public static const DEFAULT_REPOSITORY_URL:String = "https://repository.airsdk.dev"; - + public static const DEFAULT_REPOSITORY_URL:String = "http://localhost:3000"; +// public static const DEFAULT_REPOSITORY_URL:String = "https://repository.airsdk.dev"; + //////////////////////////////////////////////////////// // VARIABLES diff --git a/client/src/com/apm/client/config/processes/CheckNetworkProcess.as b/client/src/com/apm/client/config/processes/CheckNetworkProcess.as index 6b45f2e..3d6d8d7 100644 --- a/client/src/com/apm/client/config/processes/CheckNetworkProcess.as +++ b/client/src/com/apm/client/config/processes/CheckNetworkProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.config.processes { diff --git a/client/src/com/apm/client/config/processes/DebugDelayProcess.as b/client/src/com/apm/client/config/processes/DebugDelayProcess.as index 1eaaa3b..75a2d71 100644 --- a/client/src/com/apm/client/config/processes/DebugDelayProcess.as +++ b/client/src/com/apm/client/config/processes/DebugDelayProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 4/6/21 + * @created 4/6/2021 */ package com.apm.client.config.processes { diff --git a/client/src/com/apm/client/config/processes/LoadMacOSEnvironmentVariablesProcess.as b/client/src/com/apm/client/config/processes/LoadMacOSEnvironmentVariablesProcess.as index 3deb2a0..14b40ce 100644 --- a/client/src/com/apm/client/config/processes/LoadMacOSEnvironmentVariablesProcess.as +++ b/client/src/com/apm/client/config/processes/LoadMacOSEnvironmentVariablesProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.config.processes { diff --git a/client/src/com/apm/client/config/processes/LoadMacOSJavaHomeProcess.as b/client/src/com/apm/client/config/processes/LoadMacOSJavaHomeProcess.as index 7a0f4ae..262daa9 100644 --- a/client/src/com/apm/client/config/processes/LoadMacOSJavaHomeProcess.as +++ b/client/src/com/apm/client/config/processes/LoadMacOSJavaHomeProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.config.processes { diff --git a/client/src/com/apm/client/config/processes/LoadProjectDefinitionProcess.as b/client/src/com/apm/client/config/processes/LoadProjectDefinitionProcess.as index e5c9d9b..f3a2a96 100644 --- a/client/src/com/apm/client/config/processes/LoadProjectDefinitionProcess.as +++ b/client/src/com/apm/client/config/processes/LoadProjectDefinitionProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.config.processes { diff --git a/client/src/com/apm/client/config/processes/LoadUserSettingsProcess.as b/client/src/com/apm/client/config/processes/LoadUserSettingsProcess.as index 16943d8..b1200eb 100644 --- a/client/src/com/apm/client/config/processes/LoadUserSettingsProcess.as +++ b/client/src/com/apm/client/config/processes/LoadUserSettingsProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.config.processes { diff --git a/client/src/com/apm/client/config/processes/LoadWindowsEnvironmentVariablesProcess.as b/client/src/com/apm/client/config/processes/LoadWindowsEnvironmentVariablesProcess.as index b8f5969..c333338 100644 --- a/client/src/com/apm/client/config/processes/LoadWindowsEnvironmentVariablesProcess.as +++ b/client/src/com/apm/client/config/processes/LoadWindowsEnvironmentVariablesProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.config.processes { diff --git a/client/src/com/apm/client/config/processes/LoadWindowsJavaHomeProcess.as b/client/src/com/apm/client/config/processes/LoadWindowsJavaHomeProcess.as index ed4a9e9..6da598f 100644 --- a/client/src/com/apm/client/config/processes/LoadWindowsJavaHomeProcess.as +++ b/client/src/com/apm/client/config/processes/LoadWindowsJavaHomeProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.config.processes { diff --git a/client/src/com/apm/client/config/processes/LoadWindowsPowershellVersionProcess.as b/client/src/com/apm/client/config/processes/LoadWindowsPowershellVersionProcess.as index 1d1a4b9..cd8b7b0 100644 --- a/client/src/com/apm/client/config/processes/LoadWindowsPowershellVersionProcess.as +++ b/client/src/com/apm/client/config/processes/LoadWindowsPowershellVersionProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.config.processes { diff --git a/client/src/com/apm/client/events/APMEvent.as b/client/src/com/apm/client/events/APMEvent.as index 1cf8b06..d25b3bc 100644 --- a/client/src/com/apm/client/events/APMEvent.as +++ b/client/src/com/apm/client/events/APMEvent.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.events { diff --git a/client/src/com/apm/client/events/CommandEvent.as b/client/src/com/apm/client/events/CommandEvent.as index e9ca1d6..815290b 100644 --- a/client/src/com/apm/client/events/CommandEvent.as +++ b/client/src/com/apm/client/events/CommandEvent.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.events { diff --git a/client/src/com/apm/client/io/IO.as b/client/src/com/apm/client/io/IO.as index 4a7c74b..deeea2a 100644 --- a/client/src/com/apm/client/io/IO.as +++ b/client/src/com/apm/client/io/IO.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.io { diff --git a/client/src/com/apm/client/io/IOColour.as b/client/src/com/apm/client/io/IOColour.as index 7b6e69e..8c38e9b 100644 --- a/client/src/com/apm/client/io/IOColour.as +++ b/client/src/com/apm/client/io/IOColour.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/10/21 + * @created 22/10/2021 */ package com.apm.client.io { diff --git a/client/src/com/apm/client/io/IO_MacOS.as b/client/src/com/apm/client/io/IO_MacOS.as index 78d2510..2a7086e 100644 --- a/client/src/com/apm/client/io/IO_MacOS.as +++ b/client/src/com/apm/client/io/IO_MacOS.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.io { diff --git a/client/src/com/apm/client/io/IO_Windows.as b/client/src/com/apm/client/io/IO_Windows.as index e70a824..b11ffa7 100644 --- a/client/src/com/apm/client/io/IO_Windows.as +++ b/client/src/com/apm/client/io/IO_Windows.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.client.io { diff --git a/client/src/com/apm/client/logging/Log.as b/client/src/com/apm/client/logging/Log.as index 09dd21d..3085712 100644 --- a/client/src/com/apm/client/logging/Log.as +++ b/client/src/com/apm/client/logging/Log.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.logging { diff --git a/client/src/com/apm/client/processes/Process.as b/client/src/com/apm/client/processes/Process.as index a194e36..b85f702 100644 --- a/client/src/com/apm/client/processes/Process.as +++ b/client/src/com/apm/client/processes/Process.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.processes { diff --git a/client/src/com/apm/client/processes/ProcessBase.as b/client/src/com/apm/client/processes/ProcessBase.as index 19ae20a..7cf4d0c 100644 --- a/client/src/com/apm/client/processes/ProcessBase.as +++ b/client/src/com/apm/client/processes/ProcessBase.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.client.processes { diff --git a/client/src/com/apm/client/processes/ProcessCallback.as b/client/src/com/apm/client/processes/ProcessCallback.as index fed019f..abb7026 100644 --- a/client/src/com/apm/client/processes/ProcessCallback.as +++ b/client/src/com/apm/client/processes/ProcessCallback.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/6/21 + * @created 22/6/2021 */ package com.apm.client.processes { diff --git a/client/src/com/apm/client/processes/ProcessQueue.as b/client/src/com/apm/client/processes/ProcessQueue.as index b3f0fa6..9d91da8 100644 --- a/client/src/com/apm/client/processes/ProcessQueue.as +++ b/client/src/com/apm/client/processes/ProcessQueue.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 31/5/21 + * @created 31/5/2021 */ package com.apm.client.processes { diff --git a/client/src/com/apm/client/processes/events/ProcessEvent.as b/client/src/com/apm/client/processes/events/ProcessEvent.as index 6fd4cb2..33ad82c 100644 --- a/client/src/com/apm/client/processes/events/ProcessEvent.as +++ b/client/src/com/apm/client/processes/events/ProcessEvent.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 31/5/21 + * @created 31/5/2021 */ package com.apm.client.processes.events { diff --git a/client/src/com/apm/client/processes/generic/ChecksumAS3Process.as b/client/src/com/apm/client/processes/generic/ChecksumAS3Process.as index 8eac5b4..218ed76 100644 --- a/client/src/com/apm/client/processes/generic/ChecksumAS3Process.as +++ b/client/src/com/apm/client/processes/generic/ChecksumAS3Process.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 13/8/21 + * @created 13/8/2021 */ package com.apm.client.processes.generic { diff --git a/client/src/com/apm/client/processes/generic/ChecksumMacOSProcess.as b/client/src/com/apm/client/processes/generic/ChecksumMacOSProcess.as index d963c67..ca0452c 100644 --- a/client/src/com/apm/client/processes/generic/ChecksumMacOSProcess.as +++ b/client/src/com/apm/client/processes/generic/ChecksumMacOSProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 13/8/21 + * @created 13/8/2021 */ package com.apm.client.processes.generic { diff --git a/client/src/com/apm/client/processes/generic/ChecksumProcess.as b/client/src/com/apm/client/processes/generic/ChecksumProcess.as index c100628..a8d4124 100644 --- a/client/src/com/apm/client/processes/generic/ChecksumProcess.as +++ b/client/src/com/apm/client/processes/generic/ChecksumProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 13/8/21 + * @created 13/8/2021 */ package com.apm.client.processes.generic { diff --git a/client/src/com/apm/client/processes/generic/ChecksumWindowsProcess.as b/client/src/com/apm/client/processes/generic/ChecksumWindowsProcess.as index 07fe0ea..e132c51 100644 --- a/client/src/com/apm/client/processes/generic/ChecksumWindowsProcess.as +++ b/client/src/com/apm/client/processes/generic/ChecksumWindowsProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 13/8/21 + * @created 13/8/2021 */ package com.apm.client.processes.generic { diff --git a/client/src/com/apm/client/processes/generic/ExtractZipAS3Process.as b/client/src/com/apm/client/processes/generic/ExtractZipAS3Process.as index 488d792..10db327 100644 --- a/client/src/com/apm/client/processes/generic/ExtractZipAS3Process.as +++ b/client/src/com/apm/client/processes/generic/ExtractZipAS3Process.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.processes.generic { diff --git a/client/src/com/apm/client/processes/generic/ExtractZipMacOSProcess.as b/client/src/com/apm/client/processes/generic/ExtractZipMacOSProcess.as index 2b10a6f..74daf6d 100644 --- a/client/src/com/apm/client/processes/generic/ExtractZipMacOSProcess.as +++ b/client/src/com/apm/client/processes/generic/ExtractZipMacOSProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.processes.generic { diff --git a/client/src/com/apm/client/processes/generic/ExtractZipProcess.as b/client/src/com/apm/client/processes/generic/ExtractZipProcess.as index ad65114..5529de6 100644 --- a/client/src/com/apm/client/processes/generic/ExtractZipProcess.as +++ b/client/src/com/apm/client/processes/generic/ExtractZipProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.processes.generic { diff --git a/client/src/com/apm/client/processes/generic/ExtractZipWindowsProcess.as b/client/src/com/apm/client/processes/generic/ExtractZipWindowsProcess.as index 4ffef40..e7621c0 100644 --- a/client/src/com/apm/client/processes/generic/ExtractZipWindowsProcess.as +++ b/client/src/com/apm/client/processes/generic/ExtractZipWindowsProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/5/21 + * @created 28/5/2021 */ package com.apm.client.processes.generic { diff --git a/client/src/com/apm/client/processes/upgrade/UpgradeClientDownloadProcess.as b/client/src/com/apm/client/processes/upgrade/UpgradeClientDownloadProcess.as index 06214e0..70615ec 100644 --- a/client/src/com/apm/client/processes/upgrade/UpgradeClientDownloadProcess.as +++ b/client/src/com/apm/client/processes/upgrade/UpgradeClientDownloadProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 8/9/21 + * @created 8/9/2021 */ package com.apm.client.processes.upgrade { diff --git a/client/src/com/apm/client/processes/upgrade/UpgradeClientFinaliseProcess.as b/client/src/com/apm/client/processes/upgrade/UpgradeClientFinaliseProcess.as index 6506677..56da23d 100644 --- a/client/src/com/apm/client/processes/upgrade/UpgradeClientFinaliseProcess.as +++ b/client/src/com/apm/client/processes/upgrade/UpgradeClientFinaliseProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 8/9/21 + * @created 8/9/2021 */ package com.apm.client.processes.upgrade { diff --git a/client/src/com/apm/client/processes/upgrade/UpgradeClientProcess.as b/client/src/com/apm/client/processes/upgrade/UpgradeClientProcess.as index 60b81d6..ef3074e 100644 --- a/client/src/com/apm/client/processes/upgrade/UpgradeClientProcess.as +++ b/client/src/com/apm/client/processes/upgrade/UpgradeClientProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 8/9/21 + * @created 8/9/2021 */ package com.apm.client.processes.upgrade { diff --git a/client/src/com/apm/client/repositories/PackageResolver.as b/client/src/com/apm/client/repositories/PackageResolver.as index b14f745..3926472 100644 --- a/client/src/com/apm/client/repositories/PackageResolver.as +++ b/client/src/com/apm/client/repositories/PackageResolver.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/9/21 + * @created 15/9/2021 */ package com.apm.client.repositories { diff --git a/client/src/com/apm/client/repositories/PackageResolverResult.as b/client/src/com/apm/client/repositories/PackageResolverResult.as index b5217ad..6b2088b 100644 --- a/client/src/com/apm/client/repositories/PackageResolverResult.as +++ b/client/src/com/apm/client/repositories/PackageResolverResult.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/9/21 + * @created 15/9/2021 */ package com.apm.client.repositories { diff --git a/client/src/com/apm/client/repositories/RepositoryResolver.as b/client/src/com/apm/client/repositories/RepositoryResolver.as index 87847bb..f076b94 100644 --- a/client/src/com/apm/client/repositories/RepositoryResolver.as +++ b/client/src/com/apm/client/repositories/RepositoryResolver.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 17/9/21 + * @created 17/9/2021 */ package com.apm.client.repositories { diff --git a/client/src/com/apm/client/repositories/processes/RepositoryGetPackageVersionProcess.as b/client/src/com/apm/client/repositories/processes/RepositoryGetPackageVersionProcess.as index 81840be..4609e3d 100644 --- a/client/src/com/apm/client/repositories/processes/RepositoryGetPackageVersionProcess.as +++ b/client/src/com/apm/client/repositories/processes/RepositoryGetPackageVersionProcess.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/9/21 + * @created 15/9/2021 */ package com.apm.client.repositories.processes { diff --git a/client/src/com/apm/data/common/Platform.as b/client/src/com/apm/data/common/Platform.as new file mode 100644 index 0000000..1d91a2d --- /dev/null +++ b/client/src/com/apm/data/common/Platform.as @@ -0,0 +1,119 @@ +/** + * __ __ __ + * ____/ /_ ____/ /______ _ ___ / /_ + * / __ / / ___/ __/ ___/ / __ `/ __/ + * / /_/ / (__ ) / / / / / /_/ / / + * \__,_/_/____/_/ /_/ /_/\__, /_/ + * / / + * \/ + * http://distriqt.com + * + * @author Michael Archbold (https://github.com/marchbold) + * @created 9/6/2023 + */ +package com.apm.data.common +{ + public class Platform + { + //////////////////////////////////////////////////////// + // CONSTANTS + // + + private static const TAG:String = "Platform"; + + public static const ANDROID:String = "android"; + public static const IOS:String = "ios"; + public static const MACOS:String = "macos"; + public static const WINDOWS:String = "windows"; + public static const LINUX:String = "linux"; + public static const COMMON:String = "common"; + public static const UNSPECIFIED:String = "unspecified"; + + + //////////////////////////////////////////////////////// + // VARIABLES + // + + public var name:String = UNSPECIFIED; + + private var _singleLineOutput:Boolean = false; + + + //////////////////////////////////////////////////////// + // FUNCTIONALITY + // + + public function Platform( name:String = "", singleLineOutput:Boolean = false ) + { + this.name = name; + this._singleLineOutput = singleLineOutput; + } + + + public function equals( p:Platform ):Boolean + { + return (p.name == name); + } + + + public function toString():String + { + return name; + } + + + public static function isKnownPlatformName( platform:String ):Boolean + { + switch (platform) + { + case ANDROID: + case IOS: + case MACOS: + case WINDOWS: + case LINUX: + return true; + } + return false; + } + + + public function toObject( forceObjectOutput:Boolean = false ):Object + { + if (_singleLineOutput && !forceObjectOutput) + { + return name; + } + else + { + var data:Object = { + name: name + }; + return data; + } + } + + + public static function fromObject( data:Object ):Platform + { + if (data == null) + return null; + + var platform:Platform = new Platform(); + if (data is String) + { + // single line format + platform._singleLineOutput = true; + platform.name = String( data ); + } + else + { + platform._singleLineOutput = false; + if (data.hasOwnProperty( "name" )) platform.name = data["name"]; + } + return platform; + } + + + } + +} diff --git a/client/src/com/apm/data/install/InstallData.as b/client/src/com/apm/data/install/InstallData.as index aa5170d..758ab63 100644 --- a/client/src/com/apm/data/install/InstallData.as +++ b/client/src/com/apm/data/install/InstallData.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/6/21 + * @created 18/6/2021 */ package com.apm.data.install { diff --git a/client/src/com/apm/data/install/InstallPackageData.as b/client/src/com/apm/data/install/InstallPackageData.as index d93ce4b..dcdfdc6 100644 --- a/client/src/com/apm/data/install/InstallPackageData.as +++ b/client/src/com/apm/data/install/InstallPackageData.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/6/21 + * @created 18/6/2021 */ package com.apm.data.install { diff --git a/client/src/com/apm/data/install/InstallPackageDataGroup.as b/client/src/com/apm/data/install/InstallPackageDataGroup.as index 9ede190..322fcf1 100644 --- a/client/src/com/apm/data/install/InstallPackageDataGroup.as +++ b/client/src/com/apm/data/install/InstallPackageDataGroup.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/6/21 + * @created 18/6/2021 */ package com.apm.data.install { diff --git a/client/src/com/apm/data/install/InstallRequest.as b/client/src/com/apm/data/install/InstallRequest.as index c56061a..bfedc67 100644 --- a/client/src/com/apm/data/install/InstallRequest.as +++ b/client/src/com/apm/data/install/InstallRequest.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/6/21 + * @created 18/6/2021 */ package com.apm.data.install { diff --git a/client/src/com/apm/data/packages/PackageDefinition.as b/client/src/com/apm/data/packages/PackageDefinition.as index 0ca83d3..bcfcb79 100644 --- a/client/src/com/apm/data/packages/PackageDefinition.as +++ b/client/src/com/apm/data/packages/PackageDefinition.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 9/6/21 + * @created 9/6/2021 */ package com.apm.data.packages { diff --git a/client/src/com/apm/data/packages/PackageDefinitionFile.as b/client/src/com/apm/data/packages/PackageDefinitionFile.as index 22b06dc..03c423c 100644 --- a/client/src/com/apm/data/packages/PackageDefinitionFile.as +++ b/client/src/com/apm/data/packages/PackageDefinitionFile.as @@ -9,12 +9,13 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 24/6/21 + * @created 24/6/2021 */ package com.apm.data.packages { import com.apm.SemVer; import com.apm.SemVerRange; + import com.apm.data.common.Platform; import com.apm.utils.JSONUtils; import flash.filesystem.File; @@ -118,6 +119,16 @@ package com.apm.data.packages _packageVersion.parameters.push( new PackageParameter().fromObject( param ) ); } } + + if (data.hasOwnProperty( "platforms" )) + { + for each (var platform:Object in data.platforms) + { + var p:Platform = Platform.fromObject( platform ); + if (p != null) + _packageVersion.platforms.push( p ); + } + } if (data.hasOwnProperty( "dependencies" )) { @@ -195,6 +206,13 @@ package com.apm.data.packages params.push( param.toObject( forceObjectOutput ) ); } data.parameters = params; + + var platforms:Array = []; + for each (var platform:Platform in _packageVersion.platforms) + { + platforms.push( platform.toObject( forceObjectOutput )); + } + data.platforms = platforms; var tags:Array = []; for each (var tag:String in _packageDef.tags) diff --git a/client/src/com/apm/data/packages/PackageDependency.as b/client/src/com/apm/data/packages/PackageDependency.as index c81eff2..6c367b4 100644 --- a/client/src/com/apm/data/packages/PackageDependency.as +++ b/client/src/com/apm/data/packages/PackageDependency.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 31/5/21 + * @created 31/5/2021 */ package com.apm.data.packages { diff --git a/client/src/com/apm/data/packages/PackageIdentifier.as b/client/src/com/apm/data/packages/PackageIdentifier.as index cb8ad66..7b92173 100644 --- a/client/src/com/apm/data/packages/PackageIdentifier.as +++ b/client/src/com/apm/data/packages/PackageIdentifier.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 13/8/21 + * @created 13/8/2021 */ package com.apm.data.packages { diff --git a/client/src/com/apm/data/packages/PackageLicense.as b/client/src/com/apm/data/packages/PackageLicense.as index 9a78b12..9bb41fe 100644 --- a/client/src/com/apm/data/packages/PackageLicense.as +++ b/client/src/com/apm/data/packages/PackageLicense.as @@ -10,7 +10,7 @@ * * @brief * @author marchbold - * @created 30/7/21 + * @created 30/7/2021 * @copyright http://distriqt.com/copyright/license.txt */ package com.apm.data.packages diff --git a/client/src/com/apm/data/packages/PackageParameter.as b/client/src/com/apm/data/packages/PackageParameter.as index 8c3bcaf..ea44679 100644 --- a/client/src/com/apm/data/packages/PackageParameter.as +++ b/client/src/com/apm/data/packages/PackageParameter.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/6/21 + * @created 15/6/2021 */ package com.apm.data.packages { diff --git a/client/src/com/apm/data/packages/PackageVersion.as b/client/src/com/apm/data/packages/PackageVersion.as index 2c20df7..7ba04a4 100644 --- a/client/src/com/apm/data/packages/PackageVersion.as +++ b/client/src/com/apm/data/packages/PackageVersion.as @@ -9,12 +9,13 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 9/6/21 + * @created 9/6/2021 */ package com.apm.data.packages { import com.apm.SemVer; import com.apm.SemVerRange; + import com.apm.data.common.Platform; public class PackageVersion { @@ -39,6 +40,7 @@ package com.apm.data.packages public var parameters:Vector. = new Vector.(); public var dependencies:Vector. = new Vector.(); + public var platforms:Vector. = new Vector.(); public var source:String = null; @@ -78,7 +80,9 @@ package com.apm.data.packages { return version.toString() + " : " + publishedAt - + (isReleaseVersion() ? "" : " [" + status + "]"); + + (isReleaseVersion() ? "" : " [" + status + "]") + + (platforms.length == 0 ? "" : " [" + platforms.join(",") + "]") + ; } @@ -116,6 +120,15 @@ package com.apm.data.packages { this.packageDef = new PackageDefinition().fromObject( data["package"] ); } + if (data.hasOwnProperty( "platforms" )) + { + for each (var platformObject:Object in data.platforms) + { + var p:Platform = Platform.fromObject( platformObject ); + if (p != null) + platforms.push( p ); + } + } } return this; } @@ -153,6 +166,13 @@ package com.apm.data.packages } data.parameters = parametersObject; + var platformsObject:Array = []; + for each (var platform:Platform in platforms) + { + platformsObject.push( platformsObject.toObject( forceObjectOutput ) ); + } + data.platforms = platformsObject; + return data; } diff --git a/client/src/com/apm/data/packages/RepositoryDefinition.as b/client/src/com/apm/data/packages/RepositoryDefinition.as index 3816715..6cd5a78 100644 --- a/client/src/com/apm/data/packages/RepositoryDefinition.as +++ b/client/src/com/apm/data/packages/RepositoryDefinition.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 31/5/21 + * @created 31/5/2021 */ package com.apm.data.packages { diff --git a/client/src/com/apm/data/project/ApplicationDescriptor.as b/client/src/com/apm/data/project/ApplicationDescriptor.as index 88497ef..7b2ca5a 100644 --- a/client/src/com/apm/data/project/ApplicationDescriptor.as +++ b/client/src/com/apm/data/project/ApplicationDescriptor.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 27/8/21 + * @created 27/8/2021 */ package com.apm.data.project { diff --git a/client/src/com/apm/data/project/ProjectBuildType.as b/client/src/com/apm/data/project/ProjectBuildType.as index 6b13b11..83ea411 100644 --- a/client/src/com/apm/data/project/ProjectBuildType.as +++ b/client/src/com/apm/data/project/ProjectBuildType.as @@ -10,7 +10,7 @@ * * @brief * @author marchbold - * @created 24/11/21 + * @created 24/11/2021 * @copyright http://distriqt.com/copyright/license.txt */ package com.apm.data.project @@ -46,7 +46,7 @@ package com.apm.data.project public function set applicationName( value:Object ):void { _applicationName = value; } private var _applicationFilename:String = null; - public function get applicationFilename(): String { return _applicationFilename; } + public function get applicationFilename():String { return _applicationFilename; } public function set applicationFilename( value:String ):void { _applicationFilename = value; } diff --git a/client/src/com/apm/data/project/ProjectDefinition.as b/client/src/com/apm/data/project/ProjectDefinition.as index 4076b3f..d63d95b 100644 --- a/client/src/com/apm/data/project/ProjectDefinition.as +++ b/client/src/com/apm/data/project/ProjectDefinition.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.data.project { @@ -18,6 +18,7 @@ package com.apm.data.project import com.apm.data.packages.PackageIdentifier; import com.apm.data.packages.PackageParameter; import com.apm.data.packages.PackageVersion; + import com.apm.data.common.Platform; import com.apm.data.packages.RepositoryDefinition; import com.apm.utils.JSONUtils; @@ -53,6 +54,7 @@ package com.apm.data.project private var _configuration:Vector.; private var _buildTypes:Vector.; private var _deployOptions:Object; + private var _platforms:Vector.; //////////////////////////////////////////////////////// @@ -68,6 +70,7 @@ package com.apm.data.project _configuration = new []; _buildTypes = new []; _deployOptions = {}; + _platforms = new []; } @@ -121,6 +124,17 @@ package com.apm.data.project { _deployOptions = _data.deployOptions; } + + if (_data.hasOwnProperty( "platforms" )) + { + for each (var platformObj:Object in _data.platforms) + { + var platform:Platform = Platform.fromObject( platformObj ); + if (platform != null) + _platforms.push( platform ); + } + } + } @@ -129,7 +143,7 @@ package com.apm.data.project var data:Object = toObject(); // Ensures the output JSON format is in a familiar order - var keyOrder:Array = [ "identifier", "name", "filename", "version", "versionLabel", "dependencies", "configuration", "buildTypes", "repositories" ]; + var keyOrder:Array = [ "identifier", "name", "filename", "version", "versionLabel", "platforms", "dependencies", "configuration", "buildTypes", "repositories" ]; var otherKeys:Array = JSONUtils.getMissingKeys( data, keyOrder ); otherKeys.sort(); @@ -147,6 +161,13 @@ package com.apm.data.project data["version"] = version; data["versionLabel"] = versionLabel; + var platformsArray:Array = []; + for each (var platform:Platform in _platforms) + { + platformsArray.push( platform.toObject() ); + } + data["platforms"] = platformsArray; + var repos:Array = []; for each (var repo:RepositoryDefinition in _repositories) { @@ -232,6 +253,15 @@ package com.apm.data.project return _dependencies; } + public function get platforms():Vector. + { + if (_platforms == null) + { + _platforms = new []; + } + return _platforms; + } + // // CONFIGURATION PARAMETERS @@ -666,6 +696,57 @@ package com.apm.data.project } + public function shouldIncludePlatform( platform:String ):Boolean + { + if (platform == null || !Platform.isKnownPlatformName(platform) ) + return true; + + // If the project doesn't specify platforms then include all platforms + if (platforms.length == 0) + return true; + + if (platform == "common") + return true; + + for each (var pa:Platform in platforms) + { + if (pa.name == platform) return true; + } + return false; + } + + + /** + * Checks whether the specified package version should be used with the + * current project platform configuration + */ + public function shouldIncludePackage( packageVersion:PackageVersion ):Boolean + { + // If the project doesn't specify platforms then include all packages + if (platforms.length == 0) + return true; + + // If the package doesn't specify platforms then include it in all + if (packageVersion.platforms.length == 0) + return true; + + return findMatch( packageVersion.platforms, platforms ); + } + + + private function findMatch( a:Vector., b:Vector. ):Boolean + { + for each (var pa:Platform in a) + { + for each (var pb:Platform in b) + { + if (pa.equals( pb )) return true; + } + } + return false; + } + + // // IO // diff --git a/client/src/com/apm/data/project/ProjectLock.as b/client/src/com/apm/data/project/ProjectLock.as index d761b10..8359f4c 100644 --- a/client/src/com/apm/data/project/ProjectLock.as +++ b/client/src/com/apm/data/project/ProjectLock.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.data.project { diff --git a/client/src/com/apm/data/project/ProjectParameter.as b/client/src/com/apm/data/project/ProjectParameter.as index 4385828..0a00d28 100644 --- a/client/src/com/apm/data/project/ProjectParameter.as +++ b/client/src/com/apm/data/project/ProjectParameter.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/10/21 + * @created 22/10/2021 */ package com.apm.data.project { diff --git a/client/src/com/apm/data/user/UserSettings.as b/client/src/com/apm/data/user/UserSettings.as index 900a7c1..cc6bc10 100644 --- a/client/src/com/apm/data/user/UserSettings.as +++ b/client/src/com/apm/data/user/UserSettings.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/6/21 + * @created 22/6/2021 */ package com.apm.data.user { diff --git a/client/src/com/apm/remote/airsdk/AIRSDKAPI.as b/client/src/com/apm/remote/airsdk/AIRSDKAPI.as index 221decd..beb93d3 100644 --- a/client/src/com/apm/remote/airsdk/AIRSDKAPI.as +++ b/client/src/com/apm/remote/airsdk/AIRSDKAPI.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 7/6/21 + * @created 7/6/2021 */ package com.apm.remote.airsdk { diff --git a/client/src/com/apm/remote/airsdk/AIRSDKBuild.as b/client/src/com/apm/remote/airsdk/AIRSDKBuild.as index 2469126..d35ab85 100644 --- a/client/src/com/apm/remote/airsdk/AIRSDKBuild.as +++ b/client/src/com/apm/remote/airsdk/AIRSDKBuild.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 7/6/21 + * @created 7/6/2021 */ package com.apm.remote.airsdk { diff --git a/client/src/com/apm/remote/airsdk/events/AIRSDKAPIEvent.as b/client/src/com/apm/remote/airsdk/events/AIRSDKAPIEvent.as index 3e13f07..9e3d9e4 100644 --- a/client/src/com/apm/remote/airsdk/events/AIRSDKAPIEvent.as +++ b/client/src/com/apm/remote/airsdk/events/AIRSDKAPIEvent.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 7/6/21 + * @created 7/6/2021 */ package com.apm.remote.airsdk.events { diff --git a/client/src/com/apm/remote/github/GitHubAPI.as b/client/src/com/apm/remote/github/GitHubAPI.as index 4510633..4bfc68f 100644 --- a/client/src/com/apm/remote/github/GitHubAPI.as +++ b/client/src/com/apm/remote/github/GitHubAPI.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/6/21 + * @created 28/6/2021 */ package com.apm.remote.github { diff --git a/client/src/com/apm/remote/repository/LocalRepository.as b/client/src/com/apm/remote/repository/LocalRepository.as index fe7cfe5..55caf3f 100644 --- a/client/src/com/apm/remote/repository/LocalRepository.as +++ b/client/src/com/apm/remote/repository/LocalRepository.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/9/21 + * @created 15/9/2021 */ package com.apm.remote.repository { diff --git a/client/src/com/apm/remote/repository/Repository.as b/client/src/com/apm/remote/repository/Repository.as index 4b62598..e3ee0a3 100644 --- a/client/src/com/apm/remote/repository/Repository.as +++ b/client/src/com/apm/remote/repository/Repository.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 15/9/21 + * @created 15/9/2021 */ package com.apm.remote.repository { diff --git a/client/src/com/apm/remote/repository/RepositoryAPI.as b/client/src/com/apm/remote/repository/RepositoryAPI.as index fbfdbe8..0332e63 100644 --- a/client/src/com/apm/remote/repository/RepositoryAPI.as +++ b/client/src/com/apm/remote/repository/RepositoryAPI.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 18/5/21 + * @created 18/5/2021 */ package com.apm.remote.repository { diff --git a/client/src/com/apm/remote/repository/RepositoryQueryOptions.as b/client/src/com/apm/remote/repository/RepositoryQueryOptions.as index f849df9..10a7553 100644 --- a/client/src/com/apm/remote/repository/RepositoryQueryOptions.as +++ b/client/src/com/apm/remote/repository/RepositoryQueryOptions.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 30/9/21 + * @created 30/9/2021 */ package com.apm.remote.repository { diff --git a/client/src/com/apm/utils/Checksum.as b/client/src/com/apm/utils/Checksum.as index b1ed8e1..c486ac0 100644 --- a/client/src/com/apm/utils/Checksum.as +++ b/client/src/com/apm/utils/Checksum.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 22/6/21 + * @created 22/6/2021 */ package com.apm.utils { diff --git a/client/src/com/apm/utils/DeployFileUtils.as b/client/src/com/apm/utils/DeployFileUtils.as index 3831872..0c81fb2 100644 --- a/client/src/com/apm/utils/DeployFileUtils.as +++ b/client/src/com/apm/utils/DeployFileUtils.as @@ -10,7 +10,7 @@ * * @brief * @author marchbold - * @created 13/7/21 + * @created 13/7/2021 * @copyright http://distriqt.com/copyright/license.txt */ package com.apm.utils diff --git a/client/src/com/apm/utils/FileUtils.as b/client/src/com/apm/utils/FileUtils.as index 266f7f0..b4eecc1 100644 --- a/client/src/com/apm/utils/FileUtils.as +++ b/client/src/com/apm/utils/FileUtils.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 24/6/21 + * @created 24/6/2021 */ package com.apm.utils { diff --git a/client/src/com/apm/utils/JSONUtils.as b/client/src/com/apm/utils/JSONUtils.as index 47a28a1..4354eeb 100644 --- a/client/src/com/apm/utils/JSONUtils.as +++ b/client/src/com/apm/utils/JSONUtils.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/6/21 + * @created 28/6/2021 */ package com.apm.utils { diff --git a/client/src/com/apm/utils/PackageFileUtils.as b/client/src/com/apm/utils/PackageFileUtils.as index fd61ff4..3f02673 100644 --- a/client/src/com/apm/utils/PackageFileUtils.as +++ b/client/src/com/apm/utils/PackageFileUtils.as @@ -10,7 +10,7 @@ * * @brief * @author marchbold - * @created 12/7/21 + * @created 12/7/2021 * @copyright http://distriqt.com/copyright/license.txt */ package com.apm.utils diff --git a/client/src/com/apm/utils/ProjectPackageCache.as b/client/src/com/apm/utils/ProjectPackageCache.as index c04ce45..3601042 100644 --- a/client/src/com/apm/utils/ProjectPackageCache.as +++ b/client/src/com/apm/utils/ProjectPackageCache.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 28/8/21 + * @created 28/8/2021 */ package com.apm.utils { diff --git a/client/src/com/apm/utils/WindowsShellPaths.as b/client/src/com/apm/utils/WindowsShellPaths.as index 4c523a9..33296f7 100644 --- a/client/src/com/apm/utils/WindowsShellPaths.as +++ b/client/src/com/apm/utils/WindowsShellPaths.as @@ -10,7 +10,7 @@ * * @brief * @author marchbold - * @created 24/11/21 + * @created 24/11/2021 * @copyright http://distriqt.com/copyright/license.txt */ package com.apm.utils diff --git a/client/src/com/apple/plist/Plist.as b/client/src/com/apple/plist/Plist.as index 9eefc20..7d03ccb 100644 --- a/client/src/com/apple/plist/Plist.as +++ b/client/src/com/apple/plist/Plist.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 10/9/21 + * @created 10/9/2021 */ package com.apple.plist { diff --git a/client/src/com/apple/plist/PlistUtils.as b/client/src/com/apple/plist/PlistUtils.as index 413a45f..221d9d7 100644 --- a/client/src/com/apple/plist/PlistUtils.as +++ b/client/src/com/apple/plist/PlistUtils.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 10/9/21 + * @created 10/9/2021 */ package com.apple.plist { diff --git a/client/src/com/apple/plist/entries/PlistArrayEntry.as b/client/src/com/apple/plist/entries/PlistArrayEntry.as index 9810c8f..e869db2 100644 --- a/client/src/com/apple/plist/entries/PlistArrayEntry.as +++ b/client/src/com/apple/plist/entries/PlistArrayEntry.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 10/9/21 + * @created 10/9/2021 */ package com.apple.plist.entries { diff --git a/client/src/com/apple/plist/entries/PlistBooleanEntry.as b/client/src/com/apple/plist/entries/PlistBooleanEntry.as index 7a83867..906d639 100644 --- a/client/src/com/apple/plist/entries/PlistBooleanEntry.as +++ b/client/src/com/apple/plist/entries/PlistBooleanEntry.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 10/9/21 + * @created 10/9/2021 */ package com.apple.plist.entries { diff --git a/client/src/com/apple/plist/entries/PlistCommentEntry.as b/client/src/com/apple/plist/entries/PlistCommentEntry.as index 7e5ab05..4c1ffca 100644 --- a/client/src/com/apple/plist/entries/PlistCommentEntry.as +++ b/client/src/com/apple/plist/entries/PlistCommentEntry.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 10/9/21 + * @created 10/9/2021 */ package com.apple.plist.entries { diff --git a/client/src/com/apple/plist/entries/PlistDictEntry.as b/client/src/com/apple/plist/entries/PlistDictEntry.as index 3af5904..7e671fe 100644 --- a/client/src/com/apple/plist/entries/PlistDictEntry.as +++ b/client/src/com/apple/plist/entries/PlistDictEntry.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 10/9/21 + * @created 10/9/2021 */ package com.apple.plist.entries { diff --git a/client/src/com/apple/plist/entries/PlistEntry.as b/client/src/com/apple/plist/entries/PlistEntry.as index f351e10..bc50b9d 100644 --- a/client/src/com/apple/plist/entries/PlistEntry.as +++ b/client/src/com/apple/plist/entries/PlistEntry.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 10/9/21 + * @created 10/9/2021 */ package com.apple.plist.entries { diff --git a/client/src/com/apple/plist/entries/PlistStringEntry.as b/client/src/com/apple/plist/entries/PlistStringEntry.as index b380f56..4371108 100644 --- a/client/src/com/apple/plist/entries/PlistStringEntry.as +++ b/client/src/com/apple/plist/entries/PlistStringEntry.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 10/9/21 + * @created 10/9/2021 */ package com.apple.plist.entries { diff --git a/client/src/org/as3commons/file/PropertiesFile.as b/client/src/org/as3commons/file/PropertiesFile.as index 9596153..88973e6 100644 --- a/client/src/org/as3commons/file/PropertiesFile.as +++ b/client/src/org/as3commons/file/PropertiesFile.as @@ -9,7 +9,7 @@ * http://distriqt.com * * @author Michael (https://github.com/marchbold) - * @created 5/10/21 + * @created 5/10/2021 */ package org.as3commons.file { From 73e3d9d36c58979763546a148d3b5e8d7689934d Mon Sep 17 00:00:00 2001 From: marchbold Date: Thu, 22 Jun 2023 13:16:10 +1000 Subject: [PATCH 2/2] feat(package): add a command to get and set some package parameters directly --- client/src/com/apm/client/APM.as | 4 +- .../commands/packages/PackageCommand.as | 178 ++++++++++++++++ .../packages/processes/PackageGetProcess.as | 200 ++++++++++++++++++ .../packages/processes/PackageSetProcess.as | 156 ++++++++++++++ .../project/processes/ProjectAddProcess.as | 2 +- client/src/com/apm/client/config/RunConfig.as | 4 +- .../data/packages/PackageDefinitionFile.as | 2 +- version.config | 4 +- 8 files changed, 543 insertions(+), 7 deletions(-) create mode 100644 client/src/com/apm/client/commands/packages/PackageCommand.as create mode 100644 client/src/com/apm/client/commands/packages/processes/PackageGetProcess.as create mode 100644 client/src/com/apm/client/commands/packages/processes/PackageSetProcess.as diff --git a/client/src/com/apm/client/APM.as b/client/src/com/apm/client/APM.as index 59e8735..9400e1b 100644 --- a/client/src/com/apm/client/APM.as +++ b/client/src/com/apm/client/APM.as @@ -27,6 +27,7 @@ package com.apm.client import com.apm.client.commands.packages.ListCommand; import com.apm.client.commands.packages.OutdatedCommand; import com.apm.client.commands.packages.PackageAddDependencyCommand; + import com.apm.client.commands.packages.PackageCommand; import com.apm.client.commands.packages.PublishCommand; import com.apm.client.commands.packages.SearchCommand; import com.apm.client.commands.packages.UninstallCommand; @@ -130,8 +131,9 @@ package com.apm.client addCommand( CreateCommand.NAME, CreateCommand ); addCommand( BuildCommand.NAME, BuildCommand ); addCommand( PublishCommand.NAME, PublishCommand ); + addCommand( PackageCommand.NAME, PackageCommand ); addCommand( PackageAddDependencyCommand.NAME, PackageAddDependencyCommand ); - + // air sdk commands addCommand( AIRSDKListCommand.NAME, AIRSDKListCommand ); addCommand( AIRSDKViewCommand.NAME, AIRSDKViewCommand ); diff --git a/client/src/com/apm/client/commands/packages/PackageCommand.as b/client/src/com/apm/client/commands/packages/PackageCommand.as new file mode 100644 index 0000000..f03dd3b --- /dev/null +++ b/client/src/com/apm/client/commands/packages/PackageCommand.as @@ -0,0 +1,178 @@ +/** + * __ __ __ + * ____/ /_ ____/ /______ _ ___ / /_ + * / __ / / ___/ __/ ___/ / __ `/ __/ + * / /_/ / (__ ) / / / / / /_/ / / + * \__,_/_/____/_/ /_/ /_/\__, /_/ + * / / + * \/ + * http://distriqt.com + * + * @author Michael Archbold (https://github.com/marchbold) + * @created 22/6/2023 + */ +package com.apm.client.commands.packages +{ + import com.apm.client.APM; + import com.apm.client.commands.Command; + import com.apm.client.commands.packages.processes.PackageGetProcess; + import com.apm.client.commands.packages.processes.PackageSetProcess; + import com.apm.client.events.CommandEvent; + import com.apm.client.logging.Log; + import com.apm.client.processes.ProcessQueue; + + import flash.events.EventDispatcher; + + public class PackageCommand extends EventDispatcher implements Command + { + + //////////////////////////////////////////////////////// + // CONSTANTS + // + + private static const TAG:String = "PackageCommand"; + + public static const NAME:String = "package"; + + + //////////////////////////////////////////////////////// + // VARIABLES + // + + private var _parameters:Array; + + + //////////////////////////////////////////////////////// + // FUNCTIONALITY + // + + public function PackageCommand() + { + super(); + _parameters = []; + } + + + public function setParameters( parameters:Array ):void + { + _parameters = parameters; + } + + + public function get name():String + { + return NAME; + } + + + public function get category():String + { + return ""; + } + + + public function get requiresNetwork():Boolean + { + return false; + } + + + public function get requiresProject():Boolean + { + return false; + } + + + public function get description():String + { + return "set a package parameter in a package under construction"; + } + + + public function get usage():String + { + return description + "\n" + + "\n" + + "apm package set set a package parameter (there must be a package.json in the working dir)\n"; + } + + + public function execute():void + { + Log.d( TAG, "execute(): [" + (_parameters.length > 0 ? _parameters.join( " " ) : " ") + "]\n" ); + try + { + var queue:ProcessQueue = new ProcessQueue(); + + if (_parameters.length > 0) + { + var subCommand:String = _parameters[0]; + switch (subCommand) + { + case "set": + { + if (_parameters.length < 2) + { + dispatchEvent( new CommandEvent( CommandEvent.PRINT_USAGE, name ) ); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR ) ); + return; + } + + queue.addProcess( new PackageSetProcess( + _parameters.length < 2 ? null : _parameters[1], + _parameters.length < 3 ? null : _parameters.slice( 2 ).join( " " ) + ) ); + + break + } + + case "get": + { + if (_parameters.length < 2) + { + queue.addProcess( new PackageGetProcess( null ) ); + } + else + { + queue.addProcess( new PackageGetProcess( _parameters[1] ) ); + } + break; + } + + default: + { + dispatchEvent( new CommandEvent( CommandEvent.PRINT_USAGE, name ) ); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR ) ); + return; + } + } + } + else + { + // print all config + queue.addProcess( new PackageGetProcess( null ) ); + } + + queue.start( + function ():void + { + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_OK ) ); + }, + function ( error:String ):void + { + APM.io.writeError( NAME, error ); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR ) ); + } + ); + } + catch (e:Error) + { + APM.io.error( e ); + dispatchEvent( new CommandEvent( CommandEvent.COMPLETE, APM.CODE_ERROR ) ); + } + + } + + } + +} diff --git a/client/src/com/apm/client/commands/packages/processes/PackageGetProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageGetProcess.as new file mode 100644 index 0000000..0b82099 --- /dev/null +++ b/client/src/com/apm/client/commands/packages/processes/PackageGetProcess.as @@ -0,0 +1,200 @@ +/** + * __ __ __ + * ____/ /_ ____/ /______ _ ___ / /_ + * / __ / / ___/ __/ ___/ / __ `/ __/ + * / /_/ / (__ ) / / / / / /_/ / / + * \__,_/_/____/_/ /_/ /_/\__, /_/ + * / / + * \/ + * http://distriqt.com + * + * @author Michael Archbold (https://github.com/marchbold) + * @created 22/6/2023 + */ +package com.apm.client.commands.packages.processes +{ + import com.apm.client.APM; + import com.apm.client.processes.ProcessBase; + import com.apm.data.packages.PackageDefinitionFile; + + import flash.filesystem.File; + + public class PackageGetProcess extends ProcessBase + { + //////////////////////////////////////////////////////// + // CONSTANTS + // + + private static const TAG:String = "PackageGetProcess"; + + + //////////////////////////////////////////////////////// + // VARIABLES + // + + private var _paramName:String; + + + //////////////////////////////////////////////////////// + // FUNCTIONALITY + // + + public function PackageGetProcess( paramName:String ) + { + _paramName = paramName; + } + + + override public function start( completeCallback:Function = null, failureCallback:Function = null ):void + { + super.start( completeCallback, failureCallback ); + + var packageDir:File = new File( APM.config.workingDirectory ); + var packageFile:File = packageDir.resolvePath( PackageDefinitionFile.DEFAULT_FILENAME ); + if (!packageFile.exists) + { + failure( "No package definition file found" ); + return; + } + + var packageDefinitionFile:PackageDefinitionFile = new PackageDefinitionFile().load( packageFile ); + + if (_paramName == null) + { + // print all config + APM.io.writeLine( packageDefinitionFile.packageDef.identifier + + "[" + packageDefinitionFile.packageDef.type + "]" + + "@" + packageDefinitionFile.version.version.toString() ); + + writeParam( packageDefinitionFile, "identifier" ); + writeParam( packageDefinitionFile, "type" ); + writeParam( packageDefinitionFile, "name" ); + writeParam( packageDefinitionFile, "version" ); + writeParam( packageDefinitionFile, "url" ); + writeParam( packageDefinitionFile, "docUrl" ); + APM.io.writeLine( "" ); + writeParam( packageDefinitionFile, "dependencies" ); + APM.io.writeLine( "" ); + writeParam( packageDefinitionFile, "tags" ); + APM.io.writeLine( "" ); + writeParam( packageDefinitionFile, "platforms" ); + + } + else + { + writeParam( packageDefinitionFile, _paramName ); + } + + complete(); + } + + private function writeParam( packageDefinitionFile:PackageDefinitionFile, paramName:String ):void + { + switch (paramName) + { + case "id": + case "identifier": + { + APM.io.writeValue( "identifier", packageDefinitionFile.packageDef.identifier ); + break; + } + + case "name": + { + APM.io.writeValue( "name", packageDefinitionFile.packageDef.name ); + break; + } + + case "version": + { + APM.io.writeValue( "version", packageDefinitionFile.version.version.toString() ); + break; + } + + case "url": + { + APM.io.writeValue( "url", packageDefinitionFile.packageDef.url ); + break; + } + + case "docUrl": + { + APM.io.writeValue( "docUrl", packageDefinitionFile.packageDef.docUrl ); + break; + } + + case "type": + { + APM.io.writeValue( "type", packageDefinitionFile.packageDef.type ); + break; + } + + case "platforms": + { + APM.io.writeLine( "platforms" ); + if (packageDefinitionFile.version.platforms.length == 0) + { + APM.io.writeLine( "└── (all)" ); + } + else + { + for (var p:int = 0; p < packageDefinitionFile.version.platforms.length; p++) + { + APM.io.writeLine( + (p == packageDefinitionFile.version.platforms.length - 1 ? "└──" : "├──") + + packageDefinitionFile.version.platforms[p].toString() ); + } + } + break; + } + + case "dependencies": + { + APM.io.writeLine( "" ); + APM.io.writeLine( "dependencies" ); + if (packageDefinitionFile.dependencies.length == 0) + { + APM.io.writeLine( "└── (none)" ); + } + else + { + for (var d:int = 0; d < packageDefinitionFile.dependencies.length; d++) + { + APM.io.writeLine( + (d == packageDefinitionFile.dependencies.length - 1 ? "└──" : "├──") + + packageDefinitionFile.dependencies[d].toString() ); + } + } + break; + } + + case "tags": + { + APM.io.writeLine( "tags" ); + if (packageDefinitionFile.packageDef.tags.length == 0) + { + APM.io.writeLine( "└── (none)" ); + } + else + { + for (var t:int = 0; t < packageDefinitionFile.packageDef.tags.length; t++) + { + APM.io.writeLine( + (t == packageDefinitionFile.packageDef.tags.length - 1 ? "└──" : "├──") + + packageDefinitionFile.packageDef.tags[t].toString() ); + } + } + break; + } + + default: + { + APM.io.writeError( "parameter", "not found" ); + break; + } + } + } + + } + +} diff --git a/client/src/com/apm/client/commands/packages/processes/PackageSetProcess.as b/client/src/com/apm/client/commands/packages/processes/PackageSetProcess.as new file mode 100644 index 0000000..db9930b --- /dev/null +++ b/client/src/com/apm/client/commands/packages/processes/PackageSetProcess.as @@ -0,0 +1,156 @@ +/** + * __ __ __ + * ____/ /_ ____/ /______ _ ___ / /_ + * / __ / / ___/ __/ ___/ / __ `/ __/ + * / /_/ / (__ ) / / / / / /_/ / / + * \__,_/_/____/_/ /_/ /_/\__, /_/ + * / / + * \/ + * http://distriqt.com + * + * @author Michael Archbold (https://github.com/marchbold) + * @created 22/6/2023 + */ +package com.apm.client.commands.packages.processes +{ + import com.apm.SemVer; + import com.apm.client.APM; + import com.apm.client.processes.ProcessBase; + import com.apm.data.common.Platform; + import com.apm.data.packages.PackageDefinitionFile; + + import flash.filesystem.File; + + public class PackageSetProcess extends ProcessBase + { + //////////////////////////////////////////////////////// + // CONSTANTS + // + + private static const TAG:String = "PackageSetProcess"; + + + //////////////////////////////////////////////////////// + // VARIABLES + // + + + private var _paramName:String; + private var _paramValue:String; + + + //////////////////////////////////////////////////////// + // FUNCTIONALITY + // + + public function PackageSetProcess( paramName:String, paramValue:String ) + { + _paramName = paramName; + _paramValue = paramValue; + } + + + override public function start( completeCallback:Function = null, failureCallback:Function = null ):void + { + super.start( completeCallback, failureCallback ); + + var packageDir:File = new File( APM.config.workingDirectory ); + var packageFile:File = packageDir.resolvePath( PackageDefinitionFile.DEFAULT_FILENAME ); + if (!packageFile.exists) + { + failure( "No package definition file found" ); + return; + } + + var packageDefinitionFile:PackageDefinitionFile = new PackageDefinitionFile().load( packageFile ); + if (_paramName == null) + { + failure( "No parameter name specified" ); + return; + } + else if (_paramValue == null) + { + var value:String = APM.io.question( "Set", _paramName ); + setPackageValue( packageDefinitionFile, _paramName, value ) + } + else + { + setPackageValue( packageDefinitionFile, _paramName, _paramValue ) + } + packageDefinitionFile.save(); + complete(); + } + + + private function setPackageValue( packageDefinitionFile:PackageDefinitionFile, name:String, value:String ):void + { + switch (_paramName) + { + case "id": + case "identifier": + { + packageDefinitionFile.packageDef.identifier = value; + break; + } + case "url": + { + packageDefinitionFile.packageDef.url = value; + break; + } + case "docUrl": + { + packageDefinitionFile.packageDef.docUrl = value; + break; + } + case "name": + { + packageDefinitionFile.packageDef.name = value; + break; + } + case "type": + { + packageDefinitionFile.packageDef.type = value; + break; + } + case "version": + { + packageDefinitionFile.version.version = SemVer.fromString( value ); + break; + } + case "platforms": + { + packageDefinitionFile.version.platforms.length = 0; + var platforms:Array = value.split( "," ); + for each (var platform:String in platforms) + { + if (!Platform.isKnownPlatformName( platform )) + { + APM.io.writeError( name, "Invalid platform name: " + platform ); + continue; + } + + packageDefinitionFile.version.platforms.push( new Platform( platform, true ) ); + } + break; + } + case "tags": + { + packageDefinitionFile.packageDef.tags.length = 0; + var tags:Array = value.split( "," ); + for each (var tag:String in tags) + { + packageDefinitionFile.packageDef.tags.push( tag ); + } + break; + } + default: + { + APM.io.writeError( name, "Invalid project parameter name" ); + } + } + } + + + } + +} diff --git a/client/src/com/apm/client/commands/project/processes/ProjectAddProcess.as b/client/src/com/apm/client/commands/project/processes/ProjectAddProcess.as index e68dc95..c6673db 100644 --- a/client/src/com/apm/client/commands/project/processes/ProjectAddProcess.as +++ b/client/src/com/apm/client/commands/project/processes/ProjectAddProcess.as @@ -24,7 +24,7 @@ package com.apm.client.commands.project.processes // CONSTANTS // - private static const TAG:String = "ProjectSetProcess"; + private static const TAG:String = "PackageSetProcess"; //////////////////////////////////////////////////////// diff --git a/client/src/com/apm/client/config/RunConfig.as b/client/src/com/apm/client/config/RunConfig.as index bfb6307..6ba30c2 100644 --- a/client/src/com/apm/client/config/RunConfig.as +++ b/client/src/com/apm/client/config/RunConfig.as @@ -45,8 +45,8 @@ package com.apm.client.config private static const TAG:String = "RunConfig"; - public static const DEFAULT_REPOSITORY_URL:String = "http://localhost:3000"; -// public static const DEFAULT_REPOSITORY_URL:String = "https://repository.airsdk.dev"; +// public static const DEFAULT_REPOSITORY_URL:String = "http://localhost:3000"; + public static const DEFAULT_REPOSITORY_URL:String = "https://repository.airsdk.dev"; //////////////////////////////////////////////////////// diff --git a/client/src/com/apm/data/packages/PackageDefinitionFile.as b/client/src/com/apm/data/packages/PackageDefinitionFile.as index 03c423c..a53668d 100644 --- a/client/src/com/apm/data/packages/PackageDefinitionFile.as +++ b/client/src/com/apm/data/packages/PackageDefinitionFile.as @@ -163,7 +163,7 @@ package com.apm.data.packages var data:Object = toObject(); // Ensures the output JSON format is in a familiar order - var keyOrder:Array = ["id", "name", "url", "docUrl", "description", "type", "version", "sourceUrl", "publishedAt", "dependencies", "parameters", "tags"]; + var keyOrder:Array = ["id", "name", "url", "docUrl", "description", "type", "version", "sourceUrl", "publishedAt", "dependencies", "parameters", "tags", "platforms", "license", "purchaseUrl", "status"]; JSONUtils.addMissingKeys( data, keyOrder ); return JSON.stringify( data, keyOrder, 4 ) + "\n"; diff --git a/version.config b/version.config index 9f39c2c..7c71198 100644 --- a/version.config +++ b/version.config @@ -1,6 +1,6 @@ #Fri, 02 Jun 2023 12:13:05 +1000 version_major=1 -version_minor=5 -version_build=2 +version_minor=6 +version_build=0 version_preview=