mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +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)
This commit is contained in:
committed by
Nikita Iarychenko
parent
6881e24f3e
commit
8bcbc8287c
@@ -34,6 +34,7 @@ data class SdkmanReleaseData(val target: String,
|
||||
if (version !in versionString) return false
|
||||
|
||||
val variant = when {
|
||||
vendor == "axiom" -> JdkVersionDetector.Variant.Axiom
|
||||
vendor == "adpt" && flavour == "hs" -> JdkVersionDetector.Variant.AdoptOpenJdk_HS
|
||||
vendor == "adpt" && flavour == "j9" -> JdkVersionDetector.Variant.AdoptOpenJdk_J9
|
||||
vendor == "albba" -> JdkVersionDetector.Variant.Dragonwell
|
||||
|
||||
@@ -29,6 +29,7 @@ data class AsdfReleaseData(val name: String, val vendor: String, val version: St
|
||||
if (version !in versionString) return false
|
||||
|
||||
val 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;
|
||||
|
||||
@@ -380,8 +380,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)
|
||||
|
||||
@@ -112,7 +112,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
|
||||
@@ -143,7 +143,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)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -60,7 +60,7 @@ data class JdkProduct(
|
||||
append(flavour)
|
||||
append(")")
|
||||
}
|
||||
}
|
||||
}.replace("Axiom JSC", "").trim()
|
||||
}
|
||||
|
||||
/** describes an item behind the version as well as download info **/
|
||||
@@ -198,6 +198,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("Corretto")) return JdkVersionDetector.Variant.Corretto
|
||||
if (vendorText.contains("BellSoft")) return JdkVersionDetector.Variant.Liberica
|
||||
|
||||
Reference in New Issue
Block a user