Skip to content

Commit 708a341

Browse files
authored
Merge pull request #1442 from jerboaa/add-jmods-image-type
Add support for jmods ImageType
2 parents 5df08bb + 735d50e commit 708a341

File tree

2 files changed

+21
-2
lines changed
  • adoptium-models-parent/adoptium-api-v3-models/src/main/kotlin/net/adoptium/api/v3/models
  • adoptium-updater-parent/adoptium-api-v3-updater/src/test/kotlin/net/adoptium/api

2 files changed

+21
-2
lines changed

adoptium-models-parent/adoptium-api-v3-models/src/main/kotlin/net/adoptium/api/v3/models/ImageType.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package net.adoptium.api.v3.models
33
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType
44
import org.eclipse.microprofile.openapi.annotations.media.Schema
55

6-
@Schema(type = SchemaType.STRING, enumeration = ["jdk", "jre", "testimage", "debugimage", "staticlibs", "sources", "sbom"], example = "jdk")
6+
@Schema(type = SchemaType.STRING, enumeration = ["jdk", "jre", "testimage", "debugimage", "staticlibs", "sources", "sbom", "jmods"], example = "jdk")
77
enum class ImageType : FileNameMatcher {
88
jdk,
99
jre(1),
1010
testimage(1),
1111
debugimage(1),
1212
staticlibs(1, "static-libs"),
1313
sources(1, "sources"),
14-
sbom(1);
14+
sbom(1),
15+
jmods(1);
1516

1617
override lateinit var names: List<String>
1718
override var priority: Int = 0

adoptium-updater-parent/adoptium-api-v3-updater/src/test/kotlin/net/adoptium/api/AdoptBinaryMapperTest.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,24 @@ class AdoptBinaryMapperTest {
519519
}
520520
}
521521

522+
@Test
523+
fun `identifies JMOD images`() {
524+
runBlocking {
525+
val assets = listOf(
526+
GHAsset(
527+
"OpenJDK-jmods_x64_linux_hotspot_2020-11-23-03-35.tar.gz",
528+
1L,
529+
"",
530+
1L,
531+
"2025-02-27T19:35:32Z"
532+
)
533+
)
534+
val binaryList = adoptBinaryMapper.toBinaryList(assets, assets, emptyMap())
535+
536+
assertEquals(ImageType.jmods, binaryList[0].image_type)
537+
}
538+
}
539+
522540
private fun assertParsedHotspotJfr(binaryList: List<Binary>) {
523541
assertEquals(JvmImpl.hotspot, binaryList[0].jvm_impl)
524542
assertEquals(Project.jfr, binaryList[0].project)

0 commit comments

Comments
 (0)