Skip to content

Commit

Permalink
Migrate all ListProperty usages to SetProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Dec 12, 2024
1 parent 126938b commit 34aa216
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import org.gradle.api.internal.DocumentationRegistry
import org.gradle.api.internal.file.FileResolver
import org.gradle.api.internal.file.copy.CopyAction
import org.gradle.api.internal.file.copy.DefaultCopySpec
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.SetProperty
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Classpath
import org.gradle.api.tasks.Input
Expand Down Expand Up @@ -113,14 +113,14 @@ public abstract class ShadowJar :
}

@get:Nested
public open val transformers: ListProperty<Transformer> = objectFactory.listProperty(Transformer::class.java)
public open val transformers: SetProperty<Transformer> = objectFactory.setProperty(Transformer::class.java)

@get:Nested
public open val relocators: ListProperty<Relocator> = objectFactory.listProperty(Relocator::class.java)
public open val relocators: SetProperty<Relocator> = objectFactory.setProperty(Relocator::class.java)

@get:Classpath
@get:Optional
public open val configurations: ListProperty<Configuration> = objectFactory.listProperty(Configuration::class.java)
public open val configurations: SetProperty<Configuration> = objectFactory.setProperty(Configuration::class.java)

@get:Internal
public open val dependencyFilter: Property<DependencyFilter> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.apache.tools.zip.ZipEntry
import org.apache.tools.zip.ZipOutputStream
import org.gradle.api.file.FileTreeElement
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.SetProperty
import org.gradle.api.tasks.Input
import org.slf4j.LoggerFactory

Expand All @@ -27,8 +27,8 @@ public open class ManifestAppenderTransformer @Inject constructor(

@Suppress("UNCHECKED_CAST")
@get:Input
public open val attributes: ListProperty<Pair<String, Comparable<*>>> =
objectFactory.listProperty(Pair::class.java) as ListProperty<Pair<String, Comparable<*>>>
public open val attributes: SetProperty<Pair<String, Comparable<*>>> =
objectFactory.setProperty(Pair::class.java) as SetProperty<Pair<String, Comparable<*>>>

override fun canTransformResource(element: FileTreeElement): Boolean {
return MANIFEST_NAME.equals(element.relativePath.pathString, ignoreCase = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import org.apache.tools.zip.ZipEntry
import org.apache.tools.zip.ZipOutputStream
import org.gradle.api.file.FileTreeElement
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.MapProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.SetProperty
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal

Expand Down Expand Up @@ -107,7 +107,7 @@ public open class PropertiesFileTransformer @Inject constructor(
internal val propertiesEntries = mutableMapOf<String, CleanProperties>()

@get:Input
public open val paths: ListProperty<String> = objectFactory.listProperty(String::class.java)
public open val paths: SetProperty<String> = objectFactory.setProperty(String::class.java)

@Suppress("UNCHECKED_CAST")
@get:Input
Expand Down

0 comments on commit 34aa216

Please sign in to comment.