From 34aa2163ce689b1795838de17f4c84bf8640dee7 Mon Sep 17 00:00:00 2001 From: Goooler Date: Thu, 12 Dec 2024 18:20:43 +0800 Subject: [PATCH] Migrate all ListProperty usages to SetProperty --- .../jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt | 8 ++++---- .../shadow/transformers/ManifestAppenderTransformer.kt | 6 +++--- .../shadow/transformers/PropertiesFileTransformer.kt | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt index 8640650a5..a20a9b53b 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt @@ -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 @@ -113,14 +113,14 @@ public abstract class ShadowJar : } @get:Nested - public open val transformers: ListProperty = objectFactory.listProperty(Transformer::class.java) + public open val transformers: SetProperty = objectFactory.setProperty(Transformer::class.java) @get:Nested - public open val relocators: ListProperty = objectFactory.listProperty(Relocator::class.java) + public open val relocators: SetProperty = objectFactory.setProperty(Relocator::class.java) @get:Classpath @get:Optional - public open val configurations: ListProperty = objectFactory.listProperty(Configuration::class.java) + public open val configurations: SetProperty = objectFactory.setProperty(Configuration::class.java) @get:Internal public open val dependencyFilter: Property = diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ManifestAppenderTransformer.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ManifestAppenderTransformer.kt index 473c81568..230058cfd 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ManifestAppenderTransformer.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ManifestAppenderTransformer.kt @@ -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 @@ -27,8 +27,8 @@ public open class ManifestAppenderTransformer @Inject constructor( @Suppress("UNCHECKED_CAST") @get:Input - public open val attributes: ListProperty>> = - objectFactory.listProperty(Pair::class.java) as ListProperty>> + public open val attributes: SetProperty>> = + objectFactory.setProperty(Pair::class.java) as SetProperty>> override fun canTransformResource(element: FileTreeElement): Boolean { return MANIFEST_NAME.equals(element.relativePath.pathString, ignoreCase = true) diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformer.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformer.kt index 1e3a80a5d..57be7a405 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformer.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformer.kt @@ -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 @@ -107,7 +107,7 @@ public open class PropertiesFileTransformer @Inject constructor( internal val propertiesEntries = mutableMapOf() @get:Input - public open val paths: ListProperty = objectFactory.listProperty(String::class.java) + public open val paths: SetProperty = objectFactory.setProperty(String::class.java) @Suppress("UNCHECKED_CAST") @get:Input