From ddf5b58b8e0f0991a182d069f5206476269d98f7 Mon Sep 17 00:00:00 2001 From: Lars Vierbergen Date: Tue, 6 Aug 2024 12:01:16 +0200 Subject: [PATCH] Remove usage of deprecated ConfigureUtil --- .../xenit/gradle/alfrescosdk/tasks/Amp.java | 47 ------------------- .../alfrescosdk/tasks/AmpSourceSet.java | 3 -- .../tasks/AmpSourceSetConfiguration.java | 14 ------ .../gradle/alfrescosdk/AmpBasePluginTest.java | 1 - 4 files changed, 65 deletions(-) diff --git a/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/Amp.java b/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/Amp.java index ac65125..60fdb84 100644 --- a/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/Amp.java +++ b/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/Amp.java @@ -2,7 +2,6 @@ import static eu.xenit.gradle.alfrescosdk.internal.DeprecationHelper.warnDeprecationOnce; -import groovy.lang.Closure; import java.io.File; import java.util.concurrent.Callable; import java.util.function.Supplier; @@ -20,7 +19,6 @@ import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.Optional; import org.gradle.api.tasks.bundling.Zip; -import org.gradle.util.ConfigureUtil; /** * Assembles an AMP archive. @@ -313,51 +311,6 @@ public void setConfig(Supplier config) { } // - // - /** - * @param web supplier of the directory that will be copied to the {@code /web} directory - * @deprecated since 0.2.0, use {@link #web(Action)} instead. - */ - @Deprecated - public void setWeb(Closure web) { - setWeb(web::call); - } - - /** - * @param config supplier of the directory that will be copied to the {@code /config} directory - * @deprecated since 0.2.0, use {@link #config(Action)} instead - */ - @Deprecated - public void setConfig(Closure config) { - setConfig(config::call); - } - - /** - * @param moduleProperties supplier of the file that will be copied to {@code /module.properties} - * @see #setModuleProperties(Supplier) - */ - public void setModuleProperties(Closure moduleProperties) { - setModuleProperties(moduleProperties::call); - } - - /** - * @param fileMappingProperties supplier of the file that will be copied to {@code /file-mapping.properties} - * @see #setFileMappingProperties(Supplier) - */ - public void setFileMappingProperties(Closure fileMappingProperties) { - setFileMappingProperties(fileMappingProperties::call); - } - - /** - * @see #de(Action) - * @param configureClosure action that configures the {@link CopySpec} for {@code /config/dynamic-extensions/bundles} - * @deprecated since 0.2.0. Use {@link #getDeBundles()} or {@link #setDeBundles(FileCollection)} instead. - */ - @Deprecated - public void de(Closure configureClosure) { - ConfigureUtil.configure(configureClosure, getDe()); - } - // // private Supplier> _web = () -> web; diff --git a/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/AmpSourceSet.java b/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/AmpSourceSet.java index 4ab5050..c14dde0 100644 --- a/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/AmpSourceSet.java +++ b/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/AmpSourceSet.java @@ -1,11 +1,8 @@ package eu.xenit.gradle.alfrescosdk.tasks; -import groovy.lang.Closure; -import org.gradle.api.Action; import org.gradle.api.Named; import org.gradle.api.NonNullApi; import org.gradle.api.tasks.SourceSet; -import org.gradle.util.ConfigureUtil; @NonNullApi public interface AmpSourceSet extends Named { diff --git a/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/AmpSourceSetConfiguration.java b/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/AmpSourceSetConfiguration.java index c456e5a..ee94621 100644 --- a/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/AmpSourceSetConfiguration.java +++ b/src/main/java/eu/xenit/gradle/alfrescosdk/tasks/AmpSourceSetConfiguration.java @@ -1,14 +1,11 @@ package eu.xenit.gradle.alfrescosdk.tasks; -import groovy.lang.Closure; import java.io.File; import java.util.Map; import java.util.Properties; import org.gradle.api.Action; import org.gradle.api.NonNullApi; import org.gradle.api.file.SourceDirectorySet; -import org.gradle.api.tasks.SourceSet; -import org.gradle.util.ConfigureUtil; @NonNullApi public interface AmpSourceSetConfiguration { @@ -36,11 +33,6 @@ default AmpSourceSetConfiguration fileMapping(Map fileMappingPro SourceDirectorySet getConfig(); - default AmpSourceSetConfiguration config(Closure configureClosure) { - ConfigureUtil.configure(configureClosure, getConfig()); - return this; - } - default AmpSourceSetConfiguration config(Action configure) { configure.execute(getConfig()); return this; @@ -49,12 +41,6 @@ default AmpSourceSetConfiguration config(Action conf SourceDirectorySet getWeb(); - default AmpSourceSetConfiguration web(Closure configureClosure) { - ConfigureUtil.configure(configureClosure, getWeb()); - return this; - } - - default AmpSourceSetConfiguration web(Action configure) { configure.execute(getWeb()); return this; diff --git a/src/test/java/eu/xenit/gradle/alfrescosdk/AmpBasePluginTest.java b/src/test/java/eu/xenit/gradle/alfrescosdk/AmpBasePluginTest.java index 83fc5e4..b5a9990 100644 --- a/src/test/java/eu/xenit/gradle/alfrescosdk/AmpBasePluginTest.java +++ b/src/test/java/eu/xenit/gradle/alfrescosdk/AmpBasePluginTest.java @@ -6,7 +6,6 @@ import static org.junit.Assert.assertTrue; import eu.xenit.gradle.alfrescosdk.tasks.Amp; -import eu.xenit.gradle.alfrescosdk.tasks.AmpSourceSet; import eu.xenit.gradle.alfrescosdk.tasks.AmpSourceSetConfiguration; import java.io.File; import java.io.IOException;