Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Gradle 7.4 #7351

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.gradle.api.Action;
import org.gradle.api.internal.ClassPathRegistry;
import org.gradle.api.internal.file.TemporaryFileProvider;
import org.gradle.api.internal.file.temp.TemporaryFileProvider;
import org.gradle.api.logging.LoggingManager;
import org.gradle.internal.id.IdGenerator;
import org.gradle.internal.jvm.inspection.JvmVersionDetector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
import org.gradle.internal.Factory;
import org.gradle.internal.actor.ActorFactory;
import org.gradle.internal.time.Clock;
import org.gradle.internal.work.WorkerLeaseRegistry;
import org.gradle.internal.work.WorkerLeaseService;
import org.gradle.process.internal.worker.WorkerProcessFactory;

/**
* A copy of {@link DefaultTestExecuter} from Gradle v6.8.3, modified to process each test class
* A copy of {@link DefaultTestExecuter} from Gradle v7.4, modified to process each test class
* as many times as it was submitted. This is required by our {@link RepeatTest} task, because:
* <ul>
* <li>Geode's {@code RepeatTest} task operates by submitting each test class for processing
Expand All @@ -71,7 +71,7 @@ public class RepeatTestExecuter implements TestExecuter<JvmTestExecutionSpec> {
private final WorkerProcessFactory workerFactory;
private final ActorFactory actorFactory;
private final ModuleRegistry moduleRegistry;
private final WorkerLeaseRegistry workerLeaseRegistry;
private final WorkerLeaseService workerLeaseService;
private final int maxWorkerCount;
private final Clock clock;
private final DocumentationRegistry documentationRegistry;
Expand All @@ -80,13 +80,13 @@ public class RepeatTestExecuter implements TestExecuter<JvmTestExecutionSpec> {
private TestClassProcessor processor;

public RepeatTestExecuter(WorkerProcessFactory workerFactory, ActorFactory actorFactory,
ModuleRegistry moduleRegistry, WorkerLeaseRegistry workerLeaseRegistry, int maxWorkerCount,
ModuleRegistry moduleRegistry, WorkerLeaseService workerLeaseService, int maxWorkerCount,
Clock clock, DocumentationRegistry documentationRegistry, DefaultTestFilter testFilter,
int iterationCount) {
this.workerFactory = workerFactory;
this.actorFactory = actorFactory;
this.moduleRegistry = moduleRegistry;
this.workerLeaseRegistry = workerLeaseRegistry;
this.workerLeaseService = workerLeaseService;
this.maxWorkerCount = maxWorkerCount;
this.clock = clock;
this.documentationRegistry = documentationRegistry;
Expand All @@ -99,17 +99,14 @@ public void execute(final JvmTestExecutionSpec testExecutionSpec,
TestResultProcessor testResultProcessor) {
final TestFramework testFramework = testExecutionSpec.getTestFramework();
final WorkerTestClassProcessorFactory testInstanceFactory = testFramework.getProcessorFactory();
final WorkerLeaseRegistry.WorkerLease
currentWorkerLease =
workerLeaseRegistry.getCurrentWorkerLease();
final Set<File> classpath = ImmutableSet.copyOf(testExecutionSpec.getClasspath());
final Set<File> modulePath = ImmutableSet.copyOf(testExecutionSpec.getModulePath());
final List<String>
testWorkerImplementationModules =
testFramework.getTestWorkerImplementationModules();
final Factory<TestClassProcessor> forkingProcessorFactory = () -> {
TestClassProcessor forkingTestClassProcessor =
new ForkingTestClassProcessor(currentWorkerLease, workerFactory, testInstanceFactory,
new ForkingTestClassProcessor(workerLeaseService, workerFactory, testInstanceFactory,
testExecutionSpec.getJavaForkOptions(), classpath, modulePath,
testWorkerImplementationModules, testFramework.getWorkerConfigurationAction(),
moduleRegistry, documentationRegistry);
Expand Down Expand Up @@ -139,7 +136,7 @@ public void execute(final JvmTestExecutionSpec testExecutionSpec,
detector = new DefaultTestClassScanner(testClassFiles, null, processor);
}

new TestMainAction(detector, processor, testResultProcessor, clock, testExecutionSpec.getPath(),
new TestMainAction(detector, processor, testResultProcessor, workerLeaseService, clock, testExecutionSpec.getPath(),
"Gradle Test Run " + testExecutionSpec.getIdentityPath()).run();
}

Expand Down
9 changes: 7 additions & 2 deletions geode-assembly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ tasks.register('defaultDistributionConfig', JavaExec) {
project(':geode-core').sourceSets.main.runtimeClasspath
}
outputs.file file("$buildDir/gemfire.properties")
main 'org.apache.geode.distributed.internal.DefaultPropertiesGenerator'
mainClass = 'org.apache.geode.distributed.internal.DefaultPropertiesGenerator'
classpath configurations.defaultDistributionConfigClasspath
workingDir buildDir

Expand All @@ -328,7 +328,7 @@ tasks.register('defaultCacheConfig', JavaExec) {
project(':geode-core').sourceSets.main.runtimeClasspath
}
outputs.file file("$buildDir/cache.xml")
main 'org.apache.geode.internal.cache.xmlcache.CacheXmlGenerator'
mainClass = 'org.apache.geode.internal.cache.xmlcache.CacheXmlGenerator'
classpath configurations.defaultCacheConfigClasspath
workingDir buildDir

Expand Down Expand Up @@ -559,6 +559,11 @@ tasks.withType(Test) {
environment 'GEODE_HOME', "$buildDir/install/${distributions.main.distributionBaseName.get()}"
}

processDistributedTestResources {
dependsOn('downloadWebServers')
}



acceptanceTest.dependsOn(rootProject.getTasksByName("publishToMavenLocal", true))
installDist.dependsOn ':extensions:geode-modules-assembly:dist'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repositories {
}

dependencies {
compile("${project.group}:geode-core:${project.version}")
implementation("${project.group}:geode-core:${project.version}")
runtime('org.apache.logging.log4j:log4j-slf4j-impl:2.12.0')
}

Expand Down
5 changes: 5 additions & 0 deletions geode-connectors/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ configurations {
jdbcTestingJars
}
def jdbcJarsDir = "$buildDir/generated-resources/jdbcJars"

sourceSets {
distributedTest {
resources {
Expand All @@ -40,6 +41,10 @@ task downloadJdbcJars(type:Copy) {
into jdbcJarsDir
}

processDistributedTestResources {
dependsOn('downloadJdbcJars')
}

dependencies {
api(platform(project(':boms:geode-all-bom')))

Expand Down
4 changes: 4 additions & 0 deletions geode-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,7 @@ distributedTest {
}

rootProject.generate.dependsOn(generateGrammarSource)

project.tasks.named("processIntegrationTestResources") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
4 changes: 2 additions & 2 deletions gradle/java.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ gradle.taskGraph.whenReady({ graph ->

configurations {
testOutput {
extendsFrom testCompile
extendsFrom testImplementation
description 'a dependency that exposes test artifacts'
}
}
Expand Down Expand Up @@ -190,7 +190,7 @@ javadoc {
options.encoding = 'UTF-8'
exclude "**/internal/**"

classpath += configurations.compileOnly
classpath += configurations.compileClasspath
}


6 changes: 3 additions & 3 deletions gradle/publish-artifacts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ publishing {
withXml {
// This black magic checks to see if a dependency has the flag ext.optional=true
// set on it, and if so marks the dependency as optional in the maven pom
def depMap = project.configurations.compile.dependencies.collectEntries { [it.name, it] }
def runtimeDeps = project.configurations.runtime.dependencies.collectEntries {
def depMap = project.configurations.compileClasspath.dependencies.collectEntries { [it.name, it] }
def runtimeDeps = project.configurations.runtimeClasspath.dependencies.collectEntries {
[it.name, it]
}
depMap.putAll(runtimeDeps)
Expand Down Expand Up @@ -69,4 +69,4 @@ publishing {
}
}
}
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading