From ed0049ae68c32af3b6f60ba316dacafcddd1f0c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Wed, 10 Nov 2021 11:45:02 +0100 Subject: [PATCH] less gradle warnings --- gradle-plugin-rpm/gradle.properties | 2 +- .../groovy/org/xbib/gradle/plugin/Rpm.groovy | 5 +- .../xbib/gradle/plugin/RpmExtension.groovy | 129 ++++++++++-------- 3 files changed, 79 insertions(+), 57 deletions(-) diff --git a/gradle-plugin-rpm/gradle.properties b/gradle-plugin-rpm/gradle.properties index eeb1390..1bc9b51 100644 --- a/gradle-plugin-rpm/gradle.properties +++ b/gradle-plugin-rpm/gradle.properties @@ -1 +1 @@ -version = 2.1.0 +version = 2.1.1 diff --git a/gradle-plugin-rpm/src/main/groovy/org/xbib/gradle/plugin/Rpm.groovy b/gradle-plugin-rpm/src/main/groovy/org/xbib/gradle/plugin/Rpm.groovy index 18274d4..96ab7d0 100644 --- a/gradle-plugin-rpm/src/main/groovy/org/xbib/gradle/plugin/Rpm.groovy +++ b/gradle-plugin-rpm/src/main/groovy/org/xbib/gradle/plugin/Rpm.groovy @@ -8,12 +8,13 @@ import java.util.concurrent.Callable class Rpm extends AbstractArchiveTask { - @Delegate + @Delegate(methodAnnotations = true) @Nested RpmExtension rpmExtension Rpm() { - rpmExtension = project.extensions.findByName('rpm') as RpmExtension + super() + rpmExtension = project.extensions.findByType(RpmExtension) as RpmExtension getArchiveExtension().set("rpm") Callable archiveFileNameProvider = new Callable() { @Override diff --git a/gradle-plugin-rpm/src/main/groovy/org/xbib/gradle/plugin/RpmExtension.groovy b/gradle-plugin-rpm/src/main/groovy/org/xbib/gradle/plugin/RpmExtension.groovy index 7fc6213..cc30e67 100644 --- a/gradle-plugin-rpm/src/main/groovy/org/xbib/gradle/plugin/RpmExtension.groovy +++ b/gradle-plugin-rpm/src/main/groovy/org/xbib/gradle/plugin/RpmExtension.groovy @@ -1,6 +1,7 @@ package org.xbib.gradle.plugin import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.Optional import org.xbib.rpm.Dependency import org.xbib.rpm.Directory @@ -13,7 +14,7 @@ class RpmExtension { @Optional @Input - boolean enabled = true + Boolean enabled = true @Optional @Input @@ -115,6 +116,7 @@ class RpmExtension { @Input PackageType packageType = PackageType.BINARY + @Optional @Input List prefixes = new ArrayList() @@ -143,9 +145,10 @@ class RpmExtension { String preInstall @Optional - @Input + @InputFile File preInstallFile + @Optional @Input List preInstallCommands = [] @@ -154,9 +157,10 @@ class RpmExtension { String postInstall @Optional - @Input + @InputFile File postInstallFile + @Optional @Input List postInstallCommands = [] @@ -165,9 +169,10 @@ class RpmExtension { String preUninstall @Optional - @Input + @InputFile File preUninstallFile + @Optional @Input List preUninstallCommands = [] @@ -176,9 +181,10 @@ class RpmExtension { String postUninstall @Optional - @Input + @InputFile File postUninstallFile + @Optional @Input List postUninstallCommands = [] @@ -187,9 +193,10 @@ class RpmExtension { String preTrans @Optional - @Input + @InputFile File preTransFile + @Optional @Input List preTransCommands = [] @@ -198,18 +205,79 @@ class RpmExtension { String postTrans @Optional - @Input + @InputFile File postTransFile + @Optional + @Input + List directories = [] + + @Optional + @InputFile + File changeLogFile + + @Optional + @Input + String changeLog + + @Optional @Input List postTransCommands = [] + @Optional @Input List commonCommands = [] + @Optional @Input List links = [] + @Optional + @Input + List dependencies = [] + + @Optional + @Input + List obsoletes = [] + + @Optional + @Input + List conflicts = [] + + @Optional + @Input + List recommends = [] + + @Optional + @Input + List suggests = [] + + @Optional + @Input + List enhances = [] + + @Optional + @Input + List preDepends = [] + + @Optional + @Input + List breaks = [] + + @Optional + @Input + List replaces = [] + + @Optional + @Input + List provides = [] + + Directory directory(String path) { + Directory directory = new Directory(path: path) + directories << directory + directory + } + Link link(String path, String target) { link(path, target, -1) } @@ -220,36 +288,6 @@ class RpmExtension { link } - @Input - List dependencies = [] - - @Input - List obsoletes = [] - - @Input - List conflicts = [] - - @Input - List recommends = [] - - @Input - List suggests = [] - - @Input - List enhances = [] - - @Input - List preDepends = [] - - @Input - List breaks = [] - - @Input - List replaces = [] - - @Input - List provides = [] - Dependency requires(String packageName) { requires(packageName, '') } @@ -389,21 +427,4 @@ class RpmExtension { provides.add(dep) dep } - - @Input - List directories = [] - - Directory directory(String path) { - Directory directory = new Directory(path: path) - directories << directory - directory - } - - @Optional - @Input - File changeLogFile - - @Optional - @Input - String changeLog }