Skip to content

Commit

Permalink
Split LoadOciImageTask from LoadOciImagesTask
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Dec 18, 2024
1 parent c87ebf8 commit c1305b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/io/github/sgtsilvio/gradle/oci/OciPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.github.sgtsilvio.gradle.oci
import io.github.sgtsilvio.gradle.oci.attributes.*
import io.github.sgtsilvio.gradle.oci.dsl.OciExtension
import io.github.sgtsilvio.gradle.oci.dsl.OciImageDefinition
import io.github.sgtsilvio.gradle.oci.image.LoadOciImagesTask
import io.github.sgtsilvio.gradle.oci.image.LoadOciImageTask
import io.github.sgtsilvio.gradle.oci.image.PushOciImageTask
import io.github.sgtsilvio.gradle.oci.internal.dsl.OciExtensionImpl
import io.github.sgtsilvio.gradle.oci.internal.mainToEmpty
Expand Down Expand Up @@ -54,7 +54,7 @@ class OciPlugin : Plugin<Project> {

private fun registerLoadTask(imageDefinition: OciImageDefinition, project: Project, extension: OciExtension) {
val loadName = "load".concatCamelCase(imageDefinition.name.mainToEmpty())
project.tasks.register<LoadOciImagesTask>(loadName.concatCamelCase("ociImage")) {
project.tasks.register<LoadOciImageTask>(loadName.concatCamelCase("ociImage")) {
group = TASK_GROUP_NAME
description = "Loads the '${imageDefinition.name}' OCI image to the Docker daemon."
from(extension.imageDependencies.create(loadName).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import javax.inject.Inject
/**
* @author Silvio Giebl
*/
@DisableCachingByDefault(because = "Pulling to a Docker daemon")
@DisableCachingByDefault(because = "Loading to an external Docker daemon")
abstract class LoadOciImagesTask @Inject constructor(private val execOperations: ExecOperations) : OciImagesTask() {

final override fun run(
Expand Down Expand Up @@ -60,8 +60,12 @@ abstract class LoadOciImagesTask @Inject constructor(private val execOperations:
}
registryDataDirectory.toFile().deleteRecursively()
}
}

// TODO Single task
@DisableCachingByDefault(because = "Loading to an external Docker daemon")
abstract class LoadOciImageTask @Inject constructor(
execOperations: ExecOperations
) : LoadOciImagesTask(execOperations) {

@get:Internal
@get:Option(
Expand Down

0 comments on commit c1305b4

Please sign in to comment.