diff --git a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/OciImageDefinitionImpl.kt b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/OciImageDefinitionImpl.kt index 17be8467..dd9a40ad 100644 --- a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/OciImageDefinitionImpl.kt +++ b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/OciImageDefinitionImpl.kt @@ -304,12 +304,12 @@ internal abstract class OciImageDefinitionImpl @Inject constructor( dependencyHandler: DependencyHandler, ) : OciImageDependenciesImpl(configuration, dependencyHandler), OciImageDefinition.Bundle.ParentImages { - final override fun addInternal(dependency: ModuleDependency) { - configuration.dependencies.add(dependency) + final override fun DependencySet.addInternal(dependency: ModuleDependency) { + add(dependency) } - final override fun addInternal(dependencyProvider: Provider) { - configuration.dependencies.addLater(dependencyProvider) + final override fun DependencySet.addInternal(dependencyProvider: Provider) { + addLater(dependencyProvider) } } diff --git a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/OciImageDependenciesImpl.kt b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/OciImageDependenciesImpl.kt index 933a822e..95e85d65 100644 --- a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/OciImageDependenciesImpl.kt +++ b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/OciImageDependenciesImpl.kt @@ -31,14 +31,14 @@ internal abstract class OciImageDependenciesImpl( addInternal(dependencyProvider, action) private fun addInternal(dependency: D, action: Action?) = - addInternal(finalizeDependency(dependency, action)) + configuration.dependencies.addInternal(finalizeDependency(dependency, action)) private fun addInternal(dependencyProvider: Provider, action: Action?) = - addInternal(dependencyProvider.map { finalizeDependency(it, action) }) + configuration.dependencies.addInternal(dependencyProvider.map { finalizeDependency(it, action) }) - protected abstract fun addInternal(dependency: ModuleDependency): T + protected abstract fun DependencySet.addInternal(dependency: ModuleDependency): T - protected abstract fun addInternal(dependencyProvider: Provider): T + protected abstract fun DependencySet.addInternal(dependencyProvider: Provider): T private fun finalizeDependency(dependency: D, action: Action?): D { @Suppress("UNCHECKED_CAST") val finalizedDependency = dependencyHandler.create(dependency) as D diff --git a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/ResolvableOciImageDependenciesImpl.kt b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/ResolvableOciImageDependenciesImpl.kt index c64635b7..50a3f1ee 100644 --- a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/ResolvableOciImageDependenciesImpl.kt +++ b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/internal/dsl/ResolvableOciImageDependenciesImpl.kt @@ -8,6 +8,7 @@ import io.github.sgtsilvio.gradle.oci.internal.gradle.attribute import io.github.sgtsilvio.gradle.oci.internal.gradle.zipAbsentAsNull import io.github.sgtsilvio.gradle.oci.metadata.OciImageReferenceSpec import org.gradle.api.artifacts.ConfigurationContainer +import org.gradle.api.artifacts.DependencySet import org.gradle.api.artifacts.ModuleDependency import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.attributes.Bundling @@ -44,17 +45,17 @@ internal abstract class ResolvableOciImageDependenciesImpl @Inject constructor( final override fun getName() = name - final override fun addInternal(dependency: ModuleDependency): ReferenceSpecBuilder { + final override fun DependencySet.addInternal(dependency: ModuleDependency): ReferenceSpecBuilder { val referenceSpecBuilder = ReferenceSpecBuilder(objectFactory) - configuration.dependencies.addLater(referenceSpecBuilder.attribute.map { attribute -> + addLater(referenceSpecBuilder.attribute.map { attribute -> dependency.attribute(OCI_IMAGE_REFERENCE_ATTRIBUTE, attribute) }) return referenceSpecBuilder } - final override fun addInternal(dependencyProvider: Provider): ReferenceSpecBuilder { + final override fun DependencySet.addInternal(dependencyProvider: Provider): ReferenceSpecBuilder { val referenceSpecBuilder = ReferenceSpecBuilder(objectFactory) - configuration.dependencies.addLater(dependencyProvider.zip(referenceSpecBuilder.attribute) { dependency, attribute -> + addLater(dependencyProvider.zip(referenceSpecBuilder.attribute) { dependency, attribute -> dependency.attribute(OCI_IMAGE_REFERENCE_ATTRIBUTE, attribute) }) return referenceSpecBuilder