diff --git a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/dsl/OciImageDependencies.kt b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/dsl/OciImageDependencies.kt index 6a34454f..115d6507 100644 --- a/src/main/kotlin/io/github/sgtsilvio/gradle/oci/dsl/OciImageDependencies.kt +++ b/src/main/kotlin/io/github/sgtsilvio/gradle/oci/dsl/OciImageDependencies.kt @@ -35,12 +35,13 @@ interface OciImageDependencies { fun add(project: Project, action: Action): T - fun add(dependencyProvider: ProviderConvertible): T + fun add(dependencyProvider: ProviderConvertible) = + add(dependencyProvider.asProvider()) fun add( dependencyProvider: ProviderConvertible, action: Action, - ): T + ) = add(dependencyProvider.asProvider(), action) // add constraint @@ -67,7 +68,8 @@ interface OciImageDependencies { fun constraint(dependencyProvider: Provider): Provider - fun constraint(dependencyProvider: ProviderConvertible): Provider + fun constraint(dependencyProvider: ProviderConvertible) = + constraint(dependencyProvider.asProvider()) // dsl syntactic sugar for adding dependency 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 1abccef1..29b18a8c 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 @@ -6,7 +6,6 @@ import org.gradle.api.Project import org.gradle.api.artifacts.* import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.provider.Provider -import org.gradle.api.provider.ProviderConvertible import org.gradle.kotlin.dsl.withType /** @@ -74,14 +73,6 @@ internal abstract class OciImageDependenciesImpl( final override fun add(project: Project, action: Action) = add(createDependency(project), action) - final override fun add(dependencyProvider: ProviderConvertible) = - add(dependencyProvider.asProvider()) - - final override fun add( - dependencyProvider: ProviderConvertible, - action: Action, - ) = add(dependencyProvider.asProvider(), action) - // add constraint final override fun add(dependencyConstraint: DependencyConstraint) { @@ -118,7 +109,4 @@ internal abstract class OciImageDependenciesImpl( final override fun constraint(dependencyProvider: Provider) = dependencyProvider.map { constraint(it) } - - final override fun constraint(dependencyProvider: ProviderConvertible) = - constraint(dependencyProvider.asProvider()) }