diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a97fcca15..ef89618b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,7 +169,7 @@ jobs: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: - python-version: '3.12' + python-version: 3.14 - name: Install graphviz run: | sudo apt-get update diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index aa9ec28ea..db06c009f 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -26,10 +26,10 @@ jobs: git fetch --prune --unshallow git checkout -b pr git branch -f main origin/main - - name: Set up Python 3.12 + - name: Set up Python uses: actions/setup-python@v6 with: - python-version: 3.12 + python-version: 3.14 - name: Install wpiformat run: pip3 install wpiformat==2025.79 - name: Run diff --git a/.github/workflows/photonvision-rtd.yml b/.github/workflows/photonvision-rtd.yml index c4fb5c71c..d39c170be 100644 --- a/.github/workflows/photonvision-rtd.yml +++ b/.github/workflows/photonvision-rtd.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: '3.12' + python-version: 3.14 - name: Install and upgrade pip run: python -m pip install --upgrade pip diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index fc8f02e8c..811fad63b 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -24,7 +24,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: 3.12 + python-version: 3.14 - name: Install dependencies run: | @@ -76,49 +76,30 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: 3.12 + python-version: 3.14 - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel pytest mypy numpy wpilib pyntcore opencv-python robotpy==2026.1.1b1 pyfrc + pip install setuptools wheel pytest mypy - name: Build wheel working-directory: ./photon-lib/py run: python setup.py sdist bdist_wheel - - name: Run Unit Tests (Unix) + - name: Build and configure PhotonLibPy working-directory: ./photon-lib/py - if: runner.os != 'Windows' - run: | - pip install --no-cache-dir dist/*.whl - pytest - - - name: Run Unit Tests (Windows) - working-directory: ./photon-lib/py - if: runner.os == 'Windows' - shell: cmd - run: | - for %%f in (dist/*.whl) do ( - echo installing dist/%%f - pip install --no-cache-dir dist/%%f - ) - pytest - - - name: Build and configure PhotonLibPy (bash) - working-directory: ./photon-lib/py - if: runner.os != 'Windows' + shell: bash run: | ./buildAndTest.sh ./enableUsingDevBuilds.sh - - name: Build and configure PhotonLibPy (pwsh) + - name: Run Unit Tests working-directory: ./photon-lib/py - if: runner.os == 'Windows' + shell: bash run: | - ./buildandTest.bat - ./enableUsingDevBuilds.bat - + pip install --no-cache-dir dist/*.whl + pytest - name: Run mypy type checking run: mypy --show-column-numbers --config-file photon-lib/py/pyproject.toml photon-lib diff --git a/.python-version b/.python-version index 2c0733315..6324d401a 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.11 +3.14 diff --git a/build.gradle b/build.gradle index 9421d4428..efc0d6a12 100644 --- a/build.gradle +++ b/build.gradle @@ -2,10 +2,10 @@ import edu.wpi.first.toolchain.* plugins { id "cpp" - id "com.diffplug.spotless" version "6.24.0" + id "com.diffplug.spotless" version "8.1.0" id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2" - id "edu.wpi.first.GradleRIO" version "2026.1.1-beta-1" - id 'org.photonvision.tools.WpilibTools' version '2.2.0-photon' + id "edu.wpi.first.GradleRIO" version "2026.1.1" + id 'org.photonvision.tools.WpilibTools' version '2.3.3-photon' id 'com.google.protobuf' version '0.9.3' apply false id 'edu.wpi.first.GradleJni' version '1.1.0' id "org.ysb33r.doxygen" version "2.0.0" apply false @@ -32,16 +32,16 @@ ext.allOutputsFolder = file("$project.buildDir/outputs") apply from: "versioningHelper.gradle" ext { - wpilibVersion = "2026.1.1-beta-1" + wpilibVersion = "2026.1.1" wpimathVersion = wpilibVersion openCVYear = "2025" openCVversion = "4.10.0-3" javalinVersion = "6.7.0" - libcameraDriverVersion = "dev-v2025.0.4-3-g95e2b38" - rknnVersion = "dev-v2025.0.0-7-g83c1bf3" - rubikVersion = "dev-v2025.1.0-7-g39588a8" - frcYear = "2026beta" - mrcalVersion = "dev-v2025.0.0-6-g475031a"; + libcameraDriverVersion = "v2026.0.0" + rknnVersion = "v2026.0.1" + rubikVersion = "v2026.0.1" + frcYear = "2026" + mrcalVersion = "v2026.0.0"; pubVersion = versionString isDev = pubVersion.startsWith("dev") diff --git a/docs/requirements.txt b/docs/requirements.txt index 0b5d4d04d..20bbd59f0 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -21,7 +21,6 @@ mdurl==0.1.2 myst-parser==4.0.1 packaging==25.0 pbr==6.1.1 -pipreqs==0.5.0 Pygments==2.19.1 PyYAML==6.0.2 requests==2.32.4 @@ -54,6 +53,6 @@ stevedore==5.4.1 typing_extensions==4.13.2 urllib3==2.5.0 uvicorn==0.34.2 -watchfiles==1.0.5 +watchfiles==1.1.1 websockets==15.0.1 yarg==0.1.9 diff --git a/docs/source/docs/apriltag-pipelines/2D-tracking-tuning.md b/docs/source/docs/apriltag-pipelines/2D-tracking-tuning.md index dd3ec93c8..d376b2ed3 100644 --- a/docs/source/docs/apriltag-pipelines/2D-tracking-tuning.md +++ b/docs/source/docs/apriltag-pipelines/2D-tracking-tuning.md @@ -23,7 +23,7 @@ AprilTag pipelines come with reasonable defaults to get you up and running with Target families are defined by two numbers (before and after the h). The first number is the number of bits the tag is able to encode (which means more tags are available in the respective family) and the second is the hamming distance. Hamming distance describes the ability for error correction while identifying tag ids. A high hamming distance generally means that it will be easier for a tag to be identified even if there are errors. However, as hamming distance increases, the number of available tags decreases. -The 2025 FRC game will be using 36h11 tags, which can be found [here](https://github.com/AprilRobotics/apriltag-imgs/tree/main/tag36h11). +The 2026 FRC game will be using 36h11 tags, which can be found [here](https://github.com/AprilRobotics/apriltag-imgs/tree/2bc821edb4eb7b408d13c6a590d326d8a9ec98f3/tag36h11). ### Decimate diff --git a/docs/source/docs/apriltag-pipelines/about-apriltags.md b/docs/source/docs/apriltag-pipelines/about-apriltags.md index f96ec5c22..41ec51622 100644 --- a/docs/source/docs/apriltag-pipelines/about-apriltags.md +++ b/docs/source/docs/apriltag-pipelines/about-apriltags.md @@ -10,5 +10,5 @@ AprilTags are a common type of visual fiducial marker. Visual fiducial markers a A more technical explanation can be found in the [WPILib documentation](https://docs.wpilib.org/en/latest/docs/software/vision-processing/apriltag/apriltag-intro.html). :::{note} -You can get FIRST's [official PDF of the targets used in 2025 here](https://firstfrc.blob.core.windows.net/frc2025/FieldAssets/Apriltag_Images_and_User_Guide.pdf). +You can get FIRST's [official PDF of the targets used in 2026 here](https://firstfrc.blob.core.windows.net/frc2026/FieldAssets/2026-apriltag-images-user-guide.pdf). ::: diff --git a/docs/source/docs/apriltag-pipelines/multitag.md b/docs/source/docs/apriltag-pipelines/multitag.md index bee81fbb2..1a01ff03f 100644 --- a/docs/source/docs/apriltag-pipelines/multitag.md +++ b/docs/source/docs/apriltag-pipelines/multitag.md @@ -7,7 +7,7 @@ MultiTag requires an accurate field layout JSON to be uploaded! Differences betw ::: :::{warning} -For the 2025 Reefscape Season, there are two different field layouts. The first is the [welded field layout](https://github.com/wpilibsuite/allwpilib/blob/main/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2025-reefscape-welded.json), which photonvision ships with. The second is the [Andymark field layout](https://github.com/wpilibsuite/allwpilib/blob/main/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2025-reefscape-andymark.json). It is very important to ensure that you use the correct field layout, both in the [PhotonPoseEstimator](https://docs.photonvision.org/en/latest/docs/programming/photonlib/robot-pose-estimator.html#apriltags-and-photonposeestimator) and on the [coprocessor](https://docs.photonvision.org/en/latest/docs/apriltag-pipelines/multitag.html#updating-the-field-layout). +For the 2026 Rebuilt Season, there are two different field layouts. The first is the [welded field layout](https://github.com/wpilibsuite/allwpilib/blob/main/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2026-rebuilt-welded.json), which photonvision ships with. The second is the [Andymark field layout](https://github.com/wpilibsuite/allwpilib/blob/main/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2026-rebuilt-andymark.json). It is very important to ensure that you use the correct field layout, both in the [PhotonPoseEstimator](https://docs.photonvision.org/en/latest/docs/programming/photonlib/robot-pose-estimator.html#apriltags-and-photonposeestimator) and on the [coprocessor](https://docs.photonvision.org/en/latest/docs/apriltag-pipelines/multitag.html#updating-the-field-layout). ::: ## Enabling MultiTag @@ -66,7 +66,7 @@ The returned field to camera transform is a transform from the fixed field origi ## Updating the Field Layout -PhotonVision ships by default with the [2025 welded field layout JSON](https://github.com/wpilibsuite/allwpilib/blob/main/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2025-reefscape-welded.json). The layout can be inspected by navigating to the settings tab and scrolling down to the "AprilTag Field Layout" card, as shown below. +PhotonVision ships by default with the [2026 welded field layout JSON](https://github.com/wpilibsuite/allwpilib/blob/main/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2026-rebuilt-welded.json). The layout can be inspected by navigating to the settings tab and scrolling down to the "AprilTag Field Layout" card, as shown below. ```{image} images/field-layout.png :alt: The currently saved field layout in the Photon UI diff --git a/docs/source/docs/examples/aimingatatarget.md b/docs/source/docs/examples/aimingatatarget.md index a4482e4af..a92d41ed4 100644 --- a/docs/source/docs/examples/aimingatatarget.md +++ b/docs/source/docs/examples/aimingatatarget.md @@ -7,7 +7,7 @@ The following example is from the PhotonLib example repository ([Java](https://g - A Robot - A camera mounted rigidly to the robot's frame, centered and pointed forward. - A coprocessor running PhotonVision with an AprilTag or ArUco 2D Pipeline. -- [A printout of AprilTag 7](https://firstfrc.blob.core.windows.net/frc2025/FieldAssets/Apriltag_Images_and_User_Guide.pdf), mounted on a rigid and flat surface. +- [A printout of AprilTag 7](https://firstfrc.blob.core.windows.net/frc2026/FieldAssets/2026-apriltag-images-user-guide.pdf), mounted on a rigid and flat surface. ## Code diff --git a/photon-core/src/main/java/org/photonvision/vision/processes/PipelineManager.java b/photon-core/src/main/java/org/photonvision/vision/processes/PipelineManager.java index 86168c607..02ecc509a 100644 --- a/photon-core/src/main/java/org/photonvision/vision/processes/PipelineManager.java +++ b/photon-core/src/main/java/org/photonvision/vision/processes/PipelineManager.java @@ -158,7 +158,7 @@ public class PipelineManager { case CAL_3D_INDEX -> calibration3dPipeline; case DRIVERMODE_INDEX -> driverModePipeline; case FOCUS_INDEX -> focusPipeline; - // Just return the current user pipeline, we're not on a built-in one + // Just return the current user pipeline, we're not on a built-in one default -> currentUserPipeline; }; } diff --git a/photon-lib/py/setup.py b/photon-lib/py/setup.py index 585206920..e678ded98 100644 --- a/photon-lib/py/setup.py +++ b/photon-lib/py/setup.py @@ -60,12 +60,12 @@ setup( package_data={"photonlibpy": ["py.typed"]}, version=versionString, install_requires=[ - "numpy~=2.1", - "wpilib==2026.1.1b1", - "robotpy-wpimath==2026.1.1b1", - "robotpy-apriltag==2026.1.1b1", - "robotpy-cscore==2026.1.1b1", - "pyntcore==2026.1.1b1", + "numpy~=2.4", + "wpilib==2026.1.1", + "robotpy-wpimath==2026.1.1", + "robotpy-apriltag==2026.1.1", + "robotpy-cscore==2026.1.1", + "pyntcore==2026.1.1", "opencv-python;platform_machine!='roborio'", ], description=descriptionStr, diff --git a/photon-lib/src/main/java/org/photonvision/EstimatedRobotPose.java b/photon-lib/src/main/java/org/photonvision/EstimatedRobotPose.java index 1cc55c19d..faffe998f 100644 --- a/photon-lib/src/main/java/org/photonvision/EstimatedRobotPose.java +++ b/photon-lib/src/main/java/org/photonvision/EstimatedRobotPose.java @@ -63,6 +63,8 @@ public class EstimatedRobotPose { * * @param estimatedPose estimated pose * @param timestampSeconds timestamp of the estimate + * @param targetsUsed targets used to compute the pose + * @param strategy the strategy used to compute the pose */ public EstimatedRobotPose( Pose3d estimatedPose, diff --git a/photon-server/src/main/java/org/photonvision/server/RequestHandler.java b/photon-server/src/main/java/org/photonvision/server/RequestHandler.java index 9f2f9cdf9..350ec04bf 100644 --- a/photon-server/src/main/java/org/photonvision/server/RequestHandler.java +++ b/photon-server/src/main/java/org/photonvision/server/RequestHandler.java @@ -581,7 +581,7 @@ public class RequestHandler { case "YOLOv5" -> NeuralNetworkModelManager.Version.YOLOV5; case "YOLOv8" -> NeuralNetworkModelManager.Version.YOLOV8; case "YOLO11" -> NeuralNetworkModelManager.Version.YOLOV11; - // Add more versions as necessary for new models + // Add more versions as necessary for new models default -> { ctx.status(400); ctx.result("The provided version was not valid"); diff --git a/photonlib-cpp-examples/aimandrange/.wpilib/wpilib_preferences.json b/photonlib-cpp-examples/aimandrange/.wpilib/wpilib_preferences.json index 4c9e01a94..36dcd4ae4 100644 --- a/photonlib-cpp-examples/aimandrange/.wpilib/wpilib_preferences.json +++ b/photonlib-cpp-examples/aimandrange/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": true, "currentLanguage": "cpp", - "projectYear": "2026beta", + "projectYear": "2026", "teamNumber": 5 } diff --git a/photonlib-cpp-examples/aimandrange/build.gradle b/photonlib-cpp-examples/aimandrange/build.gradle index e00e0d0d7..a7b8544b2 100644 --- a/photonlib-cpp-examples/aimandrange/build.gradle +++ b/photonlib-cpp-examples/aimandrange/build.gradle @@ -1,7 +1,7 @@ plugins { id "cpp" id "google-test-test-suite" - id "edu.wpi.first.GradleRIO" version "2026.1.1-beta-1" + id "edu.wpi.first.GradleRIO" version "2026.1.1" } repositories { @@ -11,8 +11,8 @@ repositories { wpi.maven.useLocal = false wpi.maven.useDevelopment = false -wpi.versions.wpilibVersion = "2026.1.1-beta-1" -wpi.versions.wpimathVersion = "2026.1.1-beta-1" +wpi.versions.wpilibVersion = "2026.1.1" +wpi.versions.wpimathVersion = "2026.1.1" // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. @@ -37,6 +37,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } diff --git a/photonlib-cpp-examples/aimattarget/.wpilib/wpilib_preferences.json b/photonlib-cpp-examples/aimattarget/.wpilib/wpilib_preferences.json index 4c9e01a94..36dcd4ae4 100644 --- a/photonlib-cpp-examples/aimattarget/.wpilib/wpilib_preferences.json +++ b/photonlib-cpp-examples/aimattarget/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": true, "currentLanguage": "cpp", - "projectYear": "2026beta", + "projectYear": "2026", "teamNumber": 5 } diff --git a/photonlib-cpp-examples/aimattarget/build.gradle b/photonlib-cpp-examples/aimattarget/build.gradle index e00e0d0d7..a7b8544b2 100644 --- a/photonlib-cpp-examples/aimattarget/build.gradle +++ b/photonlib-cpp-examples/aimattarget/build.gradle @@ -1,7 +1,7 @@ plugins { id "cpp" id "google-test-test-suite" - id "edu.wpi.first.GradleRIO" version "2026.1.1-beta-1" + id "edu.wpi.first.GradleRIO" version "2026.1.1" } repositories { @@ -11,8 +11,8 @@ repositories { wpi.maven.useLocal = false wpi.maven.useDevelopment = false -wpi.versions.wpilibVersion = "2026.1.1-beta-1" -wpi.versions.wpimathVersion = "2026.1.1-beta-1" +wpi.versions.wpilibVersion = "2026.1.1" +wpi.versions.wpimathVersion = "2026.1.1" // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. @@ -37,6 +37,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } diff --git a/photonlib-cpp-examples/build.gradle b/photonlib-cpp-examples/build.gradle index 0bd30f7c4..ecef0406c 100644 --- a/photonlib-cpp-examples/build.gradle +++ b/photonlib-cpp-examples/build.gradle @@ -1,5 +1,5 @@ plugins { - id "com.diffplug.spotless" version "6.1.2" + id "com.diffplug.spotless" version "8.1.0" } allprojects { diff --git a/photonlib-cpp-examples/gradle/wrapper/gradle-wrapper.jar b/photonlib-cpp-examples/gradle/wrapper/gradle-wrapper.jar index 7454180f2..a4b76b953 100644 Binary files a/photonlib-cpp-examples/gradle/wrapper/gradle-wrapper.jar and b/photonlib-cpp-examples/gradle/wrapper/gradle-wrapper.jar differ diff --git a/photonlib-cpp-examples/gradle/wrapper/gradle-wrapper.properties b/photonlib-cpp-examples/gradle/wrapper/gradle-wrapper.properties index 10587529d..94113f200 100644 --- a/photonlib-cpp-examples/gradle/wrapper/gradle-wrapper.properties +++ b/photonlib-cpp-examples/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME -distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME -zipStorePath=permwrapper/dists +zipStorePath=wrapper/dists diff --git a/photonlib-cpp-examples/gradlew b/photonlib-cpp-examples/gradlew index 89a57c4df..f5feea6d6 100755 --- a/photonlib-cpp-examples/gradlew +++ b/photonlib-cpp-examples/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright � 2015-2021 the original authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,53 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME @@ -36,14 +82,12 @@ do esac done -# 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 - -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 -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -90,22 +134,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 @@ -150,11 +201,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" \ @@ -162,6 +217,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/photonlib-cpp-examples/gradlew.bat b/photonlib-cpp-examples/gradlew.bat index 107acd32c..9d21a2183 100644 --- a/photonlib-cpp-examples/gradlew.bat +++ b/photonlib-cpp-examples/gradlew.bat @@ -13,8 +13,10 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +27,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +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 +59,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 @@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/photonlib-cpp-examples/poseest/.wpilib/wpilib_preferences.json b/photonlib-cpp-examples/poseest/.wpilib/wpilib_preferences.json index 4c9e01a94..36dcd4ae4 100644 --- a/photonlib-cpp-examples/poseest/.wpilib/wpilib_preferences.json +++ b/photonlib-cpp-examples/poseest/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": true, "currentLanguage": "cpp", - "projectYear": "2026beta", + "projectYear": "2026", "teamNumber": 5 } diff --git a/photonlib-cpp-examples/poseest/build.gradle b/photonlib-cpp-examples/poseest/build.gradle index e00e0d0d7..a7b8544b2 100644 --- a/photonlib-cpp-examples/poseest/build.gradle +++ b/photonlib-cpp-examples/poseest/build.gradle @@ -1,7 +1,7 @@ plugins { id "cpp" id "google-test-test-suite" - id "edu.wpi.first.GradleRIO" version "2026.1.1-beta-1" + id "edu.wpi.first.GradleRIO" version "2026.1.1" } repositories { @@ -11,8 +11,8 @@ repositories { wpi.maven.useLocal = false wpi.maven.useDevelopment = false -wpi.versions.wpilibVersion = "2026.1.1-beta-1" -wpi.versions.wpimathVersion = "2026.1.1-beta-1" +wpi.versions.wpilibVersion = "2026.1.1" +wpi.versions.wpimathVersion = "2026.1.1" // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. @@ -37,6 +37,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } diff --git a/photonlib-java-examples/aimandrange/.wpilib/wpilib_preferences.json b/photonlib-java-examples/aimandrange/.wpilib/wpilib_preferences.json index 09acd7f32..50645b561 100644 --- a/photonlib-java-examples/aimandrange/.wpilib/wpilib_preferences.json +++ b/photonlib-java-examples/aimandrange/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2026beta", + "projectYear": "2026", "teamNumber": 4512 } diff --git a/photonlib-java-examples/aimandrange/build.gradle b/photonlib-java-examples/aimandrange/build.gradle index 9dc902a9b..5439da607 100644 --- a/photonlib-java-examples/aimandrange/build.gradle +++ b/photonlib-java-examples/aimandrange/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.1.1-beta-1" + id "edu.wpi.first.GradleRIO" version "2026.1.1" } sourceCompatibility = JavaVersion.VERSION_17 @@ -13,8 +13,8 @@ repositories { } wpi.maven.useDevelopment = true -wpi.versions.wpilibVersion = "2026.1.1-beta-1" -wpi.versions.wpimathVersion = "2026.1.1-beta-1" +wpi.versions.wpilibVersion = "2026.1.1" +wpi.versions.wpimathVersion = "2026.1.1" // Define my targets (RoboRIO) and artifacts (deployable files) @@ -40,6 +40,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } @@ -48,7 +50,8 @@ deploy { def deployArtifact = deploy.targets.roborio.artifacts.frcJava -// Set to true to use debug for JNI. +// Set to true to use debug for all targets including JNI, which will drastically impact +// performance. wpi.java.debugJni = false // Set this to true to enable desktop support. @@ -57,6 +60,7 @@ def includeDesktopSupport = true // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { + annotationProcessor wpi.java.deps.wpilibAnnotations() implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() @@ -74,7 +78,13 @@ dependencies { nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) simulationRelease wpi.sim.enableRelease() - testImplementation 'junit:junit:4.13.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' +} + +test { + useJUnitPlatform() + systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true' } // Simulation configuration (e.g. environment variables). @@ -90,6 +100,9 @@ jar { it.isDirectory() ? it : zipTree(it) } } + from('src') { into 'backup/src' } + from('vendordeps') { into 'backup/vendordeps' } + from('build.gradle') { into 'backup' } manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) duplicatesStrategy = DuplicatesStrategy.INCLUDE } diff --git a/photonlib-java-examples/aimandrange/gradle/wrapper/gradle-wrapper.jar b/photonlib-java-examples/aimandrange/gradle/wrapper/gradle-wrapper.jar index 249e5832f..a4b76b953 100644 Binary files a/photonlib-java-examples/aimandrange/gradle/wrapper/gradle-wrapper.jar and b/photonlib-java-examples/aimandrange/gradle/wrapper/gradle-wrapper.jar differ diff --git a/photonlib-java-examples/aimandrange/gradle/wrapper/gradle-wrapper.properties b/photonlib-java-examples/aimandrange/gradle/wrapper/gradle-wrapper.properties index ca8f28abd..34bd9ce95 100644 --- a/photonlib-java-examples/aimandrange/gradle/wrapper/gradle-wrapper.properties +++ b/photonlib-java-examples/aimandrange/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=permwrapper/dists -distributionUrl=https\://services\.gradle\.org/distributions/gradle-8\.4-bin\.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=permwrapper/dists diff --git a/photonlib-java-examples/aimandrange/gradlew b/photonlib-java-examples/aimandrange/gradlew index 0ef4c1e86..f5feea6d6 100644 --- a/photonlib-java-examples/aimandrange/gradlew +++ b/photonlib-java-examples/aimandrange/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,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/platforms/jvm/plugins-application/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,14 +82,12 @@ do esac done -# 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 - -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 -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -134,22 +134,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 @@ -194,11 +201,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/photonlib-java-examples/aimandrange/gradlew.bat b/photonlib-java-examples/aimandrange/gradlew.bat index f127cfd49..9d21a2183 100644 --- a/photonlib-java-examples/aimandrange/gradlew.bat +++ b/photonlib-java-examples/aimandrange/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -26,6 +28,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 +45,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 +59,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/photonlib-java-examples/aimattarget/.wpilib/wpilib_preferences.json b/photonlib-java-examples/aimattarget/.wpilib/wpilib_preferences.json index 09acd7f32..50645b561 100644 --- a/photonlib-java-examples/aimattarget/.wpilib/wpilib_preferences.json +++ b/photonlib-java-examples/aimattarget/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2026beta", + "projectYear": "2026", "teamNumber": 4512 } diff --git a/photonlib-java-examples/aimattarget/build.gradle b/photonlib-java-examples/aimattarget/build.gradle index 12719b057..acc7136c1 100644 --- a/photonlib-java-examples/aimattarget/build.gradle +++ b/photonlib-java-examples/aimattarget/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.1.1-beta-1" + id "edu.wpi.first.GradleRIO" version "2026.1.1" } sourceCompatibility = JavaVersion.VERSION_17 @@ -9,8 +9,8 @@ targetCompatibility = JavaVersion.VERSION_17 def ROBOT_MAIN_CLASS = "frc.robot.Main" wpi.maven.useDevelopment = true -wpi.versions.wpilibVersion = "2026.1.1-beta-1" -wpi.versions.wpimathVersion = "2026.1.1-beta-1" +wpi.versions.wpilibVersion = "2026.1.1" +wpi.versions.wpimathVersion = "2026.1.1" // Define my targets (RoboRIO) and artifacts (deployable files) @@ -36,6 +36,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } @@ -44,7 +46,8 @@ deploy { def deployArtifact = deploy.targets.roborio.artifacts.frcJava -// Set to true to use debug for JNI. +// Set to true to use debug for all targets including JNI, which will drastically impact +// performance. wpi.java.debugJni = false // Set this to true to enable desktop support. @@ -53,6 +56,7 @@ def includeDesktopSupport = true // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { + annotationProcessor wpi.java.deps.wpilibAnnotations() implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() @@ -70,7 +74,13 @@ dependencies { nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) simulationRelease wpi.sim.enableRelease() - testImplementation 'junit:junit:4.13.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' +} + +test { + useJUnitPlatform() + systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true' } // Simulation configuration (e.g. environment variables). @@ -86,6 +96,9 @@ jar { it.isDirectory() ? it : zipTree(it) } } + from('src') { into 'backup/src' } + from('vendordeps') { into 'backup/vendordeps' } + from('build.gradle') { into 'backup' } manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) duplicatesStrategy = DuplicatesStrategy.INCLUDE } diff --git a/photonlib-java-examples/aimattarget/gradle/wrapper/gradle-wrapper.jar b/photonlib-java-examples/aimattarget/gradle/wrapper/gradle-wrapper.jar index 249e5832f..a4b76b953 100644 Binary files a/photonlib-java-examples/aimattarget/gradle/wrapper/gradle-wrapper.jar and b/photonlib-java-examples/aimattarget/gradle/wrapper/gradle-wrapper.jar differ diff --git a/photonlib-java-examples/aimattarget/gradle/wrapper/gradle-wrapper.properties b/photonlib-java-examples/aimattarget/gradle/wrapper/gradle-wrapper.properties index ca8f28abd..34bd9ce95 100644 --- a/photonlib-java-examples/aimattarget/gradle/wrapper/gradle-wrapper.properties +++ b/photonlib-java-examples/aimattarget/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=permwrapper/dists -distributionUrl=https\://services\.gradle\.org/distributions/gradle-8\.4-bin\.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=permwrapper/dists diff --git a/photonlib-java-examples/aimattarget/gradlew b/photonlib-java-examples/aimattarget/gradlew index 0ef4c1e86..f5feea6d6 100644 --- a/photonlib-java-examples/aimattarget/gradlew +++ b/photonlib-java-examples/aimattarget/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,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/platforms/jvm/plugins-application/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,14 +82,12 @@ do esac done -# 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 - -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 -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -134,22 +134,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 @@ -194,11 +201,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/photonlib-java-examples/aimattarget/gradlew.bat b/photonlib-java-examples/aimattarget/gradlew.bat index f127cfd49..9d21a2183 100644 --- a/photonlib-java-examples/aimattarget/gradlew.bat +++ b/photonlib-java-examples/aimattarget/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -26,6 +28,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 +45,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 +59,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/photonlib-java-examples/aimattarget/src/test/java/frc/robot/JniLoadTest.java b/photonlib-java-examples/aimattarget/src/test/java/frc/robot/JniLoadTest.java index 07da7e010..82d1c002d 100644 --- a/photonlib-java-examples/aimattarget/src/test/java/frc/robot/JniLoadTest.java +++ b/photonlib-java-examples/aimattarget/src/test/java/frc/robot/JniLoadTest.java @@ -24,12 +24,12 @@ package frc.robot; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import edu.wpi.first.math.geometry.Pose3d; import edu.wpi.first.math.geometry.Rotation2d; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.photonvision.PhotonCamera; import org.photonvision.simulation.PhotonCameraSim; import org.photonvision.simulation.SimCameraProperties; @@ -37,14 +37,14 @@ import org.photonvision.timesync.TimeSyncSingleton; public class JniLoadTest { @Test - public void smoketestTimeSync() { + void smoketestTimeSync() { if (!TimeSyncSingleton.load()) { fail("Could not load TimeSync JNI????????"); } } @Test - public void smoketestPhotonCameraSim() { + void smoketestPhotonCameraSim() { // This will trigger a force load of OpenCV internally - good to smoketest var camera = new PhotonCamera("Hellowo"); var cameraProp = new SimCameraProperties(); diff --git a/photonlib-java-examples/build.gradle b/photonlib-java-examples/build.gradle index 0bd30f7c4..ecef0406c 100644 --- a/photonlib-java-examples/build.gradle +++ b/photonlib-java-examples/build.gradle @@ -1,5 +1,5 @@ plugins { - id "com.diffplug.spotless" version "6.1.2" + id "com.diffplug.spotless" version "8.1.0" } allprojects { diff --git a/photonlib-java-examples/gradle/wrapper/gradle-wrapper.jar b/photonlib-java-examples/gradle/wrapper/gradle-wrapper.jar index 7454180f2..a4b76b953 100644 Binary files a/photonlib-java-examples/gradle/wrapper/gradle-wrapper.jar and b/photonlib-java-examples/gradle/wrapper/gradle-wrapper.jar differ diff --git a/photonlib-java-examples/gradle/wrapper/gradle-wrapper.properties b/photonlib-java-examples/gradle/wrapper/gradle-wrapper.properties index 10587529d..94113f200 100644 --- a/photonlib-java-examples/gradle/wrapper/gradle-wrapper.properties +++ b/photonlib-java-examples/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME -distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME -zipStorePath=permwrapper/dists +zipStorePath=wrapper/dists diff --git a/photonlib-java-examples/gradlew b/photonlib-java-examples/gradlew index 89a57c4df..f5feea6d6 100755 --- a/photonlib-java-examples/gradlew +++ b/photonlib-java-examples/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright � 2015-2021 the original authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,53 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME @@ -36,14 +82,12 @@ do esac done -# 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 - -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 -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -90,22 +134,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 @@ -150,11 +201,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" \ @@ -162,6 +217,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/photonlib-java-examples/gradlew.bat b/photonlib-java-examples/gradlew.bat index 107acd32c..9d21a2183 100644 --- a/photonlib-java-examples/gradlew.bat +++ b/photonlib-java-examples/gradlew.bat @@ -13,8 +13,10 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +27,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +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 +59,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 @@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/photonlib-java-examples/poseest/.wpilib/wpilib_preferences.json b/photonlib-java-examples/poseest/.wpilib/wpilib_preferences.json index 09acd7f32..50645b561 100644 --- a/photonlib-java-examples/poseest/.wpilib/wpilib_preferences.json +++ b/photonlib-java-examples/poseest/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2026beta", + "projectYear": "2026", "teamNumber": 4512 } diff --git a/photonlib-java-examples/poseest/build.gradle b/photonlib-java-examples/poseest/build.gradle index 3b903edfc..8794c1206 100644 --- a/photonlib-java-examples/poseest/build.gradle +++ b/photonlib-java-examples/poseest/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.1.1-beta-1" + id "edu.wpi.first.GradleRIO" version "2026.1.1" } sourceCompatibility = JavaVersion.VERSION_17 @@ -9,8 +9,8 @@ targetCompatibility = JavaVersion.VERSION_17 def ROBOT_MAIN_CLASS = "frc.robot.Main" wpi.maven.useDevelopment = true -wpi.versions.wpilibVersion = "2026.1.1-beta-1" -wpi.versions.wpimathVersion = "2026.1.1-beta-1" +wpi.versions.wpilibVersion = "2026.1.1" +wpi.versions.wpimathVersion = "2026.1.1" // Define my targets (RoboRIO) and artifacts (deployable files) @@ -36,6 +36,8 @@ deploy { frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/lvuser/deploy' + deleteOldFiles = false // Change to true to delete files on roboRIO that no + // longer exist in deploy directory of this project } } } @@ -44,7 +46,8 @@ deploy { def deployArtifact = deploy.targets.roborio.artifacts.frcJava -// Set to true to use debug for JNI. +// Set to true to use debug for all targets including JNI, which will drastically impact +// performance. wpi.java.debugJni = false // Set this to true to enable desktop support. @@ -53,6 +56,7 @@ def includeDesktopSupport = true // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { + annotationProcessor wpi.java.deps.wpilibAnnotations() implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() @@ -70,7 +74,13 @@ dependencies { nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) simulationRelease wpi.sim.enableRelease() - testImplementation 'junit:junit:4.13.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' +} + +test { + useJUnitPlatform() + systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true' } // Simulation configuration (e.g. environment variables). @@ -86,6 +96,9 @@ jar { it.isDirectory() ? it : zipTree(it) } } + from('src') { into 'backup/src' } + from('vendordeps') { into 'backup/vendordeps' } + from('build.gradle') { into 'backup' } manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) duplicatesStrategy = DuplicatesStrategy.INCLUDE } diff --git a/photonlib-java-examples/poseest/gradle/wrapper/gradle-wrapper.jar b/photonlib-java-examples/poseest/gradle/wrapper/gradle-wrapper.jar index 249e5832f..a4b76b953 100644 Binary files a/photonlib-java-examples/poseest/gradle/wrapper/gradle-wrapper.jar and b/photonlib-java-examples/poseest/gradle/wrapper/gradle-wrapper.jar differ diff --git a/photonlib-java-examples/poseest/gradle/wrapper/gradle-wrapper.properties b/photonlib-java-examples/poseest/gradle/wrapper/gradle-wrapper.properties index ca8f28abd..34bd9ce95 100644 --- a/photonlib-java-examples/poseest/gradle/wrapper/gradle-wrapper.properties +++ b/photonlib-java-examples/poseest/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=permwrapper/dists -distributionUrl=https\://services\.gradle\.org/distributions/gradle-8\.4-bin\.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=permwrapper/dists diff --git a/photonlib-java-examples/poseest/gradlew b/photonlib-java-examples/poseest/gradlew index 0ef4c1e86..f5feea6d6 100644 --- a/photonlib-java-examples/poseest/gradlew +++ b/photonlib-java-examples/poseest/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,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/platforms/jvm/plugins-application/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,14 +82,12 @@ do esac done -# 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 - -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 -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -134,22 +134,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 @@ -194,11 +201,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/photonlib-java-examples/poseest/gradlew.bat b/photonlib-java-examples/poseest/gradlew.bat index f127cfd49..9d21a2183 100644 --- a/photonlib-java-examples/poseest/gradlew.bat +++ b/photonlib-java-examples/poseest/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -26,6 +28,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 +45,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 +59,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/photonlib-python-examples/aimandrange/pyproject.toml b/photonlib-python-examples/aimandrange/pyproject.toml index f1cb86aaf..88e1acbf0 100644 --- a/photonlib-python-examples/aimandrange/pyproject.toml +++ b/photonlib-python-examples/aimandrange/pyproject.toml @@ -6,7 +6,7 @@ [tool.robotpy] # Version of robotpy this project depends on -robotpy_version = "2026.1.1b1" +robotpy_version = "2026.1.1" # Which extra RobotPy components should be installed # -> equivalent to `pip install robotpy[extra1, ...] diff --git a/photonlib-python-examples/aimattarget/pyproject.toml b/photonlib-python-examples/aimattarget/pyproject.toml index f1cb86aaf..88e1acbf0 100644 --- a/photonlib-python-examples/aimattarget/pyproject.toml +++ b/photonlib-python-examples/aimattarget/pyproject.toml @@ -6,7 +6,7 @@ [tool.robotpy] # Version of robotpy this project depends on -robotpy_version = "2026.1.1b1" +robotpy_version = "2026.1.1" # Which extra RobotPy components should be installed # -> equivalent to `pip install robotpy[extra1, ...] diff --git a/photonlib-python-examples/poseest/pyproject.toml b/photonlib-python-examples/poseest/pyproject.toml index f1cb86aaf..88e1acbf0 100644 --- a/photonlib-python-examples/poseest/pyproject.toml +++ b/photonlib-python-examples/poseest/pyproject.toml @@ -6,7 +6,7 @@ [tool.robotpy] # Version of robotpy this project depends on -robotpy_version = "2026.1.1b1" +robotpy_version = "2026.1.1" # Which extra RobotPy components should be installed # -> equivalent to `pip install robotpy[extra1, ...]