From 6f06ab5ce45534639428cfc5bf84d758f34fce54 Mon Sep 17 00:00:00 2001 From: slandelle Date: Mon, 4 Mar 2024 22:37:10 +0100 Subject: [PATCH] chore: drop legacy task --- .../io/gatling/gradle/GatlingPlugin.groovy | 26 ------------------- src/test/groovy/func/WhenPackageSpec.groovy | 16 ------------ 2 files changed, 42 deletions(-) diff --git a/src/main/groovy/io/gatling/gradle/GatlingPlugin.groovy b/src/main/groovy/io/gatling/gradle/GatlingPlugin.groovy index f313d69..74c801a 100644 --- a/src/main/groovy/io/gatling/gradle/GatlingPlugin.groovy +++ b/src/main/groovy/io/gatling/gradle/GatlingPlugin.groovy @@ -3,7 +3,6 @@ package io.gatling.gradle import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.ProjectConfigurationException import org.gradle.api.plugins.scala.ScalaPlugin import org.gradle.api.tasks.TaskProvider import org.gradle.util.GradleVersion @@ -26,11 +25,6 @@ final class GatlingPlugin implements Plugin { public static def ENTERPRISE_START_TASK_NAME = "gatlingEnterpriseStart" - /** - * @deprecated Please use {@link io.gatling.gradle.GatlingPlugin#ENTERPRISE_PACKAGE_TASK_NAME} instead - */ - public static def FRONTLINE_JAR_TASK_NAME = "frontLineJar" - void apply(Project project) { if (GradleVersion.current() < GradleVersion.version("7.1")) { @@ -76,26 +70,6 @@ final class GatlingPlugin implements Plugin { } } } - - project.afterEvaluate { - if (project.plugins.findPlugin('io.gatling.frontline.gradle')) { - def errorMessage = """\ - Plugin io.gatling.frontline.gradle is no longer needed, its functionality is now included in the io.gatling.gradle plugin. - Please remove io.gatling.frontline.gradle from your build.gradle configuration file, and use the $ENTERPRISE_PACKAGE_TASK_NAME task instead of $FRONTLINE_JAR_TASK_NAME. - See https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/ for more information.""".stripIndent() - throw new ProjectConfigurationException(errorMessage, []) - } else { - project.tasks.register(FRONTLINE_JAR_TASK_NAME) { - doFirst { - logger.warn("""\ - Task $FRONTLINE_JAR_TASK_NAME is deprecated and will be removed in a future version. - Please use $ENTERPRISE_PACKAGE_TASK_NAME instead. - See https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/ for more information.""".stripIndent()) - } - finalizedBy(gatlingEnterprisePackage) - } - } - } } void registerGatlingTask(Project project, String taskName, String simulationFQN) { diff --git a/src/test/groovy/func/WhenPackageSpec.groovy b/src/test/groovy/func/WhenPackageSpec.groovy index 8f6a5db..53d2412 100644 --- a/src/test/groovy/func/WhenPackageSpec.groovy +++ b/src/test/groovy/func/WhenPackageSpec.groovy @@ -5,7 +5,6 @@ import org.gradle.testkit.runner.BuildResult import spock.lang.Unroll import static io.gatling.gradle.GatlingPlugin.ENTERPRISE_PACKAGE_TASK_NAME -import static io.gatling.gradle.GatlingPlugin.FRONTLINE_JAR_TASK_NAME import static org.gradle.testkit.runner.TaskOutcome.SUCCESS class WhenPackageSpec extends GatlingFuncSpec { @@ -28,19 +27,4 @@ class WhenPackageSpec extends GatlingFuncSpec { where: gradleVersion << SUPPORTED_GRADLE_VERSIONS } - - def "should create a package using the legacy task name"() { - setup: - prepareTest() - when: - BuildResult result = executeGradle(FRONTLINE_JAR_TASK_NAME) - then: "default tasks were executed successfully" - result.task(":$FRONTLINE_JAR_TASK_NAME").outcome == SUCCESS - result.task(":$ENTERPRISE_PACKAGE_TASK_NAME").outcome == SUCCESS - result.task(":gatlingClasses").outcome == SUCCESS - def artifactId = projectDir.root.getName() - def artifact = new File(buildDir, "libs/${artifactId}-tests.jar") - and: "artifact was created" - artifact.isFile() - } }