From ed1b31cb7f3b9ce9d4ff8ec1e0e3c34802f7f238 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Tue, 17 Jun 2025 19:09:09 -0400 Subject: [PATCH] Upgrade to 2027 alpha --- .github/workflows/build.yml | 10 +++--- README.md | 2 +- build.gradle | 9 +++--- photon-core/build.gradle | 1 + .../networktables/NetworkTablesManager.java | 2 +- photon-lib/build.gradle | 2 ++ .../java/org/photonvision/PhotonCamera.java | 3 +- .../org/photonvision/PhotonPoseEstimator.java | 3 +- .../main/native/cpp/photon/PhotonCamera.cpp | 2 +- .../native/cpp/photon/PhotonPoseEstimator.cpp | 3 +- .../org/photonvision/PhotonCameraTest.java | 4 +-- photon-targeting/build.gradle | 4 +++ .../main/native/jni/FileLoggerExtrasJNI.cpp | 4 +-- .../aimandrange/build.gradle | 25 +++++---------- .../aimandrange/settings.gradle | 10 +++--- .../aimattarget/build.gradle | 25 +++++---------- .../aimattarget/settings.gradle | 10 +++--- photonlib-cpp-examples/poseest/build.gradle | 25 +++++---------- .../poseest/settings.gradle | 10 +++--- .../aimandrange/build.gradle | 32 +++++++++---------- .../aimandrange/settings.gradle | 9 ++++-- .../aimattarget/build.gradle | 32 +++++++++---------- .../aimattarget/settings.gradle | 9 ++++-- photonlib-java-examples/poseest/build.gradle | 32 +++++++++---------- .../poseest/settings.gradle | 9 ++++-- shared/common.gradle | 1 + shared/config.gradle | 1 - shared/javacommon.gradle | 1 + 28 files changed, 137 insertions(+), 143 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f15d77bf0..850cc5276 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,11 +51,11 @@ jobs: with: java-version: 17 distribution: temurin - - name: Install RoboRIO Toolchain - run: ./gradlew installRoboRioToolchain + - name: Install SystemCore Toolchain + run: ./gradlew installSystemCoreToolchain - name: Delete duplicate toolchains run: | - find ~/.gradle/cache/ -name *roborio-academic* -exec rm -rf {} + + find ~/.gradle/cache/ -name *bookworm* -exec rm -rf {} + du -h . | sort -h if: matrix.os == 'ubuntu-24.04' # Download prebuilt photonlib artifacts @@ -253,7 +253,7 @@ jobs: name: Publish env: ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} - if: github.event_name == 'push' && github.repository_owner == 'photonvision' + if: github.event_name == 'push' && github.repository_owner == 'photonvision' && github.ref == 'refs/heads/main' # Copy artifacts to build/outputs/maven - run: ./gradlew photon-lib:publish photon-targeting:publish -PcopyOfflineArtifacts - uses: actions/upload-artifact@v6 @@ -291,7 +291,7 @@ jobs: run: ./gradlew photon-lib:publish photon-targeting:publish ${{ matrix.build-options }} env: ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} - if: github.event_name == 'push' && github.repository_owner == 'photonvision' + if: github.event_name == 'push' && github.repository_owner == 'photonvision' && github.ref == 'refs/heads/main' # Copy artifacts to build/outputs/maven - run: ./gradlew photon-lib:publish photon-targeting:publish -PcopyOfflineArtifacts ${{ matrix.build-options }} - uses: actions/upload-artifact@v6 diff --git a/README.md b/README.md index fc8400e25..26515a19c 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Note that these are case sensitive! - `-Pprofile`: enables JVM profiling - `-PwithSanitizers`: On Linux, enables `-fsanitize=address,undefined,leak` -If you're cross-compiling, you'll need the WPILib toolchain installed. This must be done via Gradle: for example `./gradlew installArm64Toolchain` or `./gradlew installRoboRioToolchain` +If you're cross-compiling, you'll need the WPILib toolchain installed. This must be done via Gradle: for example `./gradlew installArm64Toolchain` or `./gradlew installSystemCoreToolchain` ## Out-of-Source Dependencies diff --git a/build.gradle b/build.gradle index 074dad7d6..232f45082 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,8 @@ import edu.wpi.first.toolchain.* plugins { id "cpp" 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.2.1" + id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2025.0" + id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-1" id 'org.photonvision.tools.WpilibTools' version '2.4.1-photon' id 'com.google.protobuf' version '0.9.3' apply false id 'edu.wpi.first.GradleJni' version '1.1.0' @@ -21,6 +21,7 @@ allprojects { maven { url = "https://maven.photonvision.org/releases" } maven { url = "https://maven.photonvision.org/snapshots" } } + wpilibRepositories.use2027Repos() wpilibRepositories.addAllReleaseRepositories(it) wpilibRepositories.addAllDevelopmentRepositories(it) } @@ -32,7 +33,7 @@ ext.allOutputsFolder = file("$project.buildDir/outputs") apply from: "versioningHelper.gradle" ext { - wpilibVersion = "2026.2.1" + wpilibVersion = "2027.0.0-alpha-1" wpimathVersion = wpilibVersion openCVYear = "2025" openCVversion = "4.10.0-3" @@ -40,7 +41,7 @@ ext { libcameraDriverVersion = "v2026.0.0" rknnVersion = "dev-v2026.0.1-1-g89b2888" rubikVersion = "dev-v2026.0.1-4-g13d6279" - frcYear = "2026" + frcYear = "2027_alpha1" mrcalVersion = "dev-v2026.0.0-1-g239d80e"; pubVersion = versionString diff --git a/photon-core/build.gradle b/photon-core/build.gradle index 4ef927f6c..aa66fc967 100644 --- a/photon-core/build.gradle +++ b/photon-core/build.gradle @@ -23,6 +23,7 @@ dependencies { wpilibNatives wpilibTools.deps.wpilib("wpimath") wpilibNatives wpilibTools.deps.wpilib("wpinet") wpilibNatives wpilibTools.deps.wpilib("wpiutil") + wpilibNatives wpilibTools.deps.wpilib("datalog") wpilibNatives wpilibTools.deps.wpilib("ntcore") wpilibNatives wpilibTools.deps.wpilib("cscore") wpilibNatives wpilibTools.deps.wpilib("apriltag") diff --git a/photon-core/src/main/java/org/photonvision/common/dataflow/networktables/NetworkTablesManager.java b/photon-core/src/main/java/org/photonvision/common/dataflow/networktables/NetworkTablesManager.java index e713edcbb..bad248e26 100644 --- a/photon-core/src/main/java/org/photonvision/common/dataflow/networktables/NetworkTablesManager.java +++ b/photon-core/src/main/java/org/photonvision/common/dataflow/networktables/NetworkTablesManager.java @@ -358,7 +358,7 @@ public class NetworkTablesManager { ntInstance.stopClient(); String hostname = config.shouldManage ? config.hostname : CameraServerJNI.getHostname(); logger.debug("Starting NT Client with hostname: " + hostname); - ntInstance.startClient4(hostname); + ntInstance.startClient(hostname); try { int t = Integer.parseInt(config.ntServerAddress); if (!m_isRetryingConnection) logger.info("Starting NT Client, server team is " + t); diff --git a/photon-lib/build.gradle b/photon-lib/build.gradle index 3645931ba..5703c9081 100644 --- a/photon-lib/build.gradle +++ b/photon-lib/build.gradle @@ -90,6 +90,7 @@ model { } } + nativeUtils.useRequiredLibrary(it, "datalog_shared") nativeUtils.useRequiredLibrary(it, "cscore_shared") nativeUtils.useRequiredLibrary(it, "cameraserver_shared") nativeUtils.useRequiredLibrary(it, "wpilib_executable_shared") @@ -369,6 +370,7 @@ dependencies { nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil") +nativeConfig.dependencies.add wpilibTools.deps.wpilib("datalog") nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore") nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore") nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag") diff --git a/photon-lib/src/main/java/org/photonvision/PhotonCamera.java b/photon-lib/src/main/java/org/photonvision/PhotonCamera.java index d548e17f0..0d4cb7f17 100644 --- a/photon-lib/src/main/java/org/photonvision/PhotonCamera.java +++ b/photon-lib/src/main/java/org/photonvision/PhotonCamera.java @@ -24,7 +24,6 @@ package org.photonvision; -import edu.wpi.first.hal.FRCNetComm.tResourceType; import edu.wpi.first.hal.HAL; import edu.wpi.first.math.MatBuilder; import edu.wpi.first.math.Matrix; @@ -176,8 +175,8 @@ public class PhotonCamera implements AutoCloseable { new MultiSubscriber( instance, new String[] {"/photonvision/"}, PubSubOption.topicsOnly(true)); - HAL.report(tResourceType.kResourceType_PhotonCamera, InstanceCount); InstanceCount++; + HAL.reportUsage("PhotonVision/PhotonCamera", InstanceCount, ""); // HACK - start a TimeSyncServer, if we haven't yet. TimeSyncSingleton.load(); diff --git a/photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java b/photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java index 2b560abe7..f7f0c2c1d 100644 --- a/photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java +++ b/photon-lib/src/main/java/org/photonvision/PhotonPoseEstimator.java @@ -26,7 +26,6 @@ package org.photonvision; import edu.wpi.first.apriltag.AprilTagFieldLayout; import edu.wpi.first.cscore.OpenCvLoader; -import edu.wpi.first.hal.FRCNetComm.tResourceType; import edu.wpi.first.hal.HAL; import edu.wpi.first.math.Matrix; import edu.wpi.first.math.Pair; @@ -184,8 +183,8 @@ public class PhotonPoseEstimator { OpenCvLoader.forceStaticLoad(); } - HAL.report(tResourceType.kResourceType_PhotonPoseEstimator, InstanceCount); InstanceCount++; + HAL.reportUsage("PhotonVision/PhotonPoseEstimator", InstanceCount, ""); } /** Invalidates the pose cache. */ diff --git a/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp b/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp index 1c4833c4b..bb0006478 100644 --- a/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp +++ b/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp @@ -166,8 +166,8 @@ PhotonCamera::PhotonCamera(nt::NetworkTableInstance instance, frc::Alert::AlertType::kWarning), timesyncAlert(PHOTON_ALERT_GROUP, "", frc::Alert::AlertType::kWarning) { verifyDependencies(); - HAL_Report(HALUsageReporting::kResourceType_PhotonCamera, InstanceCount); InstanceCount++; + HAL_ReportUsage("PhotonVision/PhotonCamera", InstanceCount, ""); // The Robot class is actually created here: // https://github.com/wpilibsuite/allwpilib/blob/811b1309683e930a1ce69fae818f943ff161b7a5/wpilibc/src/main/native/include/frc/RobotBase.h#L33 diff --git a/photon-lib/src/main/native/cpp/photon/PhotonPoseEstimator.cpp b/photon-lib/src/main/native/cpp/photon/PhotonPoseEstimator.cpp index b49a46219..a72089809 100644 --- a/photon-lib/src/main/native/cpp/photon/PhotonPoseEstimator.cpp +++ b/photon-lib/src/main/native/cpp/photon/PhotonPoseEstimator.cpp @@ -86,9 +86,8 @@ PhotonPoseEstimator::PhotonPoseEstimator(frc::AprilTagFieldLayout tags, referencePose(frc::Pose3d()), poseCacheTimestamp(-1_s), headingBuffer(frc::TimeInterpolatableBuffer(1_s)) { - HAL_Report(HALUsageReporting::kResourceType_PhotonPoseEstimator, - InstanceCount); InstanceCount++; + HAL_ReportUsage("PhotonVision/PhotonPoseEstimator", InstanceCount, ""); } void PhotonPoseEstimator::SetMultiTagFallbackStrategy(PoseStrategy strategy) { diff --git a/photon-lib/src/test/java/org/photonvision/PhotonCameraTest.java b/photon-lib/src/test/java/org/photonvision/PhotonCameraTest.java index 9a2f69dd4..c5ed3189b 100644 --- a/photon-lib/src/test/java/org/photonvision/PhotonCameraTest.java +++ b/photon-lib/src/test/java/org/photonvision/PhotonCameraTest.java @@ -253,14 +253,14 @@ class PhotonCameraTest { if (i == coprocStart || i == coprocRestart) { coprocNt.setServer("127.0.0.1", 5940); - coprocNt.startClient4("testClient"); + coprocNt.startClient("testClient"); // PhotonCamera makes a server by default - connect to it tspClient = new TimeSyncClient("127.0.0.1", 5810, 0.5); } if (i == robotStart || i == robotRestart) { - robotNt.startServer("networktables_random.json", "", 5941, 5940); + robotNt.startServer("networktables_random.json", "", 5940); } Thread.sleep(100); diff --git a/photon-targeting/build.gradle b/photon-targeting/build.gradle index 0ee500035..7bf667bcc 100644 --- a/photon-targeting/build.gradle +++ b/photon-targeting/build.gradle @@ -55,6 +55,7 @@ model { } nativeUtils.useRequiredLibrary(it, "wpiutil_shared") + nativeUtils.useRequiredLibrary(it, "datalog_shared") nativeUtils.useRequiredLibrary(it, "wpimath_shared") nativeUtils.useRequiredLibrary(it, "wpinet_shared") nativeUtils.useRequiredLibrary(it, "ntcore_shared") @@ -83,6 +84,7 @@ model { } nativeUtils.useRequiredLibrary(it, "wpiutil_shared") + nativeUtils.useRequiredLibrary(it, "datalog_shared") nativeUtils.useRequiredLibrary(it, "wpimath_shared") nativeUtils.useRequiredLibrary(it, "wpinet_shared") nativeUtils.useRequiredLibrary(it, "ntcore_shared") @@ -120,6 +122,7 @@ model { nativeUtils.useRequiredLibrary(it, "wpilib_executable_shared") nativeUtils.useRequiredLibrary(it, "googletest_static") + nativeUtils.useRequiredLibrary(it, "datalog_shared") nativeUtils.useRequiredLibrary(it, "apriltag_shared") nativeUtils.useRequiredLibrary(it, "cscore_shared") nativeUtils.useRequiredLibrary(it, "opencv_shared") @@ -179,6 +182,7 @@ def nativeTasks = wpilibTools.createExtractionTasks { nativeTasks.addToSourceSetResources(sourceSets.test) nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil") +nativeConfig.dependencies.add wpilibTools.deps.wpilib("datalog") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet") nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore") diff --git a/photon-targeting/src/main/native/jni/FileLoggerExtrasJNI.cpp b/photon-targeting/src/main/native/jni/FileLoggerExtrasJNI.cpp index f65d08977..f0f36c3de 100644 --- a/photon-targeting/src/main/native/jni/FileLoggerExtrasJNI.cpp +++ b/photon-targeting/src/main/native/jni/FileLoggerExtrasJNI.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include "jni_utils.h" #include "org_photonvision_jni_QueuedFileLogger.h" @@ -30,7 +30,7 @@ struct QueuedFileLogger { std::mutex m_mutex; - wpi::FileLogger logger; + wpi::log::FileLogger logger; explicit QueuedFileLogger(std::string_view file) : logger{file, std::bind(&QueuedFileLogger::callback, this, diff --git a/photonlib-cpp-examples/aimandrange/build.gradle b/photonlib-cpp-examples/aimandrange/build.gradle index e18b1d878..4c6930e3b 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.2.1" + id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-1" } repositories { @@ -11,14 +11,13 @@ repositories { wpi.maven.useLocal = false wpi.maven.useDevelopment = false -wpi.versions.wpilibVersion = "2026.2.1" -wpi.versions.wpimathVersion = "2026.2.1" +wpi.versions.wpilibVersion = "2027.0.+" -// Define my targets (RoboRIO) and artifacts (deployable files) +// Define my targets (SystemCore) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { targets { - roborio(getTargetTypeClass('RoboRIO')) { + systemcore(getTargetTypeClass('SystemCore')) { // Team number is loaded either from the .wpilib/wpilib_preferences.json // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you @@ -36,8 +35,8 @@ deploy { // Static files artifact 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 + directory = '/home/systemcore/deploy' + deleteOldFiles = false // Change to true to delete files on SystemCore that no // longer exist in deploy directory of this project } } @@ -45,7 +44,7 @@ deploy { } } -def deployArtifact = deploy.targets.roborio.artifacts.frcCpp +def deployArtifact = deploy.targets.systemcore.artifacts.frcCpp // Set this to true to enable desktop support. def includeDesktopSupport = true @@ -61,15 +60,7 @@ wpi.sim.addDriverstation() model { components { frcUserProgram(NativeExecutableSpec) { - // We don't need to build for roborio -- if we do, we need to install - // a roborio toolchain every time we build in CI - // Ideally, we'd be able to set the roborio toolchain as optional, but - // I can't figure out how to set that environment variable from build.gradle - // (see https://github.com/wpilibsuite/native-utils/blob/2917c69fb5094e36d499c465f047dab81c68446c/ToolchainPlugin/src/main/java/edu/wpi/first/toolchain/ToolchainGraphBuildService.java#L71) - // for now, commented out - - // targetPlatform wpi.platforms.roborio - + targetPlatform wpi.platforms.systemcore if (includeDesktopSupport) { targetPlatform wpi.platforms.desktop } diff --git a/photonlib-cpp-examples/aimandrange/settings.gradle b/photonlib-cpp-examples/aimandrange/settings.gradle index 882b61321..64213ce87 100644 --- a/photonlib-cpp-examples/aimandrange/settings.gradle +++ b/photonlib-cpp-examples/aimandrange/settings.gradle @@ -3,9 +3,8 @@ import org.gradle.internal.os.OperatingSystem pluginManagement { repositories { mavenLocal() - jcenter() gradlePluginPortal() - String frcYear = '2026' + String frcYear = '2027_alpha1' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') @@ -21,8 +20,11 @@ pluginManagement { } def frcHomeMaven = new File(frcHome, 'maven') maven { - name 'frcHome' - url frcHomeMaven + name = 'frcHome' + url = frcHomeMaven } } } + +Properties props = System.getProperties(); +props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); diff --git a/photonlib-cpp-examples/aimattarget/build.gradle b/photonlib-cpp-examples/aimattarget/build.gradle index e18b1d878..4c6930e3b 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.2.1" + id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-1" } repositories { @@ -11,14 +11,13 @@ repositories { wpi.maven.useLocal = false wpi.maven.useDevelopment = false -wpi.versions.wpilibVersion = "2026.2.1" -wpi.versions.wpimathVersion = "2026.2.1" +wpi.versions.wpilibVersion = "2027.0.+" -// Define my targets (RoboRIO) and artifacts (deployable files) +// Define my targets (SystemCore) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { targets { - roborio(getTargetTypeClass('RoboRIO')) { + systemcore(getTargetTypeClass('SystemCore')) { // Team number is loaded either from the .wpilib/wpilib_preferences.json // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you @@ -36,8 +35,8 @@ deploy { // Static files artifact 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 + directory = '/home/systemcore/deploy' + deleteOldFiles = false // Change to true to delete files on SystemCore that no // longer exist in deploy directory of this project } } @@ -45,7 +44,7 @@ deploy { } } -def deployArtifact = deploy.targets.roborio.artifacts.frcCpp +def deployArtifact = deploy.targets.systemcore.artifacts.frcCpp // Set this to true to enable desktop support. def includeDesktopSupport = true @@ -61,15 +60,7 @@ wpi.sim.addDriverstation() model { components { frcUserProgram(NativeExecutableSpec) { - // We don't need to build for roborio -- if we do, we need to install - // a roborio toolchain every time we build in CI - // Ideally, we'd be able to set the roborio toolchain as optional, but - // I can't figure out how to set that environment variable from build.gradle - // (see https://github.com/wpilibsuite/native-utils/blob/2917c69fb5094e36d499c465f047dab81c68446c/ToolchainPlugin/src/main/java/edu/wpi/first/toolchain/ToolchainGraphBuildService.java#L71) - // for now, commented out - - // targetPlatform wpi.platforms.roborio - + targetPlatform wpi.platforms.systemcore if (includeDesktopSupport) { targetPlatform wpi.platforms.desktop } diff --git a/photonlib-cpp-examples/aimattarget/settings.gradle b/photonlib-cpp-examples/aimattarget/settings.gradle index 882b61321..64213ce87 100644 --- a/photonlib-cpp-examples/aimattarget/settings.gradle +++ b/photonlib-cpp-examples/aimattarget/settings.gradle @@ -3,9 +3,8 @@ import org.gradle.internal.os.OperatingSystem pluginManagement { repositories { mavenLocal() - jcenter() gradlePluginPortal() - String frcYear = '2026' + String frcYear = '2027_alpha1' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') @@ -21,8 +20,11 @@ pluginManagement { } def frcHomeMaven = new File(frcHome, 'maven') maven { - name 'frcHome' - url frcHomeMaven + name = 'frcHome' + url = frcHomeMaven } } } + +Properties props = System.getProperties(); +props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); diff --git a/photonlib-cpp-examples/poseest/build.gradle b/photonlib-cpp-examples/poseest/build.gradle index e18b1d878..4c6930e3b 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.2.1" + id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-1" } repositories { @@ -11,14 +11,13 @@ repositories { wpi.maven.useLocal = false wpi.maven.useDevelopment = false -wpi.versions.wpilibVersion = "2026.2.1" -wpi.versions.wpimathVersion = "2026.2.1" +wpi.versions.wpilibVersion = "2027.0.+" -// Define my targets (RoboRIO) and artifacts (deployable files) +// Define my targets (SystemCore) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { targets { - roborio(getTargetTypeClass('RoboRIO')) { + systemcore(getTargetTypeClass('SystemCore')) { // Team number is loaded either from the .wpilib/wpilib_preferences.json // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you @@ -36,8 +35,8 @@ deploy { // Static files artifact 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 + directory = '/home/systemcore/deploy' + deleteOldFiles = false // Change to true to delete files on SystemCore that no // longer exist in deploy directory of this project } } @@ -45,7 +44,7 @@ deploy { } } -def deployArtifact = deploy.targets.roborio.artifacts.frcCpp +def deployArtifact = deploy.targets.systemcore.artifacts.frcCpp // Set this to true to enable desktop support. def includeDesktopSupport = true @@ -61,15 +60,7 @@ wpi.sim.addDriverstation() model { components { frcUserProgram(NativeExecutableSpec) { - // We don't need to build for roborio -- if we do, we need to install - // a roborio toolchain every time we build in CI - // Ideally, we'd be able to set the roborio toolchain as optional, but - // I can't figure out how to set that environment variable from build.gradle - // (see https://github.com/wpilibsuite/native-utils/blob/2917c69fb5094e36d499c465f047dab81c68446c/ToolchainPlugin/src/main/java/edu/wpi/first/toolchain/ToolchainGraphBuildService.java#L71) - // for now, commented out - - // targetPlatform wpi.platforms.roborio - + targetPlatform wpi.platforms.systemcore if (includeDesktopSupport) { targetPlatform wpi.platforms.desktop } diff --git a/photonlib-cpp-examples/poseest/settings.gradle b/photonlib-cpp-examples/poseest/settings.gradle index 882b61321..64213ce87 100644 --- a/photonlib-cpp-examples/poseest/settings.gradle +++ b/photonlib-cpp-examples/poseest/settings.gradle @@ -3,9 +3,8 @@ import org.gradle.internal.os.OperatingSystem pluginManagement { repositories { mavenLocal() - jcenter() gradlePluginPortal() - String frcYear = '2026' + String frcYear = '2027_alpha1' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') @@ -21,8 +20,11 @@ pluginManagement { } def frcHomeMaven = new File(frcHome, 'maven') maven { - name 'frcHome' - url frcHomeMaven + name = 'frcHome' + url = frcHomeMaven } } } + +Properties props = System.getProperties(); +props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); diff --git a/photonlib-java-examples/aimandrange/build.gradle b/photonlib-java-examples/aimandrange/build.gradle index 1ddca9753..4d0a2bd62 100644 --- a/photonlib-java-examples/aimandrange/build.gradle +++ b/photonlib-java-examples/aimandrange/build.gradle @@ -1,10 +1,12 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.2.1" + id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-1" } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} def ROBOT_MAIN_CLASS = "frc.robot.Main" @@ -13,20 +15,18 @@ repositories { } wpi.maven.useDevelopment = true -wpi.versions.wpilibVersion = "2026.2.1" -wpi.versions.wpimathVersion = "2026.2.1" +wpi.versions.wpilibVersion = "2027.0.+" - -// Define my targets (RoboRIO) and artifacts (deployable files) +// Define my targets (SystemCore) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { targets { - roborio(getTargetTypeClass('RoboRIO')) { + systemcore(getTargetTypeClass('SystemCore')) { // Team number is loaded either from the .wpilib/wpilib_preferences.json // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you // want to store a team number in this file. - team = project.frc.getTeamOrDefault(4512) + team = project.frc.getTeamOrDefault(5940) debug = project.frc.getDebugOrDefault(false) artifacts { @@ -39,8 +39,8 @@ deploy { // Static files artifact 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 + directory = '/home/systemcore/deploy' + deleteOldFiles = false // Change to true to delete files on systemcore that no // longer exist in deploy directory of this project } } @@ -48,7 +48,7 @@ deploy { } } -def deployArtifact = deploy.targets.roborio.artifacts.frcJava +def deployArtifact = deploy.targets.systemcore.artifacts.frcJava // Set to true to use debug for all targets including JNI, which will drastically impact // performance. @@ -64,11 +64,11 @@ dependencies { implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() - roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) - roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) + systemcoreDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.systemcore) + systemcoreDebug wpi.java.vendor.jniDebug(wpi.platforms.systemcore) - roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) - roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) + systemcoreRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.systemcore) + systemcoreRelease wpi.java.vendor.jniRelease(wpi.platforms.systemcore) nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) diff --git a/photonlib-java-examples/aimandrange/settings.gradle b/photonlib-java-examples/aimandrange/settings.gradle index 699b16496..64213ce87 100644 --- a/photonlib-java-examples/aimandrange/settings.gradle +++ b/photonlib-java-examples/aimandrange/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2026' + String frcYear = '2027_alpha1' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') @@ -20,8 +20,11 @@ pluginManagement { } def frcHomeMaven = new File(frcHome, 'maven') maven { - name 'frcHome' - url frcHomeMaven + name = 'frcHome' + url = frcHomeMaven } } } + +Properties props = System.getProperties(); +props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); diff --git a/photonlib-java-examples/aimattarget/build.gradle b/photonlib-java-examples/aimattarget/build.gradle index b83b3a8bc..f4401d5af 100644 --- a/photonlib-java-examples/aimattarget/build.gradle +++ b/photonlib-java-examples/aimattarget/build.gradle @@ -1,28 +1,28 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.2.1" + id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-1" } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} def ROBOT_MAIN_CLASS = "frc.robot.Main" wpi.maven.useDevelopment = true -wpi.versions.wpilibVersion = "2026.2.1" -wpi.versions.wpimathVersion = "2026.2.1" +wpi.versions.wpilibVersion = "2027.0.+" - -// Define my targets (RoboRIO) and artifacts (deployable files) +// Define my targets (SystemCore) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { targets { - roborio(getTargetTypeClass('RoboRIO')) { + systemcore(getTargetTypeClass('SystemCore')) { // Team number is loaded either from the .wpilib/wpilib_preferences.json // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you // want to store a team number in this file. - team = project.frc.getTeamOrDefault(1736) + team = project.frc.getTeamOrDefault(5940) debug = project.frc.getDebugOrDefault(false) artifacts { @@ -35,8 +35,8 @@ deploy { // Static files artifact 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 + directory = '/home/systemcore/deploy' + deleteOldFiles = false // Change to true to delete files on systemcore that no // longer exist in deploy directory of this project } } @@ -44,7 +44,7 @@ deploy { } } -def deployArtifact = deploy.targets.roborio.artifacts.frcJava +def deployArtifact = deploy.targets.systemcore.artifacts.frcJava // Set to true to use debug for all targets including JNI, which will drastically impact // performance. @@ -60,11 +60,11 @@ dependencies { implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() - roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) - roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) + systemcoreDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.systemcore) + systemcoreDebug wpi.java.vendor.jniDebug(wpi.platforms.systemcore) - roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) - roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) + systemcoreRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.systemcore) + systemcoreRelease wpi.java.vendor.jniRelease(wpi.platforms.systemcore) nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) diff --git a/photonlib-java-examples/aimattarget/settings.gradle b/photonlib-java-examples/aimattarget/settings.gradle index 699b16496..64213ce87 100644 --- a/photonlib-java-examples/aimattarget/settings.gradle +++ b/photonlib-java-examples/aimattarget/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2026' + String frcYear = '2027_alpha1' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') @@ -20,8 +20,11 @@ pluginManagement { } def frcHomeMaven = new File(frcHome, 'maven') maven { - name 'frcHome' - url frcHomeMaven + name = 'frcHome' + url = frcHomeMaven } } } + +Properties props = System.getProperties(); +props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); diff --git a/photonlib-java-examples/poseest/build.gradle b/photonlib-java-examples/poseest/build.gradle index af021b3e3..f4401d5af 100644 --- a/photonlib-java-examples/poseest/build.gradle +++ b/photonlib-java-examples/poseest/build.gradle @@ -1,28 +1,28 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.2.1" + id "edu.wpi.first.GradleRIO2027" version "2027.0.0-alpha-1" } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} def ROBOT_MAIN_CLASS = "frc.robot.Main" wpi.maven.useDevelopment = true -wpi.versions.wpilibVersion = "2026.2.1" -wpi.versions.wpimathVersion = "2026.2.1" +wpi.versions.wpilibVersion = "2027.0.+" - -// Define my targets (RoboRIO) and artifacts (deployable files) +// Define my targets (SystemCore) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { targets { - roborio(getTargetTypeClass('RoboRIO')) { + systemcore(getTargetTypeClass('SystemCore')) { // Team number is loaded either from the .wpilib/wpilib_preferences.json // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you // want to store a team number in this file. - team = project.frc.getTeamOrDefault(4512) + team = project.frc.getTeamOrDefault(5940) debug = project.frc.getDebugOrDefault(false) artifacts { @@ -35,8 +35,8 @@ deploy { // Static files artifact 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 + directory = '/home/systemcore/deploy' + deleteOldFiles = false // Change to true to delete files on systemcore that no // longer exist in deploy directory of this project } } @@ -44,7 +44,7 @@ deploy { } } -def deployArtifact = deploy.targets.roborio.artifacts.frcJava +def deployArtifact = deploy.targets.systemcore.artifacts.frcJava // Set to true to use debug for all targets including JNI, which will drastically impact // performance. @@ -60,11 +60,11 @@ dependencies { implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() - roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) - roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) + systemcoreDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.systemcore) + systemcoreDebug wpi.java.vendor.jniDebug(wpi.platforms.systemcore) - roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) - roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) + systemcoreRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.systemcore) + systemcoreRelease wpi.java.vendor.jniRelease(wpi.platforms.systemcore) nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) diff --git a/photonlib-java-examples/poseest/settings.gradle b/photonlib-java-examples/poseest/settings.gradle index 699b16496..64213ce87 100644 --- a/photonlib-java-examples/poseest/settings.gradle +++ b/photonlib-java-examples/poseest/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2026' + String frcYear = '2027_alpha1' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') @@ -20,8 +20,11 @@ pluginManagement { } def frcHomeMaven = new File(frcHome, 'maven') maven { - name 'frcHome' - url frcHomeMaven + name = 'frcHome' + url = frcHomeMaven } } } + +Properties props = System.getProperties(); +props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); diff --git a/shared/common.gradle b/shared/common.gradle index a1dd8e3bf..c13a53ef4 100644 --- a/shared/common.gradle +++ b/shared/common.gradle @@ -24,6 +24,7 @@ dependencies { implementation 'org.msgpack:jackson-dataformat-msgpack:0.9.0' implementation wpilibTools.deps.wpilibJava("wpiutil") + implementation wpilibTools.deps.wpilibJava("datalog") implementation wpilibTools.deps.wpilibJava("cameraserver") implementation wpilibTools.deps.wpilibJava("cscore") implementation wpilibTools.deps.wpilibJava("wpinet") diff --git a/shared/config.gradle b/shared/config.gradle index 07c01bd49..fbb48de0a 100644 --- a/shared/config.gradle +++ b/shared/config.gradle @@ -1,6 +1,5 @@ // Configure Native-Utils WPI Plugin nativeUtils.addWpiNativeUtils() -nativeUtils.withCrossRoboRIO() nativeUtils.withCrossLinuxArm32() nativeUtils.withCrossLinuxArm64() diff --git a/shared/javacommon.gradle b/shared/javacommon.gradle index 1b99ace63..9431f5f1f 100644 --- a/shared/javacommon.gradle +++ b/shared/javacommon.gradle @@ -134,6 +134,7 @@ dependencies { } implementation wpilibTools.deps.wpilibJava("wpiutil") + implementation wpilibTools.deps.wpilibJava("datalog") implementation wpilibTools.deps.wpilibJava("cameraserver") implementation wpilibTools.deps.wpilibJava("cscore") implementation wpilibTools.deps.wpilibJava("wpinet")