diff --git a/Base/build.gradle b/Base/build.gradle index 3dacf543b24..7bdb1ca32c5 100644 --- a/Base/build.gradle +++ b/Base/build.gradle @@ -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 { diff --git a/Generators/Generators.gradle b/Generators/Generators.gradle index 7c6dc49da93..7af8ed074e1 100644 --- a/Generators/Generators.gradle +++ b/Generators/Generators.gradle @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/IO/build.gradle b/IO/build.gradle index 16bc7c6bb25..84e77e52d67 100644 --- a/IO/build.gradle +++ b/IO/build.gradle @@ -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 { diff --git a/Integrations/build.gradle b/Integrations/build.gradle index 41d99e895d3..9a182f7b907 100644 --- a/Integrations/build.gradle +++ b/Integrations/build.gradle @@ -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 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) { diff --git a/R/build.gradle b/R/build.gradle index 3422148f221..6596fdd5631 100644 --- a/R/build.gradle +++ b/R/build.gradle @@ -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/**' diff --git a/Util/Util.gradle b/Util/Util.gradle index 5b1a023dcc2..08b74258a7f 100644 --- a/Util/Util.gradle +++ b/Util/Util.gradle @@ -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' } diff --git a/Util/channel/build.gradle b/Util/channel/build.gradle index dffa3d52b91..4d479e69526 100644 --- a/Util/channel/build.gradle +++ b/Util/channel/build.gradle @@ -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 { diff --git a/Util/function/build.gradle b/Util/function/build.gradle index 74f3394075c..6b0feeb4d9f 100644 --- a/Util/function/build.gradle +++ b/Util/function/build.gradle @@ -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 { diff --git a/authentication/example-providers/build.gradle b/authentication/example-providers/build.gradle index 62fcfbe12a5..4d1761cd04e 100644 --- a/authentication/example-providers/build.gradle +++ b/authentication/example-providers/build.gradle @@ -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" } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index d4d8972f5f5..96cc1777c1e 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -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') } @@ -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') - } - - implementation "gradle.plugin.com.github.johnrengelman:shadow:7.1.2" + implementation "com.github.johnrengelman:shadow:8.1.1" } diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 40d0fc8f7a6..80412826241 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -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 diff --git a/buildSrc/src/main/groovy/Docker.groovy b/buildSrc/src/main/groovy/Docker.groovy index 618dd9f6404..8405b43950c 100644 --- a/buildSrc/src/main/groovy/Docker.groovy +++ b/buildSrc/src/main/groovy/Docker.groovy @@ -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 @@ -72,13 +71,18 @@ class Docker { /** * DSL object to describe a docker task */ - static class DockerTaskConfig { + abstract static class DockerTaskConfig { private Action copyIn; private Action copyOut; private File dockerfileFile; private Action 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. @@ -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. @@ -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. @@ -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. @@ -208,7 +194,12 @@ class Docker { * @return a task provider for the Sync task that will produce the requested output */ static TaskProvider registerDockerTask(Project project, String taskName, Closure closure) { - return registerDockerTask(project, taskName, ConfigureUtil.configureUsing(closure)) + return registerDockerTask(project, taskName, new Action() { + @Override + void execute(DockerTaskConfig dockerTaskConfig) { + project.configure(dockerTaskConfig, closure) + } + }) } /** @@ -221,7 +212,7 @@ class Docker { */ static TaskProvider registerDockerTask(Project project, String taskName, Action 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 @@ -576,7 +567,12 @@ class Docker { } static TaskProvider registerDockerTwoPhaseImage(Project project, String baseName, String intermediate, Closure closure) { - return registerDockerTwoPhaseImage(project, baseName, intermediate, ConfigureUtil.configureUsing(closure)) + return registerDockerTwoPhaseImage(project, baseName, intermediate, new Action() { + @Override + void execute(DockerBuildImage dockerBuildImage) { + project.configure(dockerBuildImage, closure) + } + }) } static TaskProvider registerDockerTwoPhaseImage(Project project, String baseName, String intermediate, Action action) { @@ -598,7 +594,12 @@ class Docker { } static TaskProvider registerDockerImage(Project project, String taskName, Closure closure) { - return registerDockerImage(project, taskName, ConfigureUtil.configureUsing(closure)) + return registerDockerImage(project, taskName, new Action() { + @Override + void execute(DockerBuildImage dockerBuildImage) { + project.configure(dockerBuildImage, closure) + } + }) } static TaskProvider registerDockerImage(Project project, String taskName, Action action) { diff --git a/buildSrc/src/main/groovy/Tasks.groovy b/buildSrc/src/main/groovy/Tasks.groovy index 77193c21a82..0f93130ad14 100644 --- a/buildSrc/src/main/groovy/Tasks.groovy +++ b/buildSrc/src/main/groovy/Tasks.groovy @@ -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 @@ -13,22 +13,20 @@ class Tasks { static TaskProvider 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 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' } } diff --git a/buildSrc/src/main/groovy/TestTools.groovy b/buildSrc/src/main/groovy/TestTools.groovy index a621c2a0884..2c1ffc67db7 100644 --- a/buildSrc/src/main/groovy/TestTools.groovy +++ b/buildSrc/src/main/groovy/TestTools.groovy @@ -1,6 +1,6 @@ import org.gradle.api.Project import org.gradle.api.artifacts.Dependency -import org.gradle.api.plugins.JavaPluginConvention +import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.reporting.Report import org.gradle.api.reporting.internal.SimpleReport import org.gradle.api.tasks.SourceSetContainer @@ -105,16 +105,16 @@ By default only runs in CI; to run locally: // wire up dependencies manually, since we don't get this for free in custom tasks // (it's usually assumed you will do a custom sourceSet for integration tests, // but we already use custom layouts which make "use separate sourcesets per module" in IntelliJ...troublesome). - SourceSetContainer sources = project.convention.getPlugin(JavaPluginConvention).sourceSets + SourceSetContainer sources = project.getExtensions().findByType(JavaPluginExtension).sourceSets setClasspath project.files(sources.getByName('test').output, sources.getByName('main').output, project.configurations.getByName(TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME)) // we also need to adjust the reporting output directory of the alt task, // so we don't stomp over top of previous reports. reports.all { Report report -> - String rebased = report.destination.absolutePath + String rebased = report.outputLocation.get().asFile.absolutePath .replace "${separator}test$separator", "$separator$type$separator" - (report as SimpleReport).destination = new File(rebased) + (report as SimpleReport).outputLocation.set new File(rebased) } // this is not part of the standard class; it is glued on later by jacoco plugin; // we want to give each test it's own output files for jacoco analysis, diff --git a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle index 34e9b371993..23eebfffa0e 100644 --- a/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.common-conventions.gradle @@ -12,5 +12,5 @@ def versionSeparator = deephavenBaseQualifier.isEmpty() ? "" : "-" version = "${deephavenBaseVersion}${versionSeparator}${deephavenBaseQualifier}" if (!name.startsWith('deephaven-')) { - archivesBaseName = "deephaven-${name}" + base.archivesName.set "deephaven-${name}" } diff --git a/buildSrc/src/main/groovy/io.deephaven.deephaven-in-docker.gradle b/buildSrc/src/main/groovy/io.deephaven.deephaven-in-docker.gradle index 7a9217f2cec..3939dfdfcaf 100644 --- a/buildSrc/src/main/groovy/io.deephaven.deephaven-in-docker.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.deephaven-in-docker.gradle @@ -1,7 +1,6 @@ plugins { id 'com.bmuschko.docker-remote-api' id 'io.deephaven.project.register' - id 'license' } import io.deephaven.tools.docker.DeephavenInDockerExtension diff --git a/buildSrc/src/main/groovy/io.deephaven.java-header-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-header-conventions.gradle index 105caaa06b1..a3671378ef6 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-header-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-header-conventions.gradle @@ -1,14 +1 @@ -// TODO(deephaven-core#1997): Remove license-gradle-plugin -plugins { - id 'license' -} - -license { - header rootProject.file('license-header') - include '**/*.java' - strictCheck true - useDefaultMappings true - ignoreFailures true -} - -project.tasks.getByName('quick').dependsOn project.tasks.getByName('license') +// TODO (deephaven-core#1997) Update or remove this once license headers are part of spotless diff --git a/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle index e47124696a0..c39b90631ab 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-test-conventions.gradle @@ -10,7 +10,7 @@ if (project.findProperty('jacoco.enabled') == 'true') { def testJar = project.tasks.register 'testJar', Jar, { Jar jar -> jar.from project.sourceSets.test.output - jar.classifier = 'test' + jar.archiveClassifier = 'test' } configurations { diff --git a/buildSrc/src/main/groovy/io.deephaven.java-toolchain-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-toolchain-conventions.gradle index ffd9cdf132f..a8940f73af2 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-toolchain-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-toolchain-conventions.gradle @@ -191,8 +191,9 @@ tasks.withType(GroovyCompile).configureEach { javaLauncher.set groovyCompilerLauncher } -plugins.withType(ApplicationPlugin) { - applicationDistribution.into('etc') { +JavaApplication application = extensions.findByType(JavaApplication) +if (application) { + application.applicationDistribution.into('etc') { from(createCompilerDirectives.get().outputs.files) from(createVmOptions.get().outputs.files) } diff --git a/buildSrc/src/main/groovy/io.deephaven.python-wheel.gradle b/buildSrc/src/main/groovy/io.deephaven.python-wheel.gradle index 08b6814fe2c..0546a7be749 100644 --- a/buildSrc/src/main/groovy/io.deephaven.python-wheel.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.python-wheel.gradle @@ -1,33 +1,12 @@ plugins { id 'com.bmuschko.docker-remote-api' id 'io.deephaven.project.register' - id 'license' } import io.deephaven.python.PythonWheelExtension project.extensions.create('wheel', PythonWheelExtension, project.objects) -license { - header rootProject.file('license-header') - include '**/*.py' - strictCheck true - useDefaultMappings true - ignoreFailures true -} - -tasks.getByName('license').dependsOn(tasks.create("licensePy", com.hierynomus.gradle.license.tasks.LicenseCheck)) -tasks.getByName('licenseFormat').dependsOn(tasks.create("licenseFormatPy", com.hierynomus.gradle.license.tasks.LicenseFormat)) -afterEvaluate { - tasks.named("licensePy") { task -> - task.source = wheel.src() - } - tasks.named("licenseFormatPy") { task -> - task.source = wheel.src() - } -} -project.tasks.getByName('quick').dependsOn project.tasks.getByName('license') - configurations { pythonWheel getByName(Dependency.DEFAULT_CONFIGURATION).extendsFrom(pythonWheel) diff --git a/buildSrc/src/main/groovy/io/deephaven/project/util/PublishingTools.groovy b/buildSrc/src/main/groovy/io/deephaven/project/util/PublishingTools.groovy index 7c83f180531..8d577fa0653 100644 --- a/buildSrc/src/main/groovy/io/deephaven/project/util/PublishingTools.groovy +++ b/buildSrc/src/main/groovy/io/deephaven/project/util/PublishingTools.groovy @@ -7,13 +7,12 @@ import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.artifacts.repositories.MavenArtifactRepository import org.gradle.api.artifacts.repositories.PasswordCredentials -import org.gradle.api.plugins.BasePluginConvention +import org.gradle.api.plugins.BasePluginExtension import org.gradle.api.publish.Publication import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.tasks.TaskProvider import org.gradle.plugins.signing.SigningExtension -import org.gradle.util.ConfigureUtil @CompileStatic class PublishingTools { @@ -37,7 +36,12 @@ class PublishingTools { static final String RELEASE_REPO = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' static void setupPublications(Project project, Closure closure) { - setupPublications(project, ConfigureUtil.configureUsing(closure)) + setupPublications(project, new Action() { + @Override + void execute(MavenPublication mavenPublication) { + project.configure(mavenPublication, closure) + } + }) } static void setupPublications(Project project, Action action) { @@ -107,14 +111,15 @@ class PublishingTools { if (p.description == null) { throw new IllegalStateException("Project '${project.name}' is missing a description, which is required for publishing to maven central") } - BasePluginConvention base = p.convention.getPlugin(BasePluginConvention) + BasePluginExtension base = p.extensions.findByType(BasePluginExtension) // The common-conventions plugin should take care of this, but we'll double-check here - if (!base.archivesBaseName.contains('deephaven')) { - throw new IllegalStateException("Project '${project.name}' archiveBaseName '${base.archivesBaseName}' does not contain 'deephaven'") + String archivesName = base.archivesName.get() + if (!archivesName.contains('deephaven')) { + throw new IllegalStateException("Project '${project.name}' archiveBaseName '${archivesName}' does not contain 'deephaven'") } - mavenPublication.artifactId = base.archivesBaseName + mavenPublication.artifactId = archivesName mavenPublication.pom { pom -> - pom.name.set base.archivesBaseName + pom.name.set archivesName pom.description.set p.description } } diff --git a/buildSrc/src/main/groovy/io/deephaven/python/PythonWheelExtension.groovy b/buildSrc/src/main/groovy/io/deephaven/python/PythonWheelExtension.groovy index 83fc53d33ff..d244b986384 100644 --- a/buildSrc/src/main/groovy/io/deephaven/python/PythonWheelExtension.groovy +++ b/buildSrc/src/main/groovy/io/deephaven/python/PythonWheelExtension.groovy @@ -2,17 +2,14 @@ package io.deephaven.python import org.gradle.api.Action import org.gradle.api.file.CopySpec -import org.gradle.api.internal.file.copy.DefaultCopySpec import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.Property -import org.gradle.util.ConfigureUtil class PythonWheelExtension { private Action contents private List sourceDirs; PythonWheelExtension(ObjectFactory objectFactory) { - //objectFactory.newInstance(DefaultCopySpec.class) contents { exclude 'build', 'dist' } @@ -22,9 +19,6 @@ class PythonWheelExtension { void contents(Action action) { contents = action } - void contents(Closure closure) { - contents(ConfigureUtil.configureUsing(closure)) - } Action contents() { return contents; diff --git a/buildSrc/src/main/groovy/io/deephaven/tools/Java.groovy b/buildSrc/src/main/groovy/io/deephaven/tools/Java.groovy deleted file mode 100644 index b4dcf755122..00000000000 --- a/buildSrc/src/main/groovy/io/deephaven/tools/Java.groovy +++ /dev/null @@ -1,25 +0,0 @@ -package io.deephaven.tools - -import groovy.transform.CompileStatic -import org.gradle.api.Project -import org.gradle.api.plugins.JavaPluginConvention -import org.gradle.api.tasks.SourceSet - -/** - * Some useful helper methods for dealing with java projects. - */ -@CompileStatic -class Java { - - /** - * Extract a SourceSet from a given project - * - * @param project - Where we will get the sourceSet from - * @param name - The name of the sourceSet (default value is 'main') - * @return - The named sourceSet. If it doesn't exist, an exception is thrown. - */ - static SourceSet sourceSet(Project project, String name = 'main') { - JavaPluginConvention java = project.convention.plugins.get('java') as JavaPluginConvention - return java.sourceSets.getByName(name) - } -} diff --git a/buildSrc/src/main/groovy/io/deephaven/tools/License.groovy b/buildSrc/src/main/groovy/io/deephaven/tools/License.groovy index 788637dcf2b..11cea744eb6 100644 --- a/buildSrc/src/main/groovy/io/deephaven/tools/License.groovy +++ b/buildSrc/src/main/groovy/io/deephaven/tools/License.groovy @@ -2,15 +2,13 @@ package io.deephaven.tools import groovy.transform.CompileStatic import org.gradle.api.Project -import org.gradle.api.plugins.BasePluginConvention -import org.gradle.api.plugins.JavaPluginConvention +import org.gradle.api.plugins.BasePluginExtension +import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.Sync import org.gradle.api.tasks.TaskProvider import org.gradle.jvm.tasks.Jar -import java.security.MessageDigest - @CompileStatic class License { private static final String INPUT_LICENSE_NAME = 'LICENSE' @@ -97,7 +95,8 @@ class License { }*/ // Create a "license" source set from build/license-source-set - JavaPluginConvention java = project.convention.plugins.get('java') as JavaPluginConvention + JavaPluginExtension java = project.extensions.findByType(JavaPluginExtension) + SourceSet licenseSourceSet = java.sourceSets.create(LICENSE_SOURCE_SET_NAME) licenseSourceSet.resources.srcDir(licenseSourceSetDir) @@ -113,7 +112,7 @@ class License { TaskProvider syncSourceSetLicense(String licenseSourceSetDir) { def copyrightYear = '2021' - def archivesBaseName = (project.convention.plugins.get('base') as BasePluginConvention).archivesBaseName + def archivesBaseName = (project.extensions.findByType(BasePluginExtension)).archivesName.get() syncLicensesProvider( project, 'syncSourceSetLicense', @@ -126,7 +125,7 @@ class License { TaskProvider syncDockerLicense() { def copyrightYear = '2021' - def archivesBaseName = (project.convention.plugins.get('base') as BasePluginConvention).archivesBaseName + def archivesBaseName = project.extensions.findByType(BasePluginExtension).archivesName.get() syncLicensesProvider( project, 'syncDockerLicense', diff --git a/buildSrc/src/main/groovy/io/deephaven/tools/Tools.groovy b/buildSrc/src/main/groovy/io/deephaven/tools/Tools.groovy index 5bcdec30300..868bc6fae65 100644 --- a/buildSrc/src/main/groovy/io/deephaven/tools/Tools.groovy +++ b/buildSrc/src/main/groovy/io/deephaven/tools/Tools.groovy @@ -31,7 +31,7 @@ class Tools { // If system is set to use intellij paths, lets make gradle point to same annotation // processor output location as intellij, so we don't wind up with duplicated classes // when intellij picks up its own annotation processor output plus gradle's. - javac.options.annotationProcessorGeneratedSourcesDirectory = outputDir + javac.options.generatedSourceOutputDirectory.set outputDir // make sure this directory always exists. p.mkdir(outputDir) // Make sure we clean our output whenever build/ is deleted. diff --git a/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy index 5273b239514..a2c8dd04d4c 100644 --- a/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy +++ b/buildSrc/src/main/groovy/io/deephaven/tools/docker/DiffTask.groovy @@ -4,12 +4,11 @@ import groovy.transform.CompileStatic import org.gradle.api.Action import org.gradle.api.DefaultTask import org.gradle.api.file.ConfigurableFileCollection -import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.Directory import org.gradle.api.file.FileVisitDetails import org.gradle.api.internal.file.FileLookup import org.gradle.api.provider.Property import org.gradle.api.tasks.Input -import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction @@ -26,26 +25,37 @@ import java.nio.file.Path */ @CompileStatic abstract class DiffTask extends DefaultTask { + static class ActualContents { + private Directory actualContents; + private final PatternSet ignoreInActual = new PatternSet(); + + /** + * Specifies the contents to check to see if they match the expected files. + */ + void directory(Directory actualContents) { + this.actualContents = actualContents; + } + + /** + * Marks some contents as not needing to be diff'd, like Sync's "preserve". Counter-intuitively, + * this usually requires an "exclude" to specify only a specific subdirectory should be diff'd. + */ + void ignore(Action action) { + action.execute(this.ignoreInActual) + } + } // This is an Object because Gradle doesn't define an interface for getAsFileTree(), so we // will resolve it when we execute the task. This allows us to read from various sources, // such as configurations. @InputFiles abstract Property getExpectedContents() - // In contrast, this is assumed to be a source directory, to easily allow some Sync action - // to easily be the "fix this mistake" counterpart to this task - @InputDirectory - abstract DirectoryProperty getActualContents() - private final PatternSet ignoreInActual = new PatternSet(); + // In order to not treat every other task's input and output as this task's input, we process + // the source directory and the ignore pattern as soon as they are set, to claim the actual + // input files. + private final Set existingFiles = []; - /** - * Marks some contents as not needing to be diff'd, like Sync's "preserve". Counter-intuitively, - * this usually requires an "exclude" to specify only a specific subdirectory should be diff'd. - */ - DiffTask ignore(Action action) { - action.execute(this.ignoreInActual); - return this; - } + private final ActualContents actualContentsHolder = new ActualContents(); /** * Human readable name of the task that should be run to correct any errors detected by this task. @@ -63,25 +73,31 @@ abstract class DiffTask extends DefaultTask { project.files(getExpectedContents().get()) } - @TaskAction - void diff() { - def resolver = getFileLookup().getFileResolver(getActualContents().asFile.get()) - // for each file in the generated go output, make sure it exists and matches contents - Set changed = [] - Set missing = [] - // build this list before we traverse, then remove as we go, to represent files that shouldn't exist - Set existingFiles = [] + void actualContents(Action action) { + action.execute(actualContentsHolder) - def ignoreSpec = ignoreInActual.getAsSpec() - getActualContents().asFileTree.visit { FileVisitDetails details -> + if (!existingFiles.isEmpty()) { + throw new IllegalStateException("Can't be run twice") + } + def ignoreSpec = actualContentsHolder.ignoreInActual.getAsSpec() + project.fileTree(actualContentsHolder.actualContents).visit { FileVisitDetails details -> if (ignoreSpec.isSatisfiedBy(details)) { return; } if (details.isDirectory()) { return; } - existingFiles.add(details.file.toPath()); + existingFiles.add(details.file); } + inputs.files(existingFiles) + } + + @TaskAction + void diff() { + def resolver = getFileLookup().getFileResolver(actualContentsHolder.actualContents.asFile) + // for each file in the generated go output, make sure it exists and matches contents + Set changed = [] + Set missing = [] expectedContentsFiles.asFileTree.visit { FileVisitDetails details -> if (details.isDirectory()) { @@ -91,13 +107,13 @@ abstract class DiffTask extends DefaultTask { // note the relative path of each generated file def pathString = details.relativePath.pathString - def sourceFile = resolver.resolve(pathString) + File sourceFile = resolver.resolve(pathString) // if the file does not exist in our source dir, add an error if (!sourceFile.exists()) { missing.add(sourceFile.toPath()) } else { // remove this from the "existing" collection so we can detect extra files later - existingFiles.remove(sourceFile.toPath()) + existingFiles.remove(sourceFile) // verify that the contents match if (sourceFile.text != details.file.text) { @@ -121,7 +137,6 @@ abstract class DiffTask extends DefaultTask { } else { throw new RuntimeException("Sources do not match expected"); } - } } } diff --git a/cpp-client/build.gradle b/cpp-client/build.gradle index 0a062842d7a..bcc4f7a369a 100644 --- a/cpp-client/build.gradle +++ b/cpp-client/build.gradle @@ -4,7 +4,6 @@ plugins { id 'com.bmuschko.docker-remote-api' id 'io.deephaven.project.register' id 'io.deephaven.deephaven-in-docker' - id 'license' } // We use the cpp-clients-multi-base image instead of the cpp-client-base, @@ -22,7 +21,9 @@ dependencies { def protoSourceDir = layout.projectDirectory.dir('deephaven/dhclient/proto') def compare = tasks.register('compareProtobuf', DiffTask) { expectedContents.set configurations.cpp - actualContents.set protoSourceDir + actualContents { + directory protoSourceDir + } generateTask.set ':cpp-client:updateProtobuf' } // fail a "check" build if these are out of date @@ -34,23 +35,6 @@ tasks.register('updateProtobuf', Sync) { into protoSourceDir } -license { - header rootProject.file('license-header') - include '**/*.h' - include '**/*.cc' - strictCheck true - useDefaultMappings true - ignoreFailures true -} -tasks.getByName('license').dependsOn(tasks.create("licensePy", com.hierynomus.gradle.license.tasks.LicenseCheck) { - source = ['deephaven'] -}) -tasks.getByName('licenseFormat').dependsOn(tasks.create("licenseFormatPy", com.hierynomus.gradle.license.tasks.LicenseFormat) { - source = ['deephaven'] -}) - -project.tasks.getByName('quick').dependsOn project.tasks.getByName('license') - // start a grpc-api server String randomSuffix = UUID.randomUUID().toString(); deephavenDocker { diff --git a/engine/benchmark/build.gradle b/engine/benchmark/build.gradle index 2bf7e9f38ca..1792a1d0b34 100644 --- a/engine/benchmark/build.gradle +++ b/engine/benchmark/build.gradle @@ -50,7 +50,7 @@ task jmhRun(type: JavaExec) { classpath = sourceSets.test.runtimeClasspath - main = 'io.deephaven.benchmarking.runner.BenchmarkRunner' + mainClass.set 'io.deephaven.benchmarking.runner.BenchmarkRunner' // arguments to pass to the application jvmArgs '-DConfiguration.rootFile=dh-tests.prop', @@ -68,7 +68,7 @@ def createJmhTask = { task.workingDir "$rootDir/tmp/workspace" task.classpath = sourceSets.test.runtimeClasspath - task.main = 'io.deephaven.benchmarking.runner.BenchmarkRunner' + task.mainClass.set 'io.deephaven.benchmarking.runner.BenchmarkRunner' // arguments to pass to the application def jvmArgs = [ '-DConfiguration.rootFile=dh-tests.prop', @@ -108,7 +108,7 @@ def createDeephavenTestExecTask = { task.workingDir "$rootDir" task.classpath = sourceSets.test.runtimeClasspath - task.main = mainClass + task.mainClass.set mainClass task.jvmArgs '-DConfiguration.rootFile=dh-tests.prop', "-Dworkspace=$rootDir/tmp/workspace", diff --git a/engine/function/build.gradle b/engine/function/build.gradle index 9603993ae67..e07fb0a7ffc 100644 --- a/engine/function/build.gradle +++ b/engine/function/build.gradle @@ -45,15 +45,19 @@ tasks.findByName('clean').dependsOn cleanGen def gencode = { name, template, output -> - task(name, type: JavaExec) { - main = 'io.deephaven.generator.primitivetemplate.CodeGenerator' + def gen = project.tasks.register(name, JavaExec) { + mainClass.set 'io.deephaven.generator.primitivetemplate.CodeGenerator' classpath = configurations.primitiveCodegen args = [template, output] inputs.file template outputs.file output } - compileJava.dependsOn(name) + [sourceSets.main.compileJavaTaskName, sourceSets.main.sourcesJarTaskName, sourceSets.main.javadocTaskName].each { + tasks.named(it).configure { + dependsOn(gen) + } + } generatedFiles.add output } diff --git a/engine/processor-function/build.gradle b/engine/processor-function/build.gradle index 216662c7f56..bffa74abfaf 100644 --- a/engine/processor-function/build.gradle +++ b/engine/processor-function/build.gradle @@ -14,6 +14,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 { diff --git a/engine/processor/build.gradle b/engine/processor/build.gradle index 3e79e0fa7a8..6e7740b5736 100644 --- a/engine/processor/build.gradle +++ b/engine/processor/build.gradle @@ -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 { diff --git a/engine/table/build.gradle b/engine/table/build.gradle index 8809652e223..d72c1a39543 100644 --- a/engine/table/build.gradle +++ b/engine/table/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'io.deephaven.project.register' - id 'me.champeau.jmh' version '0.6.7' + id 'me.champeau.jmh' version '0.7.2' } description 'Engine Table: Implementation and closely-coupled utilities' diff --git a/extensions/parquet/benchmark/build.gradle b/extensions/parquet/benchmark/build.gradle index 24b46ebb280..851d68189b6 100644 --- a/extensions/parquet/benchmark/build.gradle +++ b/extensions/parquet/benchmark/build.gradle @@ -50,7 +50,7 @@ task jmhRun(type: JavaExec) { classpath = sourceSets.test.runtimeClasspath - main = 'io.deephaven.benchmarking.runner.BenchmarkRunner' + mainClass.set 'io.deephaven.benchmarking.runner.BenchmarkRunner' // arguments to pass to the application jvmArgs '-DConfiguration.rootFile=dh-tests.prop', @@ -68,7 +68,7 @@ def createJmhTask = { task.workingDir "$rootDir/tmp/workspace" task.classpath = sourceSets.test.runtimeClasspath - task.main = 'io.deephaven.benchmarking.runner.BenchmarkRunner' + task.mainClass.set 'io.deephaven.benchmarking.runner.BenchmarkRunner' // arguments to pass to the application def jvmArgs = [ '-DConfiguration.rootFile=dh-tests.prop', diff --git a/extensions/parquet/table/build.gradle b/extensions/parquet/table/build.gradle index d6cbff09f22..0d94cc69401 100644 --- a/extensions/parquet/table/build.gradle +++ b/extensions/parquet/table/build.gradle @@ -6,14 +6,17 @@ import io.deephaven.tools.docker.Architecture description 'Parquet Table: Integrating Engine tables with Parquet' -configurations { - brotliTestImplementation.extendsFrom(testImplementation) -} + sourceSets { brotliTest {} } +// Order matters, declare configurations after sourceSets https://github.com/gradle/gradle/issues/26255 +configurations { + brotliTestImplementation.extendsFrom(testImplementation) +} + dependencies { api project(':engine-api') api project(':engine-stringset') diff --git a/extensions/protobuf/build.gradle b/extensions/protobuf/build.gradle index 895393260dc..435efeba6e4 100644 --- a/extensions/protobuf/build.gradle +++ b/extensions/protobuf/build.gradle @@ -19,6 +19,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' testRuntimeOnly project(':log-to-slf4j') testRuntimeOnly project(':configs') diff --git a/extensions/s3/build.gradle b/extensions/s3/build.gradle index 22915b85379..0c162fc1f70 100644 --- a/extensions/s3/build.gradle +++ b/extensions/s3/build.gradle @@ -29,6 +29,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' testImplementation "org.testcontainers:testcontainers:1.19.4" testImplementation "org.testcontainers:junit-jupiter:1.19.4" diff --git a/go/build.gradle b/go/build.gradle index 1f8d9ae9a7f..57c69b295b5 100644 --- a/go/build.gradle +++ b/go/build.gradle @@ -21,12 +21,13 @@ dependencies { } def compare = tasks.register('compareProtobuf', DiffTask) { expectedContents.set configurations.go - actualContents.set layout.projectDirectory - generateTask.set ':go:updateProtobuf' - - ignore { - exclude 'internal/proto/**' + actualContents { + directory layout.projectDirectory + ignore { + it.exclude 'internal/proto/**' + } } + generateTask.set ':go:updateProtobuf' } // fail a "check" build if these are out of date tasks.getByName('quick').dependsOn(compare) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f09..d64cd491770 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7756bade2de..39fcd6c5e4e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,8 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=6001aba9b2204d26fa25a5800bb9382cf3ee01ccb78fe77317b2872336eb2f80 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionSha256Sum=97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb6c20..1aa94a42690 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 53a6b238d41..7101f8e4676 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -42,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/java-client/barrage-examples/build.gradle b/java-client/barrage-examples/build.gradle index def42467440..992e58ed7cf 100644 --- a/java-client/barrage-examples/build.gradle +++ b/java-client/barrage-examples/build.gradle @@ -34,7 +34,7 @@ def createApplication = { String name, String mainClass -> } } -applicationDistribution.into('bin') { +application.applicationDistribution.into('bin') { from(createApplication('subscribe-table', 'io.deephaven.client.examples.SubscribeTable')) from(createApplication('snapshot-table', 'io.deephaven.client.examples.SnapshotTable')) fileMode = 0755 diff --git a/java-client/flight-examples/build.gradle b/java-client/flight-examples/build.gradle index 4bedfd5bd52..6e0629cc325 100644 --- a/java-client/flight-examples/build.gradle +++ b/java-client/flight-examples/build.gradle @@ -35,7 +35,7 @@ def createApplication = { String name, String mainClass -> } } -applicationDistribution.into('bin') { +application.applicationDistribution.into('bin') { from(createApplication('get-tsv', 'io.deephaven.client.examples.GetTsv')) from(createApplication('poll-tsv', 'io.deephaven.client.examples.PollTsv')) from(createApplication('list-tables', 'io.deephaven.client.examples.ListTables')) diff --git a/java-client/session-examples/build.gradle b/java-client/session-examples/build.gradle index d4bc6184f24..8b1aa995fb4 100644 --- a/java-client/session-examples/build.gradle +++ b/java-client/session-examples/build.gradle @@ -35,7 +35,7 @@ def createApplication = { String name, String mainClass -> } } -applicationDistribution.into('bin') { +application.applicationDistribution.into('bin') { from(createApplication('publish-tables', 'io.deephaven.client.examples.PublishTables')) from(createApplication('write-qsts', 'io.deephaven.client.examples.WriteExampleQsts')) from(createApplication('table-manager', 'io.deephaven.client.examples.TableManagerExample')) diff --git a/java-client/session/build.gradle b/java-client/session/build.gradle index beaf3451531..4f9dc333a90 100644 --- a/java-client/session/build.gradle +++ b/java-client/session/build.gradle @@ -30,6 +30,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' Classpaths.inheritJUnitClassic(project, 'testImplementation') testImplementation 'io.grpc:grpc-testing' diff --git a/java-client/uri/build.gradle b/java-client/uri/build.gradle index eefe867864a..a41c229676d 100644 --- a/java-client/uri/build.gradle +++ b/java-client/uri/build.gradle @@ -11,6 +11,7 @@ dependencies { Classpaths.inheritJUnitPlatform(project) testImplementation 'org.junit.jupiter:junit-jupiter' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' Classpaths.inheritAssertJ(project) } diff --git a/log-factory/examples/example-file/build.gradle b/log-factory/examples/example-file/build.gradle index 8d4e0eb2110..73ab00adf8f 100644 --- a/log-factory/examples/example-file/build.gradle +++ b/log-factory/examples/example-file/build.gradle @@ -11,7 +11,7 @@ dependencies { } application { - mainClassName = 'io.deephaven.internal.example.LogExampleMain' + mainClass.set 'io.deephaven.internal.example.LogExampleMain' applicationDefaultJvmArgs = [ '-Dio.deephaven.internal.log.LoggerFactoryFile.path=/tmp/log-to-file-example.txt', '-Dio.deephaven.internal.log.LoggerFactoryFile.level=DEBUG', diff --git a/log-factory/examples/example-logback/build.gradle b/log-factory/examples/example-logback/build.gradle index 34a81a5ebd5..f8fbb0de60b 100644 --- a/log-factory/examples/example-logback/build.gradle +++ b/log-factory/examples/example-logback/build.gradle @@ -11,6 +11,6 @@ dependencies { } application { - mainClassName = 'io.deephaven.internal.example.LogExampleMain' + mainClass.set 'io.deephaven.internal.example.LogExampleMain' // see logback.xml for config } diff --git a/log-factory/examples/example-slf4j/build.gradle b/log-factory/examples/example-slf4j/build.gradle index 6fc81619732..9c25032ccc5 100644 --- a/log-factory/examples/example-slf4j/build.gradle +++ b/log-factory/examples/example-slf4j/build.gradle @@ -11,7 +11,7 @@ dependencies { } application { - mainClassName = 'io.deephaven.internal.example.LogExampleMain' + mainClass.set 'io.deephaven.internal.example.LogExampleMain' applicationDefaultJvmArgs = [ // http://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html '-Dorg.slf4j.simpleLogger.defaultLogLevel=debug', diff --git a/log-factory/examples/example-stream/build.gradle b/log-factory/examples/example-stream/build.gradle index aeb631891c5..c929d4fbabd 100644 --- a/log-factory/examples/example-stream/build.gradle +++ b/log-factory/examples/example-stream/build.gradle @@ -11,7 +11,7 @@ dependencies { } application { - mainClassName = 'io.deephaven.internal.example.LogExampleMain' + mainClass.set 'io.deephaven.internal.example.LogExampleMain' applicationDefaultJvmArgs = [ '-Dio.deephaven.internal.log.LoggerFactoryStream.stream=OUT', '-Dio.deephaven.internal.log.LoggerFactoryStream.level=DEBUG' diff --git a/plugin/dagger/build.gradle b/plugin/dagger/build.gradle index 5c2506e1dff..cca2c8e6dfd 100644 --- a/plugin/dagger/build.gradle +++ b/plugin/dagger/build.gradle @@ -14,6 +14,7 @@ dependencies { Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test { diff --git a/proto/proto-backplane-grpc/build.gradle b/proto/proto-backplane-grpc/build.gradle index c3561470b85..17f7c4d788b 100644 --- a/proto/proto-backplane-grpc/build.gradle +++ b/proto/proto-backplane-grpc/build.gradle @@ -1,5 +1,3 @@ -import nl.javadude.gradle.plugins.license.License - plugins { id 'com.bmuschko.docker-remote-api' id 'java-library' @@ -50,13 +48,6 @@ dependencies { Classpaths.inheritArrow(project, 'flight-core', 'download') } -license { - include '**/*.proto' -} -tasks.withType(License) { - source 'src/main/proto' -} - TaskProvider generateProtobuf = Docker.registerDockerTask(project, 'generateProtobuf') { copyIn { from(project.projectDir) { @@ -106,8 +97,7 @@ compileJava.dependsOn generateProtobuf sourceSets { main { java { - srcDir 'build/generated/source/proto/main/grpc' - srcDir 'build/generated/source/proto/main/java' + srcDir(generateProtobuf).include("**/*.java") } resources { srcDir 'src/main/proto/deephaven/proto' diff --git a/py/client/build.gradle b/py/client/build.gradle index d130f2cd090..37f924443ec 100644 --- a/py/client/build.gradle +++ b/py/client/build.gradle @@ -52,11 +52,14 @@ def compare = tasks.register('compareProtobuf', DiffTask) { dependsOn updatePyNamespaces expectedContents.set generatedProtoDir.get().dir('pydeephaven/proto') - actualContents.set layout.projectDirectory.dir('pydeephaven/proto') - generateTask.set ':py-client:updateProto' - ignore { - include '__init__.py' + actualContents { + directory layout.projectDirectory.dir('pydeephaven/proto') + ignore { + it.include '__init__.py' + } } + generateTask.set ':py-client:updateProto' + } // fail a "check" build if these are out of date tasks.getByName('quick').dependsOn(compare) diff --git a/py/jpy-integration/build.gradle b/py/jpy-integration/build.gradle index 83535511219..dde47391666 100644 --- a/py/jpy-integration/build.gradle +++ b/py/jpy-integration/build.gradle @@ -115,9 +115,12 @@ Task pythonToJava = tasks.create 'unittestPythonToJava', { Closure> gradleTestInDocker = { String taskName, SourceSet sourceSet -> def gradleWrapper = tasks.register("${taskName}GradleInit", Wrapper.class) { wrapper -> - wrapper.scriptFile "${buildDir}/template-project/gradlew" - wrapper.jarFile "${buildDir}/template-project/gradle/wrapper/gradle-wrapper.jar" + + def templateProject = layout.buildDirectory.dir('template-project').get() + wrapper.scriptFile "${templateProject}/gradlew" + wrapper.jarFile "${templateProject}/gradle/wrapper/gradle-wrapper.jar" wrapper.gradleVersion '8.4' + wrapper.validateDistributionUrl.set false } return Docker.registerDockerTask(project, taskName) { copyIn { diff --git a/qst/build.gradle b/qst/build.gradle index 2fcba92ebc6..823fc46d03e 100644 --- a/qst/build.gradle +++ b/qst/build.gradle @@ -15,6 +15,7 @@ dependencies { Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test { diff --git a/qst/graphviz/build.gradle b/qst/graphviz/build.gradle index 11241fd9d49..aa097620ffa 100644 --- a/qst/graphviz/build.gradle +++ b/qst/graphviz/build.gradle @@ -15,6 +15,7 @@ dependencies { Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' Classpaths.inheritLogbackClassic(project, 'implementation') } diff --git a/qst/type/build.gradle b/qst/type/build.gradle index 6b1c30f321e..18143433a0f 100644 --- a/qst/type/build.gradle +++ b/qst/type/build.gradle @@ -10,6 +10,7 @@ dependencies { Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test { diff --git a/server/jetty-app-custom/build.gradle b/server/jetty-app-custom/build.gradle index aff4370c322..598d44289c8 100644 --- a/server/jetty-app-custom/build.gradle +++ b/server/jetty-app-custom/build.gradle @@ -87,8 +87,10 @@ tasks.withType(CreateStartScripts).configureEach { defaultJvmOpts += extraJvmArgs } -applicationName = 'start' -mainClassName = 'io.deephaven.server.custom.CustomMain' +application { + applicationName = 'start' + mainClass = 'io.deephaven.server.custom.CustomMain' +} artifacts { applicationDist project.tasks.findByName('distTar') diff --git a/server/jetty-app/build.gradle b/server/jetty-app/build.gradle index ee51f12d41e..407235af4ae 100644 --- a/server/jetty-app/build.gradle +++ b/server/jetty-app/build.gradle @@ -143,8 +143,10 @@ tasks.withType(CreateStartScripts).configureEach { defaultJvmOpts += extraJvmArgs } -applicationName = 'start' -mainClassName = 'io.deephaven.server.jetty.JettyMain' +application { + applicationName = 'start' + mainClass = 'io.deephaven.server.jetty.JettyMain' +} artifacts { applicationDist project.tasks.findByName('distTar') diff --git a/server/netty-app/build.gradle b/server/netty-app/build.gradle index 48e05e555c5..eeed354fc76 100644 --- a/server/netty-app/build.gradle +++ b/server/netty-app/build.gradle @@ -82,8 +82,10 @@ tasks.withType(CreateStartScripts).configureEach { defaultJvmOpts += extraJvmArgs } -applicationName = 'start' -mainClassName = 'io.deephaven.server.netty.NettyMain' +application { + applicationName = 'start' + mainClass = 'io.deephaven.server.netty.NettyMain' +} artifacts { applicationDist project.tasks.findByName('distTar') diff --git a/settings.gradle b/settings.gradle index 52a854f3027..e382aaa86fb 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,5 @@ plugins { - id 'com.gradle.enterprise' version '3.5.2' + id 'com.gradle.enterprise' version '3.13.1' } gradle.ext.buildStartTime = new Date() diff --git a/sphinx/sphinx.gradle b/sphinx/sphinx.gradle index 836100c2471..bcb0176e50a 100644 --- a/sphinx/sphinx.gradle +++ b/sphinx/sphinx.gradle @@ -151,6 +151,7 @@ tasks.named('cppClientDocsPrepareDocker').configure { makePyDocTask('cppExamplesDocs', 'cpp-examples', [ ("$rootDir/cpp-client/deephaven/examples/doc".toString()):'source', ("$buildDir/cppClientDocs".toString()):'cpp' -], "$buildDir/cppExamplesDocs") { - it.containerDependencies.dependsOn = cppClientDocs -} +], "$buildDir/cppExamplesDocs") +tasks.named('cppExamplesDocsPrepareDocker').configure { + dependsOn cppClientDocs +} \ No newline at end of file diff --git a/sql/build.gradle b/sql/build.gradle index 8d4d5b9408c..8609339af8b 100644 --- a/sql/build.gradle +++ b/sql/build.gradle @@ -15,6 +15,7 @@ dependencies { Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test { diff --git a/ssl/config/build.gradle b/ssl/config/build.gradle index d10e048e553..0c5cd252a30 100644 --- a/ssl/config/build.gradle +++ b/ssl/config/build.gradle @@ -20,6 +20,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test { diff --git a/table-api/build.gradle b/table-api/build.gradle index 1b654107d42..4055fcf4eea 100644 --- a/table-api/build.gradle +++ b/table-api/build.gradle @@ -15,6 +15,7 @@ dependencies { Classpaths.inheritJUnitPlatform(project) Classpaths.inheritAssertJ(project) testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test {