Skip to content

Commit 06a08e8

Browse files
feature: mage-os support
1 parent ad86638 commit 06a08e8

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

src/com/magento/idea/magento2plugin/magento/packages/Package.java

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ public class Package { //NOPMD
1919
public static String vendorModuleNameSeparator = "_";
2020
public static String fqnSeparator = "\\";
2121
public static String composerType = "project";
22+
public static String mageOsFrameworkRootComposer = "vendor/mage-os/framework";
2223
}

src/com/magento/idea/magento2plugin/magento/packages/code/MagentoVersion.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77

88
import java.util.ArrayList;
99
import java.util.Arrays;
10+
import java.util.Comparator;
1011
import java.util.List;
1112

1213
public enum MagentoVersion {
1314

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

1719
private final String name;
1820
private final int priority;
@@ -52,9 +54,7 @@ public static List<MagentoVersion> getVersions() {
5254
final List<MagentoVersion> versions = new ArrayList<>(
5355
Arrays.asList(MagentoVersion.values())
5456
);
55-
versions.sort(
56-
(version1, version2) -> version1.getPriority() > version2.getPriority() ? 1 : 0
57-
);
57+
versions.sort(Comparator.comparingInt(MagentoVersion::getPriority));
5858

5959
return versions;
6060
}

src/com/magento/idea/magento2plugin/project/util/GetMagentoVersionUtil.java

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ private GetMagentoVersionUtil() {
7373
if (MagentoVersion.ENTERPRISE_EDITION.getName().equals(name)) {
7474
break;
7575
}
76+
77+
if (MagentoVersion.MAGEOS_COMMUNITY_EDITION.getName().equals(name)) {
78+
break;
79+
}
7680
}
7781
}
7882

src/com/magento/idea/magento2plugin/util/magento/MagentoBasePathUtil.java

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public static boolean isMagentoFolderValid(final String path) {
3737
) != null || VfsUtil.findRelativeFile(
3838
file,
3939
Package.frameworkRootGit.split(Package.V_FILE_SEPARATOR)
40+
) != null || VfsUtil.findRelativeFile(
41+
file,
42+
Package.mageOsFrameworkRootComposer.split(Package.V_FILE_SEPARATOR)
4043
) != null;
4144
}
4245

0 commit comments

Comments
 (0)