[build] Update to gradle 8.1 (#5303)

This commit is contained in:
Thad House
2023-05-12 21:27:31 -07:00
committed by GitHub
parent 258b7cc48b
commit 91392823ff
22 changed files with 91 additions and 53 deletions

View File

@@ -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'
}

View File

@@ -36,7 +36,6 @@ model {
srcDir 'src/main/native/include'
include '**/*.h'
}
}
}
binaries.all {

View File

@@ -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 '/'

View File

@@ -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 '/'

View File

@@ -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 '/'

Binary file not shown.

View File

@@ -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

19
gradlew vendored
View File

@@ -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

1
gradlew.bat vendored
View File

@@ -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%

View File

@@ -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
}

View File

@@ -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 '/'

View File

@@ -35,7 +35,7 @@ model {
archiveBaseName = '_M_' + zipBaseName
duplicatesStrategy = 'exclude'
classifier = nativeUtils.getPublishClassifier(binary)
archiveClassifier = nativeUtils.getPublishClassifier(binary)
from(licenseFile) {
into '/'

View File

@@ -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 '/'

View File

@@ -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'

View File

@@ -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
}

View File

@@ -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 '/'

View File

@@ -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 '/'

View File

@@ -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 '/'

View File

@@ -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 '/'

View File

@@ -152,7 +152,6 @@ model {
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
nativeUtils.useRequiredLibrary(it, 'opencv_shared')
}
}
appendDebugPathToBinaries(binaries)
}

View File

@@ -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 '/'

View File

@@ -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'
}