mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
OPENIDE added Axiom vendor and fixed Axiom long title issue, fixed position of the Axiom JDK in the JDK Download dialog
(cherry picked from commit 53976367e892bd448683658c128aaf275f2d8b7f) (cherry picked from commit8bcbc8287c) (cherry picked from commitfd44cc164f) (cherry picked from commit49f4341158) (cherry picked from commit4f71dd7c5d)
This commit is contained in:
committed by
Nikita Iarychenko
parent
b2094921f0
commit
326f93307b
+1
@@ -49,6 +49,7 @@ public data class SdkmanReleaseData(val target: String,
|
||||
override val javaVersion: JavaVersion? = JavaVersion.tryParse(version)
|
||||
|
||||
override val variant: JdkVersionDetector.Variant = when (vendor) {
|
||||
"axiom" -> JdkVersionDetector.Variant.Axiom
|
||||
"adpt" if flavour == "hs" -> JdkVersionDetector.Variant.AdoptOpenJdk_HS
|
||||
"adpt" if flavour == "j9" -> JdkVersionDetector.Variant.AdoptOpenJdk_J9
|
||||
"albba" -> JdkVersionDetector.Variant.Dragonwell
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ public data class AsdfReleaseData(val name: String, val vendor: String, val vers
|
||||
override val javaVersion: JavaVersion? = JavaVersion.tryParse(version)
|
||||
|
||||
override val variant: JdkVersionDetector.Variant = when (vendor) {
|
||||
"axiom" -> JdkVersionDetector.Variant.Axiom
|
||||
"adoptopenjdk", "adoptopenjdk-jre" -> JdkVersionDetector.Variant.AdoptOpenJdk_HS
|
||||
"adoptopenjdk-jre-openj9", "adoptopenjdk-jre-openj9-large_heap",
|
||||
"adoptopenjdk-openj9", "adoptopenjdk-openj9-large_heap" -> JdkVersionDetector.Variant.AdoptOpenJdk_J9
|
||||
|
||||
@@ -29,6 +29,7 @@ public abstract class JdkVersionDetector {
|
||||
|
||||
@SuppressWarnings("SpellCheckingInspection")
|
||||
public enum Variant {
|
||||
Axiom("axiom", "Axiom JDK"),
|
||||
AdoptOpenJdk_HS("adopt", "AdoptOpenJDK (HotSpot)"),
|
||||
AdoptOpenJdk_J9("adopt-j9", "AdoptOpenJDK (OpenJ9)"),
|
||||
BiSheng("bisheng", "BiSheng JDK"),
|
||||
|
||||
@@ -155,6 +155,7 @@ public class JdkVersionDetectorImpl extends JdkVersionDetector {
|
||||
private static @Nullable Variant detectVariant(Properties p) {
|
||||
String implementorVersion = unquoteProperty(p, "IMPLEMENTOR_VERSION");
|
||||
if (implementorVersion != null) {
|
||||
if (implementorVersion.startsWith("Axiom")) return Variant.Axiom;
|
||||
if (implementorVersion.startsWith("AdoptOpenJDK")) {
|
||||
String variant = unquoteProperty(p, "JVM_VARIANT");
|
||||
return "OpenJ9".equalsIgnoreCase(variant) ? Variant.AdoptOpenJdk_J9 : Variant.AdoptOpenJdk_HS;
|
||||
@@ -188,6 +189,7 @@ public class JdkVersionDetectorImpl extends JdkVersionDetector {
|
||||
}
|
||||
|
||||
private static @Nullable Variant detectVendor(String implementor) {
|
||||
if (implementor.startsWith("Axiom")) return Variant.Axiom;
|
||||
if (implementor.startsWith("Alibaba")) return Variant.Dragonwell;
|
||||
if (implementor.startsWith("Amazon")) return Variant.Corretto;
|
||||
if (implementor.startsWith("Azul")) return Variant.Zulu;
|
||||
|
||||
@@ -398,8 +398,22 @@ class JdkVariantDetectorTest {
|
||||
|MODULES="java.base ..."
|
||||
""".trimMargin()
|
||||
|
||||
private val RELEASE_AXIOM_JDK_23_0_2 =
|
||||
"""
|
||||
|IMPLEMENTOR="Axiom JSC"
|
||||
|JAVA_RUNTIME_VERSION="23.0.2+9"
|
||||
|JAVA_VERSION="23.0.2"
|
||||
|JAVA_VERSION_DATE="2025-01-21"
|
||||
|LIBC="default"
|
||||
|MODULES="java.base ..."
|
||||
|OS_ARCH="x86_64"
|
||||
|OS_NAME="Windows"
|
||||
|SOURCE=".:git:8d70ee331792+"
|
||||
""".trimMargin()
|
||||
|
||||
@Rule @JvmField val tempDir = TempDirectory()
|
||||
|
||||
@Test fun `AxiomJDK 23`() = assertVariant(Axiom, RELEASE_AXIOM_JDK_23_0_2)
|
||||
@Test fun `Oracle OpenJDK 8`() = assertVariant(Unknown, RELEASE_ORACLE_OPEN_1_8_0_41, MANIFEST_ORACLE_OPEN_1_8_0_41) // no vendor info
|
||||
@Test fun `Oracle Commercial 8`() = assertVariant(Oracle, RELEASE_ORACLE_1_8_0_291, MANIFEST_ORACLE_1_8_0_291)
|
||||
@Test fun `Oracle 16`() = assertVariant(Oracle, RELEASE_ORACLE_16_0_1)
|
||||
|
||||
+2
-2
@@ -113,7 +113,7 @@ private class JdkVersionVendorCombobox : ComboBox<JdkVersionVendorItem>() {
|
||||
isSwingPopup = false
|
||||
|
||||
renderer = listCellRenderer<JdkVersionVendorItem>("") {
|
||||
val title = value.item.product.packagePresentationText.replace("Axiom JSC", "").trim()
|
||||
val title = value.item.product.packagePresentationText
|
||||
val style = if (isLicenseAcceptedJDK(value)) SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES else SimpleTextAttributes.REGULAR_ATTRIBUTES
|
||||
text(title) {
|
||||
this.attributes = style
|
||||
@@ -144,7 +144,7 @@ private fun List<JdkVersionVendorItem>.sortedForUI() = this
|
||||
Comparator { i1, i2 ->
|
||||
val s1: String = i1.item.product.packagePresentationText
|
||||
val s2: String = i2.item.product.packagePresentationText
|
||||
if (s1.contains("Axiom", ignoreCase = true)) -1
|
||||
if (s2.contains("Axiom", ignoreCase = true)) 1
|
||||
else s1.compareTo(s2)
|
||||
}
|
||||
)
|
||||
|
||||
+2
-1
@@ -76,7 +76,7 @@ data class JdkProduct(
|
||||
append(flavour)
|
||||
append(")")
|
||||
}
|
||||
}
|
||||
}.replace("Axiom JSC", "").trim()
|
||||
}
|
||||
|
||||
/** describes an item behind the version as well as download info **/
|
||||
@@ -217,6 +217,7 @@ data class JdkItem(
|
||||
|
||||
companion object {
|
||||
fun detectVariant(vendorText: @NlsSafe String): JdkVersionDetector.Variant {
|
||||
if (vendorText.contains("Axiom")) return JdkVersionDetector.Variant.Axiom
|
||||
if (vendorText.contains("Oracle OpenJDK")) return JdkVersionDetector.Variant.Oracle
|
||||
if (vendorText.contains("Microsoft")) return JdkVersionDetector.Variant.Microsoft
|
||||
if (vendorText.contains("Corretto")) return JdkVersionDetector.Variant.Corretto
|
||||
|
||||
Reference in New Issue
Block a user