From b5f14f850756f03f26cde7a13c45a3d2187fa73a Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Thu, 18 Jul 2024 11:51:54 +0200 Subject: [PATCH] Rename ResolvableOciImageDependenciesImpl.ReferenceSpecBuilder -> ReferenceSpecsBuilder --- .../dsl/ResolvableOciImageDependenciesImpl.kt | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) 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 d3bd7d6f..45ecd787 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 @@ -45,23 +45,23 @@ internal abstract class ResolvableOciImageDependenciesImpl @Inject constructor( final override fun getName() = name - final override fun DependencySet.addInternal(dependency: ModuleDependency): ReferenceSpecBuilder { - val referenceSpecBuilder = ReferenceSpecBuilder(objectFactory) - addLater(referenceSpecBuilder.attribute.map { attribute -> + final override fun DependencySet.addInternal(dependency: ModuleDependency): ReferenceSpecsBuilder { + val referenceSpecsBuilder = ReferenceSpecsBuilder(objectFactory) + addLater(referenceSpecsBuilder.attribute.map { attribute -> dependency.attribute(OCI_IMAGE_REFERENCE_SPECS_ATTRIBUTE, attribute) }) - return referenceSpecBuilder + return referenceSpecsBuilder } - final override fun DependencySet.addInternal(dependencyProvider: Provider): ReferenceSpecBuilder { - val referenceSpecBuilder = ReferenceSpecBuilder(objectFactory) - addLater(dependencyProvider.zip(referenceSpecBuilder.attribute) { dependency, attribute -> + final override fun DependencySet.addInternal(dependencyProvider: Provider): ReferenceSpecsBuilder { + val referenceSpecsBuilder = ReferenceSpecsBuilder(objectFactory) + addLater(dependencyProvider.zip(referenceSpecsBuilder.attribute) { dependency, attribute -> dependency.attribute(OCI_IMAGE_REFERENCE_SPECS_ATTRIBUTE, attribute) }) - return referenceSpecBuilder + return referenceSpecsBuilder } - class ReferenceSpecBuilder(objectFactory: ObjectFactory) : Nameable, Taggable { + class ReferenceSpecsBuilder(objectFactory: ObjectFactory) : Nameable, Taggable { private val nameProperty = objectFactory.property() private val tagsProperty = objectFactory.setProperty() val attribute: Provider = tagsProperty.zipAbsentAsNull(nameProperty) { tags, name -> @@ -72,34 +72,34 @@ internal abstract class ResolvableOciImageDependenciesImpl @Inject constructor( } } - override fun name(name: String): ReferenceSpecBuilder { + override fun name(name: String): ReferenceSpecsBuilder { nameProperty.set(name) return this } - override fun name(nameProvider: Provider): ReferenceSpecBuilder { + override fun name(nameProvider: Provider): ReferenceSpecsBuilder { nameProperty.set(nameProvider) return this } - override fun tag(vararg tags: String): ReferenceSpecBuilder { + override fun tag(vararg tags: String): ReferenceSpecsBuilder { tagsProperty.addAll(*tags) return this } - override fun tag(tags: Iterable): ReferenceSpecBuilder { + override fun tag(tags: Iterable): ReferenceSpecsBuilder { tagsProperty.addAll(tags) return this } - override fun tag(tagProvider: Provider): ReferenceSpecBuilder { + override fun tag(tagProvider: Provider): ReferenceSpecsBuilder { tagsProperty.addAll(tagProvider.map { listOf(it) }.orElse(emptyList())) return this } @Suppress("INAPPLICABLE_JVM_NAME") @JvmName("tagMultiple") - override fun tag(tagsProvider: Provider>): ReferenceSpecBuilder { + override fun tag(tagsProvider: Provider>): ReferenceSpecsBuilder { tagsProperty.addAll(tagsProvider.map { it }.orElse(emptyList())) return this }