Skip to content

Commit

Permalink
feature: mage-os support
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkwiecinski committed Jul 7, 2024
1 parent ad86638 commit 06a08e8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ public class Package { //NOPMD
public static String vendorModuleNameSeparator = "_";
public static String fqnSeparator = "\\";
public static String composerType = "project";
public static String mageOsFrameworkRootComposer = "vendor/mage-os/framework";
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

public enum MagentoVersion {

ENTERPRISE_EDITION("magento/product-enterprise-edition", 1, "Adobe Commerce"),
COMMUNITY_EDITION("magento/product-community-edition", 2, "Magento Open Source");
COMMUNITY_EDITION("magento/product-community-edition", 2, "Magento Open Source"),
MAGEOS_COMMUNITY_EDITION("mage-os/product-community-edition", 3, "Mage-OS Community Edition");

private final String name;
private final int priority;
Expand Down Expand Up @@ -52,9 +54,7 @@ public static List<MagentoVersion> getVersions() {
final List<MagentoVersion> versions = new ArrayList<>(
Arrays.asList(MagentoVersion.values())
);
versions.sort(
(version1, version2) -> version1.getPriority() > version2.getPriority() ? 1 : 0
);
versions.sort(Comparator.comparingInt(MagentoVersion::getPriority));

return versions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ private GetMagentoVersionUtil() {
if (MagentoVersion.ENTERPRISE_EDITION.getName().equals(name)) {
break;
}

if (MagentoVersion.MAGEOS_COMMUNITY_EDITION.getName().equals(name)) {
break;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public static boolean isMagentoFolderValid(final String path) {
) != null || VfsUtil.findRelativeFile(
file,
Package.frameworkRootGit.split(Package.V_FILE_SEPARATOR)
) != null || VfsUtil.findRelativeFile(
file,
Package.mageOsFrameworkRootComposer.split(Package.V_FILE_SEPARATOR)
) != null;
}

Expand Down

0 comments on commit 06a08e8

Please sign in to comment.