chore: remove Groovy compilation from the build pipeline

This commit is contained in:
Vladimir Sitnikov 2023-12-27 14:27:15 +03:00
parent dfe4649a30
commit e5355de319
9 changed files with 1 additions and 111 deletions

View File

@ -53,8 +53,7 @@ Optionally you can generate an Eclipse project by running
The steps to import the sources (based on Eclipse 2019-06) into Eclipse are as follows:
1. Install `Eclipse IDE for Java Developers`
1. Install the Groovy Eclipse plugin and select Groovy Compiler 2.4 (some tests are written in Groovy)
1. Install `Kotlin for Eclipse` plugin (builds scripts are written in Kotlin)
1. Install `Kotlin for Eclipse` plugin (JMeter code uses Java and Kotlin)
1. Make sure you have a Java 8 compatible JDK configured in your workspace
1. Open `File->Import...`
1. Select `Existing Gradle Project` and click `Next`

View File

@ -1,34 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you 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.
*/
import com.github.vlsi.gradle.dsl.configureEach
plugins {
id("java")
id("groovy")
id("build-logic.test-spock")
id("com.github.vlsi.gradle-extensions")
id("build-logic.build-params")
}
tasks.configureEach<GroovyCompile> {
buildParameters.testJdk?.let {
javaLauncher.convention(javaToolchains.launcherFor(it))
}
// Support jdk-release to configure the target Java release when compiling the bytecode
// See https://issues.apache.org/jira/browse/GROOVY-11105
}

View File

@ -19,10 +19,6 @@ plugins {
id("build-logic.java-library")
}
if (file("src/main/groovy").isDirectory || file("src/test/groovy").isDirectory) {
apply(plugin = "build-logic.groovy")
}
if (file("src/main/kotlin").isDirectory || file("src/test/kotlin").isDirectory) {
apply(plugin = "build-logic.kotlin")
}

View File

@ -61,20 +61,4 @@ tasks.configureEach<Test> {
passProperty("skip.test_TestDNSCacheManager.testWithCustomResolverAnd1Server")
// Enable testing ByteBuddy with EA Java versions
passProperty("net.bytebuddy.experimental", "true")
// Spock tests use cglib proxies that access ClassLoader.defineClass reflectively,
// So we pass --add-opens
// See https://github.com/apache/jmeter/pull/5763
jvmArgumentProviders += AddOpensArgumentsProvider(javaLauncher.map { it.metadata.languageVersion })
}
class AddOpensArgumentsProvider(
@Input val javaLanguageVersion: Provider<JavaLanguageVersion>
): CommandLineArgumentProvider {
override fun asArguments(): Iterable<String> =
if (javaLanguageVersion.get().asInt() <= 8) {
// Jave 1.8 does not need add-opens, so we omit it
listOf()
} else {
listOf("--add-opens=java.base/java.lang=ALL-UNNAMED")
}
}

View File

@ -1,46 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you 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.
*/
plugins {
`java-library`
id("build-logic.test-base")
}
dependencies {
testImplementation("org.spockframework:spock-core")
testRuntimeOnly("cglib:cglib-nodep") {
because(
"""
org.spockframework.mock.CannotCreateMockException: Cannot create mock for
class org.apache.jmeter.report.processor.AbstractSummaryConsumer${'$'}SummaryInfo.
Mocking of non-interface types requires a code generation library.
Please put an up-to-date version of byte-buddy or cglib-nodep on the class path.
""".trimIndent()
)
}
testRuntimeOnly("org.objenesis:objenesis") {
because(
"""
org.spockframework.mock.CannotCreateMockException: Cannot create mock for
class org.apache.jmeter.report.core.Sample. To solve this problem,
put Objenesis 1.2 or higher on the class path (recommended),
or supply constructor arguments (e.g. 'constructorArgs: [42]') that allow to construct
an object of the mocked type.
""".trimIndent()
)
}
}

View File

@ -211,7 +211,6 @@
<trusted-key id='60200ac4ae761f1614d6c46766d68daa073be985' group='org.slf4j' />
<trusted-key id='2b1042677fd8190c7b9fc0dc2161d72e7dcd4258' group='org.sonarsource.scanner.api' />
<trusted-key id='f1182e81c792928921dbcab4cfca4a29d26468de' group='org.sonarsource.scanner.api' />
<trusted-key id='76e94e8ff0ab5af3b6f8366972fefd1572eb75e1' group='org.spockframework' />
<trusted-key id='8756c4f765c9ac3cb6b85d62379ce192d401ab61' group='org.springframework' />
<trusted-key id='e2acb037933cdeaab7bf77d49a2c7a98e457c53d' group='org.springframework' />
<trusted-key id='7cd52b5a8295137c88fb5748dddafa7674e54418' group='org.testng' />

View File

@ -113,12 +113,6 @@
"groupName": "org.slf4j",
"allowedVersions": "< 2.0.0"
},
{
"matchPackagePrefixes": ["org.spockframework"],
"groupName": "org.spockframework",
"description": "TODO: change when we upgrade to Groovy 4.0",
"allowedVersions": "/.*-groovy-3.0/"
},
{
"matchPackagePatterns": ["^src:protocol"],
"enabled": false

View File

@ -56,7 +56,6 @@ dependencies {
api("org.objenesis:objenesis:3.3")
api("org.openjdk.jmh:jmh-core:1.37")
api("org.openjdk.jmh:jmh-generator-annprocess:1.37")
api("org.spockframework:spock-core:2.3-groovy-3.0")
api("org.springframework:spring-beans:4.3.30.RELEASE")
api("org.springframework:spring-context:4.3.30.RELEASE")
}

View File

@ -91,7 +91,6 @@ dependencies {
testFixturesImplementation(testFixtures(projects.src.core))
testFixturesImplementation("junit:junit")
testImplementation("io.mockk:mockk")
testFixturesImplementation("org.spockframework:spock-core")
}
if (!buildParameters.enableJavaFx) {