Skip to content

Commit

Permalink
Improve order in OciImagesTask
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Jul 16, 2024
1 parent 4c21cf7 commit 6b64519
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/main/kotlin/io/github/sgtsilvio/gradle/oci/OciImagesTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,6 @@ import java.io.File
/**
* @author Silvio Giebl
*/
class OciMultiPlatformImage(
val index: OciData,
val platformToImage: Map<Platform, OciImage>,
)

class OciImage(
val manifest: OciDataDescriptor,
val config: OciDataDescriptor,
val platform: Platform,
val variants: List<OciVariant>,
) {
init {
require(variants.isNotEmpty()) { "variants must not be empty" }
}
}

class OciVariant(
val metadata: OciMetadata,
val layers: List<OciLayer>,
)

class OciLayer(
val descriptor: OciLayerDescriptor,
val file: File,
)

abstract class OciImagesTask : DefaultTask() {

@get:Nested
Expand Down Expand Up @@ -187,3 +161,29 @@ private val EMPTY_LAYER_DIFF_IDS = setOf(
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef".toOciDigest(),
"sha512:8efb4f73c5655351c444eb109230c556d39e2c7624e9c11abc9e3fb4b9b9254218cc5085b454a9698d085cfa92198491f07a723be4574adc70617b73eb0b6461".toOciDigest(),
)

class OciMultiPlatformImage(
val index: OciData,
val platformToImage: Map<Platform, OciImage>,
)

class OciImage(
val manifest: OciDataDescriptor,
val config: OciDataDescriptor,
val platform: Platform,
val variants: List<OciVariant>,
) {
init {
require(variants.isNotEmpty()) { "variants must not be empty" }
}
}

class OciVariant(
val metadata: OciMetadata,
val layers: List<OciLayer>,
)

class OciLayer(
val descriptor: OciLayerDescriptor,
val file: File,
)

0 comments on commit 6b64519

Please sign in to comment.