diff --git a/build.gradle b/build.gradle index ed2c520caa..fbba93794e 100644 --- a/build.gradle +++ b/build.gradle @@ -20,10 +20,10 @@ plugins { id 'edu.wpi.first.GradleVsCode' id 'idea' id 'visual-studio' - id 'net.ltgt.errorprone' version '2.0.2' apply false - id 'com.github.johnrengelman.shadow' version '7.1.2' apply false - id 'com.diffplug.spotless' version '6.12.0' apply false - id 'com.github.spotbugs' version '5.0.8' apply false + id 'net.ltgt.errorprone' version '3.1.0' apply false + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false + id 'com.diffplug.spotless' version '6.18.0' apply false + id 'com.github.spotbugs' version '5.0.14' apply false } wpilibVersioning.buildServerMode = project.hasProperty('buildServer') @@ -94,8 +94,8 @@ ext.addTaskToCopyAllOutputs = { task -> return } copyAllOutputs.dependsOn task - copyAllOutputs.inputs.file task.archivePath - copyAllOutputs.from task.archivePath + copyAllOutputs.inputs.file task.archiveFile + copyAllOutputs.from task.archiveFile } subprojects { @@ -167,5 +167,5 @@ ext.getCurrentArch = { } wrapper { - gradleVersion = '7.5.1' + gradleVersion = '8.1' } diff --git a/cscore/build.gradle b/cscore/build.gradle index a656731519..afbef932df 100644 --- a/cscore/build.gradle +++ b/cscore/build.gradle @@ -36,7 +36,6 @@ model { srcDir 'src/main/native/include' include '**/*.h' } - } } binaries.all { diff --git a/datalogtool/publish.gradle b/datalogtool/publish.gradle index e8228429fb..f24f51aa48 100644 --- a/datalogtool/publish.gradle +++ b/datalogtool/publish.gradle @@ -34,8 +34,16 @@ model { description("Creates a macOS application bundle for DataLogTool") from(file("$project.projectDir/Info.plist")) into(file("$project.buildDir/outputs/bundles/$binary.targetPlatform.architecture.name/DataLogTool.app/Contents")) - into("MacOS") { with copySpec { from binary.executable.file } } - into("Resources") { with copySpec { from icon } } + into("MacOS") { + with copySpec { + from binary.executable.file + } + } + into("Resources") { + with copySpec { + from icon + } + } inputs.property "HasDeveloperId", project.hasProperty("developerID") @@ -71,7 +79,7 @@ model { archiveBaseName = '_M_' + zipBaseName duplicatesStrategy = 'exclude' - classifier = nativeUtils.getPublishClassifier(binary) + archiveClassifier = nativeUtils.getPublishClassifier(binary) from(licenseFile) { into '/' diff --git a/fieldImages/publish.gradle b/fieldImages/publish.gradle index 56b94116b5..33eb5ae3a5 100644 --- a/fieldImages/publish.gradle +++ b/fieldImages/publish.gradle @@ -9,7 +9,7 @@ def outputsFolder = file("$project.buildDir/outputs") task cppSourcesZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = cppZipBaseName - classifier = "sources" + archiveClassifier = "sources" from(licenseFile) { into '/' @@ -26,7 +26,7 @@ task cppSourcesZip(type: Zip) { task cppHeadersZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = cppZipBaseName - classifier = "headers" + archiveClassifier = "headers" from(licenseFile) { into '/' diff --git a/glass/publish.gradle b/glass/publish.gradle index 5e7cbaf7d5..0e46c36ad1 100644 --- a/glass/publish.gradle +++ b/glass/publish.gradle @@ -17,7 +17,7 @@ def outputsFolder = file("$project.buildDir/outputs") task libCppSourcesZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = libZipBaseName - classifier = "sources" + archiveClassifier = "sources" from(licenseFile) { into '/' } from('src/lib/native/cpp') { into '/' } @@ -26,7 +26,7 @@ task libCppSourcesZip(type: Zip) { task libCppHeadersZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = libZipBaseName - classifier = "headers" + archiveClassifier = "headers" from(licenseFile) { into '/' } from('src/lib/native/include') { into '/' } @@ -35,7 +35,7 @@ task libCppHeadersZip(type: Zip) { task libntCppSourcesZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = libntZipBaseName - classifier = "sources" + archiveClassifier = "sources" from(licenseFile) { into '/' } from('src/libnt/native/cpp') { into '/' } @@ -44,7 +44,7 @@ task libntCppSourcesZip(type: Zip) { task libntCppHeadersZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = libntZipBaseName - classifier = "headers" + archiveClassifier = "headers" from(licenseFile) { into '/' } from('src/libnt/native/include') { into '/' } @@ -89,8 +89,16 @@ model { description("Creates a macOS application bundle for Glass") from(file("$project.projectDir/Info.plist")) into(file("$project.buildDir/outputs/bundles/$binary.targetPlatform.architecture.name/Glass.app/Contents")) - into("MacOS") { with copySpec { from binary.executable.file } } - into("Resources") { with copySpec { from icon } } + into("MacOS") { + with copySpec { + from binary.executable.file + } + } + into("Resources") { + with copySpec { + from icon + } + } inputs.property "HasDeveloperId", project.hasProperty("developerID") @@ -126,7 +134,7 @@ model { archiveBaseName = '_M_' + zipBaseName duplicatesStrategy = 'exclude' - classifier = nativeUtils.getPublishClassifier(binary) + archiveClassifier = nativeUtils.getPublishClassifier(binary) from(licenseFile) { into '/' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f0..c1962a79e2 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 ae04661ee7..0c85a1f751 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb6c2..aeb74cbb43 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,10 @@ 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"' +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -143,12 +140,16 @@ fi 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=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=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# 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, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/gradlew.bat b/gradlew.bat index 53a6b238d4..6689b85bee 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% diff --git a/msvcruntime/build.gradle b/msvcruntime/build.gradle index 99e14ed62c..7e268e842d 100644 --- a/msvcruntime/build.gradle +++ b/msvcruntime/build.gradle @@ -36,6 +36,7 @@ if (OperatingSystem.current().isWindows()) { return } + // TODO Remove VersionNumber def expectedVersion = VersionNumber.parse(defaultRedistFile.text.trim()) def runtimeLocation = file("$vsDirectory\\VC\\Redist\\MSVC\\$expectedVersion") @@ -53,7 +54,7 @@ if (OperatingSystem.current().isWindows()) { def x64ZipTask = tasks.create('x64RuntimeZip', Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = 'x64' + archiveClassifier = 'x64' from x64Folder } diff --git a/outlineviewer/publish.gradle b/outlineviewer/publish.gradle index 9c53ae5b60..58222bed96 100644 --- a/outlineviewer/publish.gradle +++ b/outlineviewer/publish.gradle @@ -34,8 +34,16 @@ model { description("Creates a macOS application bundle for OutlineViewer") from(file("$project.projectDir/Info.plist")) into(file("$project.buildDir/outputs/bundles/$binary.targetPlatform.architecture.name/OutlineViewer.app/Contents")) - into("MacOS") { with copySpec { from binary.executable.file } } - into("Resources") { with copySpec { from icon } } + into("MacOS") { + with copySpec { + from binary.executable.file + } + } + into("Resources") { + with copySpec { + from icon + } + } inputs.property "HasDeveloperId", project.hasProperty("developerID") @@ -71,7 +79,7 @@ model { archiveBaseName = '_M_' + zipBaseName duplicatesStrategy = 'exclude' - classifier = nativeUtils.getPublishClassifier(binary) + archiveClassifier = nativeUtils.getPublishClassifier(binary) from(licenseFile) { into '/' diff --git a/processstarter/publish.gradle b/processstarter/publish.gradle index be976d26ef..925fa96476 100644 --- a/processstarter/publish.gradle +++ b/processstarter/publish.gradle @@ -35,7 +35,7 @@ model { archiveBaseName = '_M_' + zipBaseName duplicatesStrategy = 'exclude' - classifier = nativeUtils.getPublishClassifier(binary) + archiveClassifier = nativeUtils.getPublishClassifier(binary) from(licenseFile) { into '/' diff --git a/roborioteamnumbersetter/publish.gradle b/roborioteamnumbersetter/publish.gradle index da6a0f6d63..77513427e6 100644 --- a/roborioteamnumbersetter/publish.gradle +++ b/roborioteamnumbersetter/publish.gradle @@ -34,8 +34,16 @@ model { description("Creates a macOS application bundle for roboRIO Team Number Setter") from(file("$project.projectDir/Info.plist")) into(file("$project.buildDir/outputs/bundles/$binary.targetPlatform.architecture.name/roboRIOTeamNumberSetter.app/Contents")) - into("MacOS") { with copySpec { from binary.executable.file } } - into("Resources") { with copySpec { from icon } } + into("MacOS") { + with copySpec { + from binary.executable.file + } + } + into("Resources") { + with copySpec { + from icon + } + } inputs.property "HasDeveloperId", project.hasProperty("developerID") @@ -71,7 +79,7 @@ model { archiveBaseName = '_M_' + zipBaseName duplicatesStrategy = 'exclude' - classifier = nativeUtils.getPublishClassifier(binary) + archiveClassifier = nativeUtils.getPublishClassifier(binary) from(licenseFile) { into '/' diff --git a/shared/config.gradle b/shared/config.gradle index 8036ccaa4a..52ec3d2574 100644 --- a/shared/config.gradle +++ b/shared/config.gradle @@ -138,7 +138,7 @@ ext.createComponentZipTasks = { components, names, base, type, project, func -> def task = project.tasks.create(base + "-${key}", type) { description = 'Creates component archive for platform ' + key destinationDirectory = outputsFolder - classifier = key + archiveClassifier = key archiveBaseName = '_M_' + base duplicatesStrategy = 'exclude' diff --git a/shared/java/javacommon.gradle b/shared/java/javacommon.gradle index 4c57f1f49e..2f28fc4a75 100644 --- a/shared/java/javacommon.gradle +++ b/shared/java/javacommon.gradle @@ -9,12 +9,12 @@ def javaBaseName = "_GROUP_edu_wpi_first_${project.baseId}_ID_${project.baseId}- def outputsFolder = file("$project.buildDir/outputs") task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } @@ -27,14 +27,14 @@ task outputJar(type: Jar, dependsOn: classes) { task outputSourcesJar(type: Jar, dependsOn: classes) { archiveBaseName = javaBaseName destinationDirectory = outputsFolder - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } task outputJavadocJar(type: Jar, dependsOn: javadoc) { archiveBaseName = javaBaseName destinationDirectory = outputsFolder - classifier = 'javadoc' + archiveClassifier = 'javadoc' from javadoc.destinationDir } diff --git a/shared/javacpp/publish.gradle b/shared/javacpp/publish.gradle index 201c023450..7599a7426a 100644 --- a/shared/javacpp/publish.gradle +++ b/shared/javacpp/publish.gradle @@ -11,7 +11,7 @@ def licenseFile = file("$rootDir/license.md") task cppSourcesZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "sources" + archiveClassifier = "sources" from(licenseFile) { into '/' @@ -25,7 +25,7 @@ task cppSourcesZip(type: Zip) { task cppHeadersZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "headers" + archiveClassifier = "headers" from(licenseFile) { into '/' diff --git a/shared/jni/publish.gradle b/shared/jni/publish.gradle index 8745caf37a..42f0a951bc 100644 --- a/shared/jni/publish.gradle +++ b/shared/jni/publish.gradle @@ -14,7 +14,7 @@ def licenseFile = file("$rootDir/license.md") task cppSourcesZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "sources" + archiveClassifier = "sources" duplicatesStrategy = 'exclude' from(licenseFile) { @@ -44,7 +44,7 @@ task cppSourcesZip(type: Zip) { task cppHeadersZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "headers" + archiveClassifier = "headers" from(licenseFile) { into '/' diff --git a/shared/plugins/publish.gradle b/shared/plugins/publish.gradle index 26caad9d67..8d7b9d4b71 100644 --- a/shared/plugins/publish.gradle +++ b/shared/plugins/publish.gradle @@ -9,7 +9,7 @@ def outputsFolder = file("$project.buildDir/outputs") task cppSourcesZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "sources" + archiveClassifier = "sources" from(licenseFile) { into '/' @@ -23,7 +23,7 @@ task cppSourcesZip(type: Zip) { task cppHeadersZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "headers" + archiveClassifier = "headers" from(licenseFile) { into '/' diff --git a/wpigui/publish.gradle b/wpigui/publish.gradle index 3114118e04..c137d7c579 100644 --- a/wpigui/publish.gradle +++ b/wpigui/publish.gradle @@ -9,7 +9,7 @@ def outputsFolder = file("$project.buildDir/outputs") task cppSourcesZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "sources" + archiveClassifier = "sources" from(licenseFile) { into '/' @@ -32,7 +32,7 @@ task cppSourcesZip(type: Zip) { task cppHeadersZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "headers" + archiveClassifier = "headers" from(licenseFile) { into '/' diff --git a/wpilibc/build.gradle b/wpilibc/build.gradle index 4cf4ab22a1..507ec445ad 100644 --- a/wpilibc/build.gradle +++ b/wpilibc/build.gradle @@ -152,7 +152,6 @@ model { lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared' nativeUtils.useRequiredLibrary(it, 'opencv_shared') } - } appendDebugPathToBinaries(binaries) } diff --git a/wpilibc/publish.gradle b/wpilibc/publish.gradle index d49f157e81..a565ba5f3b 100644 --- a/wpilibc/publish.gradle +++ b/wpilibc/publish.gradle @@ -9,7 +9,7 @@ def outputsFolder = file("$project.buildDir/outputs") task cppSourcesZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "sources" + archiveClassifier = "sources" from(licenseFile) { into '/' @@ -28,7 +28,7 @@ cppSourcesZip.dependsOn generateCppVersion task cppHeadersZip(type: Zip) { destinationDirectory = outputsFolder archiveBaseName = zipBaseName - classifier = "headers" + archiveClassifier = "headers" from(licenseFile) { into '/' diff --git a/wpilibjIntegrationTests/build.gradle b/wpilibjIntegrationTests/build.gradle index 06d891a55f..999d209036 100644 --- a/wpilibjIntegrationTests/build.gradle +++ b/wpilibjIntegrationTests/build.gradle @@ -44,7 +44,7 @@ def testOutputFolder = file("${project(':').buildDir}/integrationTestFiles") task copyWpilibJIntegrationTestJarToOutput(type: Copy) { destinationDir testOutputFolder dependsOn shadowJar - inputs.file shadowJar.archivePath + inputs.file shadowJar.archiveFile from(shadowJar) { into 'java' }