Skip to content

Commit

Permalink
chore: drop legacy task
Browse files Browse the repository at this point in the history
  • Loading branch information
slandelle committed Mar 4, 2024
1 parent b543324 commit 6f06ab5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
26 changes: 0 additions & 26 deletions src/main/groovy/io/gatling/gradle/GatlingPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,11 +25,6 @@ final class GatlingPlugin implements Plugin<Project> {

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")) {
Expand Down Expand Up @@ -76,26 +70,6 @@ final class GatlingPlugin implements Plugin<Project> {
}
}
}

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) {
Expand Down
16 changes: 0 additions & 16 deletions src/test/groovy/func/WhenPackageSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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()
}
}

0 comments on commit 6f06ab5

Please sign in to comment.