From d2fc6ca3aa15e9fb065f9ec0896b53b4ee36a2d3 Mon Sep 17 00:00:00 2001 From: Tyler Crawford Date: Mon, 15 Jan 2024 10:22:46 -0500 Subject: [PATCH 1/9] Add maven shell script formattings support via shfmt --- plugin-maven/CHANGES.md | 2 + .../spotless/maven/AbstractSpotlessMojo.java | 8 +++- .../diffplug/spotless/maven/shell/Shell.java | 46 +++++++++++++++++++ .../diffplug/spotless/maven/shell/Shfmt.java | 41 +++++++++++++++++ .../maven/MavenIntegrationHarness.java | 6 ++- .../spotless/maven/shell/ShellTest.java | 34 ++++++++++++++ 6 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 plugin-maven/src/main/java/com/diffplug/spotless/maven/shell/Shell.java create mode 100644 plugin-maven/src/main/java/com/diffplug/spotless/maven/shell/Shfmt.java create mode 100644 plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 789f4430f4..045d005715 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -3,6 +3,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`). ## [Unreleased] +### Added +* Support for formatting shell scripts via [shfmt](https://github.com/mvdan/sh). TODO [#9999](https://github.com/diffplug/spotless/issues/9999) ## [2.42.0] - 2024-01-15 ### Added diff --git a/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java b/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java index 97a61ddaea..5a4a1f6742 100644 --- a/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java +++ b/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 DiffPlug + * Copyright 2016-2024 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,6 +73,7 @@ import com.diffplug.spotless.maven.pom.Pom; import com.diffplug.spotless.maven.python.Python; import com.diffplug.spotless.maven.scala.Scala; +import com.diffplug.spotless.maven.shell.Shell; import com.diffplug.spotless.maven.sql.Sql; import com.diffplug.spotless.maven.typescript.Typescript; import com.diffplug.spotless.maven.yaml.Yaml; @@ -178,6 +179,9 @@ public abstract class AbstractSpotlessMojo extends AbstractMojo { @Parameter private Json json; + @Parameter + private Shell shell; + @Parameter private Yaml yaml; @@ -358,7 +362,7 @@ private FileLocator getFileLocator() { } private List getFormatterFactories() { - return Stream.concat(formats.stream(), Stream.of(groovy, java, scala, kotlin, cpp, typescript, javascript, antlr4, pom, sql, python, markdown, json, yaml, gherkin)) + return Stream.concat(formats.stream(), Stream.of(groovy, java, scala, kotlin, cpp, typescript, javascript, antlr4, pom, sql, python, markdown, json, shell, yaml, gherkin)) .filter(Objects::nonNull) .collect(toList()); } diff --git a/plugin-maven/src/main/java/com/diffplug/spotless/maven/shell/Shell.java b/plugin-maven/src/main/java/com/diffplug/spotless/maven/shell/Shell.java new file mode 100644 index 0000000000..6285bfc410 --- /dev/null +++ b/plugin-maven/src/main/java/com/diffplug/spotless/maven/shell/Shell.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 DiffPlug + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.diffplug.spotless.maven.shell; + +import java.util.Collections; +import java.util.Set; + +import org.apache.maven.project.MavenProject; + +import com.diffplug.spotless.maven.FormatterFactory; +import com.diffplug.spotless.maven.generic.LicenseHeader; + +/** + * A {@link FormatterFactory} implementation that corresponds to {@code ...} configuration element. + *

+ * It defines a formatter for shell source files that can execute both language agnostic (e.g. {@link LicenseHeader}) + * and shell-specific (e.g. {@link Shfmt}) steps. + */ +public class Shell extends FormatterFactory { + @Override + public Set defaultIncludes(MavenProject project) { + return Collections.emptySet(); + } + + @Override + public String licenseHeaderDelimiter() { + return null; + } + + public void addShfmt(Shfmt shfmt) { + addStepFactory(shfmt); + } +} diff --git a/plugin-maven/src/main/java/com/diffplug/spotless/maven/shell/Shfmt.java b/plugin-maven/src/main/java/com/diffplug/spotless/maven/shell/Shfmt.java new file mode 100644 index 0000000000..09b83240b0 --- /dev/null +++ b/plugin-maven/src/main/java/com/diffplug/spotless/maven/shell/Shfmt.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 DiffPlug + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.diffplug.spotless.maven.shell; + +import org.apache.maven.plugins.annotations.Parameter; + +import com.diffplug.spotless.FormatterStep; +import com.diffplug.spotless.maven.FormatterStepConfig; +import com.diffplug.spotless.maven.FormatterStepFactory; +import com.diffplug.spotless.shell.ShfmtStep; + +public class Shfmt implements FormatterStepFactory { + + @Parameter + private String version; + + @Parameter + private String pathToExe; + + @Override + public FormatterStep newFormatterStep(FormatterStepConfig config) { + ShfmtStep shfmt = ShfmtStep.withVersion(version == null ? ShfmtStep.defaultVersion() : version); + if (pathToExe != null) { + shfmt = shfmt.withPathToExe(pathToExe); + } + return shfmt.create(); + } +} diff --git a/plugin-maven/src/test/java/com/diffplug/spotless/maven/MavenIntegrationHarness.java b/plugin-maven/src/test/java/com/diffplug/spotless/maven/MavenIntegrationHarness.java index 4710874e9f..6b629e3596 100644 --- a/plugin-maven/src/test/java/com/diffplug/spotless/maven/MavenIntegrationHarness.java +++ b/plugin-maven/src/test/java/com/diffplug/spotless/maven/MavenIntegrationHarness.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 DiffPlug + * Copyright 2016-2024 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -179,6 +179,10 @@ protected void writePomWithJsonSteps(String... steps) throws IOException { writePom(groupWithSteps("json", including("**/*.json"), steps)); } + protected void writePomWithShellSteps(String... steps) throws IOException { + writePom(groupWithSteps("shell", including("**/*.sh"), steps)); + } + protected void writePomWithYamlSteps(String... steps) throws IOException { writePom(groupWithSteps("yaml", including("**/*.yaml"), steps)); } diff --git a/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java b/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java new file mode 100644 index 0000000000..7ffc04f49b --- /dev/null +++ b/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java @@ -0,0 +1,34 @@ +/* + * Copyright 2024 DiffPlug + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.diffplug.spotless.maven.shell; + +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.diffplug.spotless.maven.MavenIntegrationHarness; + +public class ShellTest extends MavenIntegrationHarness { + private static final Logger LOGGER = LoggerFactory.getLogger(ShellTest.class); + + @Test + public void testFormatShell() throws Exception { + writePomWithShellSteps(""); + setFile("shfmt.sh").toResource("shell/shfmt/shfmt.sh"); + mavenRunner().withArguments("spotless:apply").runNoError(); + assertFile("shfmt.sh").sameAsResource("shell/shfmt/shfmt.clean"); + } +} From fc9b6ee0f0aa2de1b9ce3ce2f50374f693798da4 Mon Sep 17 00:00:00 2001 From: Tyler Crawford Date: Mon, 15 Jan 2024 10:28:42 -0500 Subject: [PATCH 2/9] Update documentation to reflect maven shell formatting support --- CHANGES.md | 4 +++- README.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index af37f3a337..32e536f883 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,11 +10,13 @@ This document is intended for Spotless developers. We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`). ## [Unreleased] +### Added +* Maven - Support for formatting shell scripts via [shfmt](https://github.com/mvdan/sh). TODO ([#9999](https://github.com/diffplug/spotless/pull/9999)) ## [2.44.0] - 2024-01-15 ### Added * New static method to `DiffMessageFormatter` which allows to retrieve diffs with their line numbers ([#1960](https://github.com/diffplug/spotless/issues/1960)) -* Format shell via [shfmt](https://github.com/mvdan/sh). ([#1994](https://github.com/diffplug/spotless/pull/1994)) +* Gradle - Support for formatting shell scripts via [shfmt](https://github.com/mvdan/sh). ([#1994](https://github.com/diffplug/spotless/pull/1994)) ### Fixed * Fix empty files with biome >= 1.5.0 when formatting files that are in the ignore list of the biome configuration file. ([#1989](https://github.com/diffplug/spotless/pull/1989) fixes [#1987](https://github.com/diffplug/spotless/issues/1987)) * Fix a regression in BufStep where the same arguments were being provided to every `buf` invocation. ([#1976](https://github.com/diffplug/spotless/issues/1976)) diff --git a/README.md b/README.md index 4515eaf0a1..e9f94bd211 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ lib('pom.SortPomStepStep') +'{{no}} | {{yes}} lib('protobuf.BufStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |', lib('python.BlackStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |', lib('scala.ScalaFmtStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |', -lib('shell.ShfmtStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |', +lib('shell.ShfmtStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |', lib('sql.DBeaverSQLFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |', extra('wtp.EclipseWtpFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |', lib('yaml.JacksonYamlStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |', From 88e95d38065470e4e970c02dc4d0c024819d2a6d Mon Sep 17 00:00:00 2001 From: Tyler Crawford Date: Mon, 15 Jan 2024 10:30:25 -0500 Subject: [PATCH 3/9] Follow up with PR number --- CHANGES.md | 2 +- plugin-maven/CHANGES.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 32e536f883..0e8940dec6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,7 +11,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Added -* Maven - Support for formatting shell scripts via [shfmt](https://github.com/mvdan/sh). TODO ([#9999](https://github.com/diffplug/spotless/pull/9999)) +* Maven - Support for formatting shell scripts via [shfmt](https://github.com/mvdan/sh). ([#1998](https://github.com/diffplug/spotless/pull/1998)) ## [2.44.0] - 2024-01-15 ### Added diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 045d005715..8e1f2df629 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -4,7 +4,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Added -* Support for formatting shell scripts via [shfmt](https://github.com/mvdan/sh). TODO [#9999](https://github.com/diffplug/spotless/issues/9999) +* Support for formatting shell scripts via [shfmt](https://github.com/mvdan/sh). [#1998](https://github.com/diffplug/spotless/issues/1998) ## [2.42.0] - 2024-01-15 ### Added From db7563331a33a7455a244b7ae6f80ab9653d8bdd Mon Sep 17 00:00:00 2001 From: Tyler Crawford Date: Mon, 15 Jan 2024 10:31:32 -0500 Subject: [PATCH 4/9] Fix support matrix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9f94bd211..495c826df6 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ lib('yaml.JacksonYamlStep') +'{{yes}} | {{yes}} | [`protobuf.BufStep`](lib/src/main/java/com/diffplug/spotless/protobuf/BufStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: | | [`python.BlackStep`](lib/src/main/java/com/diffplug/spotless/python/BlackStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: | | [`scala.ScalaFmtStep`](lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java) | :+1: | :+1: | :+1: | :white_large_square: | -| [`shell.ShfmtStep`](lib/src/main/java/com/diffplug/spotless/shell/ShfmtStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: | +| [`shell.ShfmtStep`](lib/src/main/java/com/diffplug/spotless/shell/ShfmtStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: | | [`sql.DBeaverSQLFormatterStep`](lib/src/main/java/com/diffplug/spotless/sql/DBeaverSQLFormatterStep.java) | :+1: | :+1: | :+1: | :white_large_square: | | [`wtp.EclipseWtpFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/wtp/EclipseWtpFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: | | [`yaml.JacksonYamlStep`](lib/src/main/java/com/diffplug/spotless/yaml/JacksonYamlStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: | From 96879e54fd8a5035325ad62994486a880c924641 Mon Sep 17 00:00:00 2001 From: Tyler Crawford Date: Mon, 15 Jan 2024 10:33:39 -0500 Subject: [PATCH 5/9] Put PR link in parentheses --- plugin-maven/CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 8e1f2df629..f056aadf6e 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -4,7 +4,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Added -* Support for formatting shell scripts via [shfmt](https://github.com/mvdan/sh). [#1998](https://github.com/diffplug/spotless/issues/1998) +* Support for formatting shell scripts via [shfmt](https://github.com/mvdan/sh). ([#1998](https://github.com/diffplug/spotless/issues/1998)) ## [2.42.0] - 2024-01-15 ### Added From e32e45d489ed7285b05b9ca8eedf9c2158f641d8 Mon Sep 17 00:00:00 2001 From: Tyler Crawford Date: Mon, 15 Jan 2024 11:05:05 -0500 Subject: [PATCH 6/9] Rename ShfmtIntegrationTest, disable ShellTest --- .../{ShfmtIntegrationTest.java => ShellExtensionTest.java} | 2 +- .../test/java/com/diffplug/spotless/maven/shell/ShellTest.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) rename plugin-gradle/src/test/java/com/diffplug/gradle/spotless/{ShfmtIntegrationTest.java => ShellExtensionTest.java} (94%) diff --git a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ShfmtIntegrationTest.java b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ShellExtensionTest.java similarity index 94% rename from plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ShfmtIntegrationTest.java rename to plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ShellExtensionTest.java index 9693790679..1a4f567ccb 100644 --- a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ShfmtIntegrationTest.java +++ b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ShellExtensionTest.java @@ -22,7 +22,7 @@ import com.diffplug.spotless.tag.ShfmtTest; @ShfmtTest -public class ShfmtIntegrationTest extends GradleIntegrationHarness { +public class ShellExtensionTest extends GradleIntegrationHarness { @Test void shfmt() throws IOException { setFile("build.gradle").toLines( diff --git a/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java b/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java index 7ffc04f49b..870de85849 100644 --- a/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java +++ b/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java @@ -15,12 +15,14 @@ */ package com.diffplug.spotless.maven.shell; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.diffplug.spotless.maven.MavenIntegrationHarness; +@Disabled // Disabled due to GHA not having shfmt public class ShellTest extends MavenIntegrationHarness { private static final Logger LOGGER = LoggerFactory.getLogger(ShellTest.class); From e075ffaff74f9d7cd163e8fcc903a5d8dbd65fd7 Mon Sep 17 00:00:00 2001 From: Tyler Crawford Date: Mon, 15 Jan 2024 19:23:21 -0500 Subject: [PATCH 7/9] Update Gradle changelog for shfmt support --- plugin-gradle/CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 77b39d6804..5c41b913d2 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -6,7 +6,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [6.24.0] - 2024-01-15 ### Added -* Support for shell via [shfmt](https://github.com/mvdan/sh). +* Support for shell formatting via [shfmt](https://github.com/mvdan/sh). ([#1994](https://github.com/diffplug/spotless/pull/1994)) ### Fixed * Fix empty files with biome >= 1.5.0 when formatting files that are in the ignore list of the biome configuration file. ([#1989](https://github.com/diffplug/spotless/pull/1989) fixes [#1987](https://github.com/diffplug/spotless/issues/1987))======= * Fix a regression in BufStep where the same arguments were being provided to every `buf` invocation. ([#1976](https://github.com/diffplug/spotless/issues/1976)) From 5351d784711a9564dc024b526ea2f7f51a78f4db Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Tue, 16 Jan 2024 21:32:20 -0800 Subject: [PATCH 8/9] Replace @Disabled with @ShfmtTest. --- .../java/com/diffplug/spotless/maven/shell/ShellTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java b/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java index 870de85849..bf0e58fca6 100644 --- a/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java +++ b/plugin-maven/src/test/java/com/diffplug/spotless/maven/shell/ShellTest.java @@ -15,14 +15,14 @@ */ package com.diffplug.spotless.maven.shell; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.diffplug.spotless.maven.MavenIntegrationHarness; +import com.diffplug.spotless.tag.ShfmtTest; -@Disabled // Disabled due to GHA not having shfmt +@ShfmtTest public class ShellTest extends MavenIntegrationHarness { private static final Logger LOGGER = LoggerFactory.getLogger(ShellTest.class); From 4e5fa17209585212ebe8e9e7ed322b1acd2c54e1 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Tue, 16 Jan 2024 21:36:52 -0800 Subject: [PATCH 9/9] The special tests had a configuration bug at some point where their tag was being simultaneously excluded and included. --- gradle/special-tests.gradle | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gradle/special-tests.gradle b/gradle/special-tests.gradle index ae9da9a06e..f45759294b 100644 --- a/gradle/special-tests.gradle +++ b/gradle/special-tests.gradle @@ -1,4 +1,6 @@ apply plugin: 'com.adarshr.test-logger' + +// See com.diffplug.spotless.tag package for available JUnit 5 @Tag annotations def special = [ 'Black', 'Buf', @@ -9,10 +11,6 @@ def special = [ boolean isCiServer = System.getenv().containsKey("CI") tasks.withType(Test).configureEach { - // See com.diffplug.spotless.tag package for available JUnit 5 @Tag annotations - useJUnitPlatform { - excludeTags special as String[] - } if (isCiServer) { retry { maxRetries = 2 @@ -26,7 +24,11 @@ tasks.withType(Test).configureEach { maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1 } } - +tasks.named('test').configure { + useJUnitPlatform { + excludeTags special as String[] + } +} special.forEach { tag -> tasks.register("test${tag}", Test) { useJUnitPlatform { includeTags tag }