mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
OPENIDE added Axiom vendor and fixed Axiom long title issue, fixed position of the Axiom JDK in the JDK Download dialog
This commit is contained in:
committed by
Nikita Iarychenko
parent
f66cc1ac16
commit
6b3f9d2d2a
@@ -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"),
|
||||
|
||||
@@ -153,6 +153,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;
|
||||
@@ -186,6 +187,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;
|
||||
|
||||
@@ -371,8 +371,22 @@ class JdkVariantDetectorTest {
|
||||
|OS_NAME="Darwin"
|
||||
""".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)
|
||||
|
||||
@@ -120,7 +120,7 @@ private class JdkVersionVendorCombobox: ComboBox<JdkVersionVendorItem>() {
|
||||
}
|
||||
|
||||
override fun customize(item: SimpleColoredComponent, value: JdkVersionVendorItem, index: Int, isSelected: Boolean, hasFocus: Boolean) {
|
||||
val title = value.item.product.packagePresentationText.replace("Axiom JSC", "").trim()
|
||||
val title = value.item.product.packagePresentationText
|
||||
if (isLicenseAcceptedJDK(value))
|
||||
item.append(title, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES)
|
||||
else
|
||||
@@ -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)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -58,7 +58,7 @@ data class JdkProduct(
|
||||
append(flavour)
|
||||
append(")")
|
||||
}
|
||||
}
|
||||
}.replace("Axiom JSC", "").trim()
|
||||
}
|
||||
|
||||
/** describes an item behind the version as well as download info **/
|
||||
@@ -196,6 +196,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