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

Update to Gradle 8.6, fix most warnings for Gradle 9 #4693

Merged
merged 27 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4015042
Fix implicit dependencies for generating java
niloc132 Jun 1, 2023
c2bf62c
Remove license plugin
niloc132 Jun 1, 2023
45f0068
fix main references
niloc132 Jun 1, 2023
e8c5ad6
Upgrade more deprecated gradle properties
niloc132 Jun 1, 2023
e745736
Update to Gradle 8.1.1
niloc132 Jun 1, 2023
8fb6aed
re-fix rebase damage
niloc132 Oct 21, 2023
b544069
Remove ConfigureUtil.configureUsing usage
niloc132 Oct 21, 2023
80ea12c
Update JHM plugin
niloc132 Oct 21, 2023
ff6017f
Phase out conventions in favor of extensions
niloc132 Oct 22, 2023
6b202bb
Update shadow plugin
niloc132 Oct 22, 2023
a3acec6
Update gradle to 8.4
niloc132 Oct 22, 2023
842b180
More convention cleanup, import cleanup
niloc132 Oct 22, 2023
6af7099
Update enterprise plugin
niloc132 Oct 23, 2023
38a865e
Self-review
niloc132 Oct 23, 2023
0a4eb2b
Merge branch 'main' into gradle-warnings-2
niloc132 Oct 24, 2023
b3e4551
Limit source files that Integrations tries to include
niloc132 Oct 24, 2023
a6f8ee3
Merge branch 'main' into HEAD
niloc132 Feb 15, 2024
69f8619
Update new codegen
niloc132 Feb 15, 2024
3b05b47
Update gradle plugins to better support 8.x
niloc132 Feb 15, 2024
b883810
Update go Gradle 8.6
niloc132 Feb 15, 2024
3f4cdb6
Fix test gradle wrapper
niloc132 Feb 16, 2024
6ac253f
Fix junit platform classpath changes
niloc132 Feb 16, 2024
29d8b49
Change difftask configuration to not confuse gradle with inputs vs
niloc132 Feb 16, 2024
52bbed9
Add task dependency to make Gradle happier with our odd r doc setup
niloc132 Feb 17, 2024
a856472
Clarify that this is an ordering issue, not dependency
niloc132 Feb 18, 2024
d2e3235
Ensure cpp docs are built before next image is made
niloc132 Feb 18, 2024
f917706
Review feedback, re-update wrapper
niloc132 Feb 26, 2024
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
2 changes: 1 addition & 1 deletion Base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sourceSets {

// TODO (core#116): Gradle test fixtures
task jarTests(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
archiveClassifier = 'tests'
from sourceSets.test.output
}
configurations {
Expand Down
28 changes: 14 additions & 14 deletions Generators/Generators.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ String devRoot = rootDir.absolutePath
task groovyStaticImportGenerator(type: JavaExec, dependsOn: 'classes') {
description 'Run GroovyStaticImportGenerator'

main = 'io.deephaven.libs.GroovyStaticImportGenerator'
mainClass.set 'io.deephaven.libs.GroovyStaticImportGenerator'
args devRoot, 'false'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -51,7 +51,7 @@ task groovyStaticImportGenerator(type: JavaExec, dependsOn: 'classes') {
task groovyStaticImportGeneratorAssert(type: JavaExec, dependsOn: 'classes') {
description 'Run GroovyStaticImportGenerator to assert that the generated code has not changed'

main = 'io.deephaven.libs.GroovyStaticImportGenerator'
mainClass.set 'io.deephaven.libs.GroovyStaticImportGenerator'
args devRoot, 'true'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -61,7 +61,7 @@ task groovyStaticImportGeneratorAssert(type: JavaExec, dependsOn: 'classes') {
task generateStaticCalendarMethods(type: JavaExec, dependsOn: 'classes') {
description 'Run StaticCalendarMethodsGenerator'

main = 'io.deephaven.libs.StaticCalendarMethodsGenerator'
mainClass.set 'io.deephaven.libs.StaticCalendarMethodsGenerator'
args devRoot, 'false'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -70,7 +70,7 @@ task generateStaticCalendarMethods(type: JavaExec, dependsOn: 'classes') {
task generateStaticCalendarMethodsAssert(type: JavaExec, dependsOn: 'classes') {
description 'Run StaticCalendarMethodsGenerator to assert that the generated code has not changed'

main = 'io.deephaven.libs.StaticCalendarMethodsGenerator'
mainClass.set 'io.deephaven.libs.StaticCalendarMethodsGenerator'
args devRoot, 'true'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -80,7 +80,7 @@ task generateStaticCalendarMethodsAssert(type: JavaExec, dependsOn: 'classes') {
task generateAxesPlotMethods(type: JavaExec, dependsOn: 'classes') {
description 'Run GenerateAxesPlotMethods'

main = 'io.deephaven.plot.util.GenerateAxesPlotMethods'
mainClass.set 'io.deephaven.plot.util.GenerateAxesPlotMethods'
args devRoot, 'false'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -91,7 +91,7 @@ task generateAxesPlotMethods(type: JavaExec, dependsOn: 'classes') {
task generateAxesPlotMethodsAssert(type: JavaExec, dependsOn: 'classes') {
description 'Run GenerateAxesPlotMethods to assert that the generated code has not changed'

main = 'io.deephaven.plot.util.GenerateAxesPlotMethods'
mainClass.set 'io.deephaven.plot.util.GenerateAxesPlotMethods'
args devRoot, 'true'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -103,7 +103,7 @@ task generateAxesPlotMethodsAssert(type: JavaExec, dependsOn: 'classes') {
task generateMultiSeries(type: JavaExec, dependsOn: 'classes') {
description 'Run GenerateMultiSeries'

main = 'io.deephaven.plot.util.GenerateMultiSeries'
mainClass.set 'io.deephaven.plot.util.GenerateMultiSeries'
args devRoot, 'false'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -114,7 +114,7 @@ task generateMultiSeries(type: JavaExec, dependsOn: 'classes') {
task generateMultiSeriesAssert(type: JavaExec, dependsOn: 'classes') {
description 'Run GenerateMultiSeries to assert that the generated code has not changed'

main = 'io.deephaven.plot.util.GenerateMultiSeries'
mainClass.set 'io.deephaven.plot.util.GenerateMultiSeries'
args devRoot, 'true'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -127,7 +127,7 @@ task generateFigureImmutable(type: JavaExec, dependsOn: 'classes') {
description 'Run GenerateFigureImmutable'
dependsOn generateAxesPlotMethods, generateMultiSeries

main = 'io.deephaven.plot.util.GenerateFigureImmutable'
mainClass.set 'io.deephaven.plot.util.GenerateFigureImmutable'
args devRoot, 'false'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -139,7 +139,7 @@ task generateFigureImmutableAssert(type: JavaExec, dependsOn: 'classes') {
description 'Run GenerateFigureImmutable to assert that the generated code has not changed'
dependsOn generateAxesPlotMethodsAssert, generateMultiSeriesAssert

main = 'io.deephaven.plot.util.GenerateFigureImmutable'
mainClass.set 'io.deephaven.plot.util.GenerateFigureImmutable'
args devRoot, 'true'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -152,7 +152,7 @@ task generatePlottingConvenience(type: JavaExec, dependsOn: 'classes') {
description 'Run GeneratePlottingConvenience'
dependsOn generateFigureImmutable

main = 'io.deephaven.plot.util.GeneratePlottingConvenience'
mainClass.set 'io.deephaven.plot.util.GeneratePlottingConvenience'
args devRoot
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -164,7 +164,7 @@ task generatePlottingConvenienceAssert(type: JavaExec, dependsOn: 'classes') {
description 'Run GeneratePlottingConvenience to assert that the generated code has not changed'
dependsOn generateFigureImmutableAssert

main = 'io.deephaven.plot.util.GeneratePlottingConvenience'
mainClass.set 'io.deephaven.plot.util.GeneratePlottingConvenience'
args devRoot, 'true'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -176,7 +176,7 @@ task generatePythonFigureWrapper(type: JavaExec, dependsOn: 'classes') {
description 'Run GeneratePythonFigureWrapper'
dependsOn generatePlottingConvenience

main = 'io.deephaven.plot.util.GeneratePyV2FigureAPI'
mainClass.set 'io.deephaven.plot.util.GeneratePyV2FigureAPI'
args devRoot, 'false'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand All @@ -189,7 +189,7 @@ task generatePythonFigureWrapperAssert(type: JavaExec, dependsOn: 'classes') {
description 'Run GeneratePythonFigureWrapper'
dependsOn generatePlottingConvenienceAssert

main = 'io.deephaven.plot.util.GeneratePyV2FigureAPI'
mainClass.set 'io.deephaven.plot.util.GeneratePyV2FigureAPI'
args devRoot, 'true'
classpath = sourceSets.main.runtimeClasspath
workingDir = workDir
Expand Down
2 changes: 1 addition & 1 deletion IO/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sourceSets {

// TODO (core#116): Gradle test fixtures
task jarTests(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
archiveClassifier = 'tests'
from sourceSets.test.output
}
configurations {
Expand Down
8 changes: 6 additions & 2 deletions Integrations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ sourceSets {
}
}

JavaPluginConvention java = project.convention.plugins.get('java') as JavaPluginConvention
SourceSet test = java.sourceSets.maybeCreate('test')
SourceSet test = extensions.findByType(JavaPluginExtension).sourceSets.maybeCreate('test')

def runInDocker = { String name, String sourcePath, List<String> command, Closure addConfig = {} ->
Docker.registerDockerTask(project, name) {
copyIn {
from(sourcePath) {
include 'deephaven/**'
include 'deephaven_internal/**'
include 'test_helper/**'
include 'tests/**'
include 'setup.py'
into 'python'
}
from(test.runtimeClasspath) {
Expand Down
1 change: 1 addition & 0 deletions R/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def rClientSite = Docker.registerDockerTask(project, 'rClientSite') {
// Only tested on x86-64, and we only build dependencies for x86-64
platform = 'linux/amd64'
copyIn {
mustRunAfter(rClientDoc)
from(layout.projectDirectory) {
include 'r-site.sh'
include 'rdeephaven/man/**'
Expand Down
1 change: 1 addition & 0 deletions Util/Util.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ dependencies {
testImplementation project(':base-test-utils')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
1 change: 1 addition & 0 deletions Util/channel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies {
Classpaths.inheritAssertJ(project)
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

test {
Expand Down
1 change: 1 addition & 0 deletions Util/function/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {
Classpaths.inheritAssertJ(project)
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

test {
Expand Down
2 changes: 1 addition & 1 deletion authentication/example-providers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ project.subprojects { Project p ->
p.tasks.findByName('assemble').dependsOn(p.tasks.named('shadowJar'))

// Let projects be named consistently
p.archivesBaseName = "deephaven-${p.name}-authentication-provider"
p.base.archivesName = "deephaven-${p.name}-authentication-provider"
}
9 changes: 2 additions & 7 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repositories {
}

dependencies {
implementation('de.esoco.gwt:gwt-gradle-plugin:1.1.1') {
implementation('de.esoco.gwt:gwt-gradle-plugin:1.2.0') {
exclude group: 'org.codehaus.groovy'
because('needed for GwtTools')
}
Expand All @@ -34,10 +34,5 @@ dependencies {
because('needed by plugin java-coding-conventions')
}

// TODO(deephaven-core#1997): Remove license-gradle-plugin
implementation('gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1') {
because('needed by plugin java-header-conventions')
}
Comment on lines -37 to -40
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More license stuff removed.


implementation "gradle.plugin.com.github.johnrengelman:shadow:7.1.2"
implementation "com.github.johnrengelman:shadow:8.1.1"
}
1 change: 0 additions & 1 deletion buildSrc/src/main/groovy/Classpaths.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency
import org.gradle.api.plugins.JavaPlatformPlugin
import org.gradle.api.plugins.JavaPlugin
import org.gradle.internal.Actions

Expand Down
51 changes: 26 additions & 25 deletions buildSrc/src/main/groovy/Docker.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import org.gradle.api.file.CopySpec
import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.Sync
import org.gradle.api.tasks.TaskProvider
import org.gradle.util.ConfigureUtil

/**
* Tools to make some common tasks in docker easier to use in gradle
Expand Down Expand Up @@ -72,13 +71,18 @@ class Docker {
/**
* DSL object to describe a docker task
*/
static class DockerTaskConfig {
abstract static class DockerTaskConfig {

private Action<? super CopySpec> copyIn;
private Action<? super Sync> copyOut;
private File dockerfileFile;
private Action<? super Dockerfile> dockerfileAction;
private TaskDependencies containerDependencies = new TaskDependencies();

/**
* Declares tasks that this group of tasks should depend on or be
* finalized by.
*/
TaskDependencies containerDependencies = new TaskDependencies();

/**
* Files that need to be copied in to the image.
Expand All @@ -87,12 +91,6 @@ class Docker {
copyIn = action;
return this;
}
/**
* Files that need to be copied in to the image.
*/
DockerTaskConfig copyIn(Closure closure) {
return copyIn(ConfigureUtil.configureUsing(closure))
}

/**
* Resulting files to copy out from the containerOutPath.
Expand All @@ -101,12 +99,6 @@ class Docker {
copyOut = action;
return this;
}
/**
* Resulting files to copy out from the containerOutPath.
*/
DockerTaskConfig copyOut(Closure closure) {
return copyOut(ConfigureUtil.configureUsing(closure))
}

/**
* Dockerfile to use. If not set, it is assumed that a dockerfile will be included in copyIn.
Expand All @@ -122,12 +114,6 @@ class Docker {
this.dockerfileAction = action;
return this;
}
/**
* Dockerfile to use. If not set, it is assumed that a dockerfile will be included in copyIn.
*/
DockerTaskConfig dockerfile(Closure closure) {
dockerfile(ConfigureUtil.configureUsing(closure));
}

/**
* Tag to apply to the created image. Defaults to "deephaven/" followed by the task name.
Expand Down Expand Up @@ -208,7 +194,12 @@ class Docker {
* @return a task provider for the Sync task that will produce the requested output
*/
static TaskProvider<? extends Task> registerDockerTask(Project project, String taskName, Closure closure) {
return registerDockerTask(project, taskName, ConfigureUtil.configureUsing(closure))
return registerDockerTask(project, taskName, new Action<DockerTaskConfig>() {
@Override
void execute(DockerTaskConfig dockerTaskConfig) {
project.configure(dockerTaskConfig, closure)
}
})
}

/**
Expand All @@ -221,7 +212,7 @@ class Docker {
*/
static TaskProvider<? extends Task> registerDockerTask(Project project, String taskName, Action<? super DockerTaskConfig> action) {
// create instance, assign defaults
DockerTaskConfig cfg = new DockerTaskConfig();
DockerTaskConfig cfg = project.objects.newInstance(DockerTaskConfig);
cfg.imageName = "deephaven/${taskName.replaceAll(/\B[A-Z]/) { String str -> '-' + str }.toLowerCase()}:${LOCAL_BUILD_TAG}"

// ask for more configuration
Expand Down Expand Up @@ -576,7 +567,12 @@ class Docker {
}

static TaskProvider<? extends DockerBuildImage> registerDockerTwoPhaseImage(Project project, String baseName, String intermediate, Closure closure) {
return registerDockerTwoPhaseImage(project, baseName, intermediate, ConfigureUtil.configureUsing(closure))
return registerDockerTwoPhaseImage(project, baseName, intermediate, new Action<DockerBuildImage>() {
@Override
void execute(DockerBuildImage dockerBuildImage) {
project.configure(dockerBuildImage, closure)
}
})
}

static TaskProvider<? extends DockerBuildImage> registerDockerTwoPhaseImage(Project project, String baseName, String intermediate, Action<? super DockerBuildImage> action) {
Expand All @@ -598,7 +594,12 @@ class Docker {
}

static TaskProvider<? extends DockerBuildImage> registerDockerImage(Project project, String taskName, Closure closure) {
return registerDockerImage(project, taskName, ConfigureUtil.configureUsing(closure))
return registerDockerImage(project, taskName, new Action<DockerBuildImage>() {
@Override
void execute(DockerBuildImage dockerBuildImage) {
project.configure(dockerBuildImage, closure)
}
})
}

static TaskProvider<? extends DockerBuildImage> registerDockerImage(Project project, String taskName, Action<? super DockerBuildImage> action) {
Expand Down
12 changes: 5 additions & 7 deletions buildSrc/src/main/groovy/Tasks.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import groovy.transform.CompileStatic
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.tasks.JavaExec
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.TaskProvider
Expand All @@ -13,22 +13,20 @@ class Tasks {

static TaskProvider<? extends JavaExec> registerMainExecTask(Project project, String taskName, String mainClassName) {
return project.tasks.register(taskName, JavaExec) { task ->
JavaPluginConvention java = project.convention.plugins.get('java') as JavaPluginConvention
SourceSet sourceSet = java.sourceSets.getByName('main')
SourceSet sourceSet = project.extensions.findByType(JavaPluginExtension).sourceSets.getByName('main')
task.workingDir project.rootDir
task.classpath = sourceSet.runtimeClasspath
task.main = mainClassName
task.mainClass.set mainClassName
task.systemProperty 'Configuration.rootFile', 'dh-defaults.prop'
}
}

static TaskProvider<? extends JavaExec> registerTestExecTask(Project project, String taskName, String mainClassName) {
return project.tasks.register(taskName, JavaExec) { task ->
JavaPluginConvention java = project.convention.plugins.get('java') as JavaPluginConvention
SourceSet sourceSet = java.sourceSets.getByName('test')
SourceSet sourceSet = project.extensions.findByType(JavaPluginExtension).sourceSets.getByName('main')
task.workingDir project.rootDir
task.classpath = sourceSet.runtimeClasspath
task.main = mainClassName
task.mainClass.set mainClassName
task.systemProperty 'Configuration.rootFile', 'dh-tests.prop'
}
}
Expand Down
Loading
Loading