From 44195953bce7c0155c565c4f6d14e4ade85c0014 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Mon, 14 Oct 2024 02:14:59 +0200 Subject: [PATCH] Bump to Gradle 8.10 and fix deprecation --- README.md | 4 +++- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 4 ++++ .../licenser/LicenserPluginFunctionalTest.groovy | 13 ++----------- .../org/cadixdev/gradle/licenser/Licenser.groovy | 3 +-- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3092cc8..9c3174d 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,12 @@ For a simple project you only need to apply the licenser plugin to your project: ```gradle plugins { - id 'org.cadixdev.licenser' version '0.6.1' + id 'net.neoforged.licenser' version '0.7.0' } ``` +You can find [available versions](https://projects.neoforged.net/neoforged/licenser) at the NeoForged projects listing. + This will apply the `LICENSE` file found in the project directory to all common source file types known to licenser. diff --git a/build.gradle b/build.gradle index 3c9a9aa..85b453a 100644 --- a/build.gradle +++ b/build.gradle @@ -4,12 +4,12 @@ plugins { id 'signing' id 'maven-publish' id 'org.cadixdev.licenser' version '0.5.1' - id 'net.neoforged.gradleutils' version '3.0.0-alpha.10' + id 'net.neoforged.gradleutils' version '3.0.0' } java { toolchain { - languageVersion.set(JavaLanguageVersion.of(8)) + languageVersion.set(JavaLanguageVersion.of(17)) } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e411586..1e2fbf0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index fb98974..bcd3b0c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,4 +5,8 @@ pluginManagement { } } +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' +} + rootProject.name = 'licenser' diff --git a/src/functionalTest/groovy/org/cadixdev/gradle/licenser/LicenserPluginFunctionalTest.groovy b/src/functionalTest/groovy/org/cadixdev/gradle/licenser/LicenserPluginFunctionalTest.groovy index 5aeace9..062b983 100644 --- a/src/functionalTest/groovy/org/cadixdev/gradle/licenser/LicenserPluginFunctionalTest.groovy +++ b/src/functionalTest/groovy/org/cadixdev/gradle/licenser/LicenserPluginFunctionalTest.groovy @@ -39,20 +39,11 @@ class LicenserPluginFunctionalTest extends Specification { static final def standardArguments = ["--warning-mode", "fail", "--stacktrace"].asImmutable() - static final def configurationCacheTestMatrix = [ - // TODO: restore android plugin once versions that support configuration cache are available + static final def testMatrix = [ /* gradleVersion | androidVersion | extraArgs */ - [ "7.0.2", null, ["--configuration-cache"] ], - [ "7.1", null, ["--configuration-cache"] ], - //[ "8.4", null, ["--configuration-cache"] ], we need to fix some warnings + [ "8.10.2", null, ["--configuration-cache"] ], ].asImmutable() - static final def testMatrix = ([ - /* gradleVersion | androidVersion | extraArgs */ - //[ "5.6.4", "3.6.4", [] ], - //[ "6.8.3", "4.1.0", [] ], - ] + configurationCacheTestMatrix).asImmutable() - File tempDir() { return temporaryFolder } diff --git a/src/main/groovy/org/cadixdev/gradle/licenser/Licenser.groovy b/src/main/groovy/org/cadixdev/gradle/licenser/Licenser.groovy index f4a4a5c..7c5878f 100644 --- a/src/main/groovy/org/cadixdev/gradle/licenser/Licenser.groovy +++ b/src/main/groovy/org/cadixdev/gradle/licenser/Licenser.groovy @@ -40,7 +40,6 @@ import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.TaskProvider import org.gradle.api.tasks.util.PatternSet import org.gradle.language.base.plugins.LifecycleBasePlugin -import org.gradle.util.ConfigureUtil class Licenser implements Plugin { @@ -222,7 +221,7 @@ class Licenser implements Plugin { task.charset.set(charset) task.skipExistingHeaders.set(skipExisting) if (target != null) { - ConfigureUtil.configure(target, task) + task.configure(target) } } }