diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb4baaf..b8d4506 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,9 +17,9 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-22.04 + - os: ubuntu-24.04 arch-name: linuxx86-64 - - os: ubuntu-22.04-arm + - os: ubuntu-24.04-arm arch-name: linuxarm64 - os: windows-latest arch-name: windowsx86-64 @@ -41,10 +41,9 @@ jobs: run: git fetch --tags --force - run: git describe --tags - - name: Install Java 17 - uses: actions/setup-java@v5 + - uses: actions/setup-java@v5 with: - java-version: 17 + java-version: 25 distribution: temurin - name: Install deps (Linux) @@ -74,16 +73,16 @@ jobs: name: Publish env: ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} - if: github.event_name == 'push' + if: github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v') - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v7 with: name: libmrcal-jar-${{ matrix.arch-name }} path: ${{ github.workspace }}/build/libs/*.jar release: needs: build-host - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: # Download literally every single artifact. This also downloads client and docs, # but the filtering below won't pick these up (I hope) diff --git a/CMakeLists.txt b/CMakeLists.txt index 55e35a6..08ef020 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,9 +20,8 @@ include(FetchContent) # OpenCV configuration # Keep this in sync with build.gradle and with # https://github.com/PhotonVision/photonvision/blob/main/build.gradle -set(OPENCV_YEAR "frc2025") -set(OPENCV_VERSION "4.10.0-3") -set(WPIMATH_VERSION "2026.2.1") +set(OPENCV_VERSION "2027-4.13.0-3") +set(WPIMATH_VERSION "2027.0.0-alpha-5") # type can be "", "debug", "static", or "staticdebug" set(OPENCV_TYPE "") @@ -32,7 +31,7 @@ message(STATUS "Using FRC OpenCV for architecture: ${OPENCV_ARCH}") FetchContent_Declare( opencv_lib URL - https://frcmaven.wpi.edu/artifactory/release/edu/wpi/first/thirdparty/${OPENCV_YEAR}/opencv/opencv-cpp/${OPENCV_VERSION}/opencv-cpp-${OPENCV_VERSION}-${OPENCV_ARCH}${OPENCV_TYPE}.zip + https://frcmaven.wpi.edu/artifactory/release/org/wpilib/thirdparty/opencv/opencv-cpp/${OPENCV_VERSION}/opencv-cpp-${OPENCV_VERSION}-${OPENCV_ARCH}${OPENCV_TYPE}.zip ) FetchContent_MakeAvailable(opencv_lib) @@ -40,7 +39,7 @@ FetchContent_MakeAvailable(opencv_lib) FetchContent_Declare( opencv_header URL - https://frcmaven.wpi.edu/artifactory/release/edu/wpi/first/thirdparty/${OPENCV_YEAR}/opencv/opencv-cpp/${OPENCV_VERSION}/opencv-cpp-${OPENCV_VERSION}-headers.zip + https://frcmaven.wpi.edu/artifactory/release/org/wpilib/thirdparty/opencv/opencv-cpp/${OPENCV_VERSION}/opencv-cpp-${OPENCV_VERSION}-headers.zip ) FetchContent_MakeAvailable(opencv_header) @@ -58,7 +57,7 @@ message(STATUS "Using FRC OpenCV libraries: ${OPENCV_LIB_PATH}") FetchContent_Declare( wpimath_header URL - https://frcmaven.wpi.edu/artifactory/release/edu/wpi/first/wpimath/wpimath-cpp/${WPIMATH_VERSION}/wpimath-cpp-${WPIMATH_VERSION}-headers.zip + https://frcmaven.wpi.edu/artifactory/release-2027/org/wpilib/wpimath/wpimath-cpp/${WPIMATH_VERSION}/wpimath-cpp-${WPIMATH_VERSION}-headers.zip ) FetchContent_MakeAvailable(wpimath_header) set(WPIMATH_INCLUDE_PATH ${wpimath_header_SOURCE_DIR}) diff --git a/build.gradle b/build.gradle index 4827b2c..29e5e17 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id "java" - id 'org.photonvision.tools.WpilibTools' version '2.3.1-photon' - id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2" + id 'org.photonvision.tools.WpilibTools' version '3.1.0-photon' + id "org.wpilib.WPILibRepositoriesPlugin" version "2027.0.0" id "com.diffplug.spotless" version "8.1.0" } @@ -11,6 +11,7 @@ allprojects { mavenLocal() maven { url = "https://maven.photonvision.org/repository/internal/" } } + wpilibRepositories.use2027Repos() wpilibRepositories.addAllReleaseRepositories(it) wpilibRepositories.addAllDevelopmentRepositories(it) } @@ -24,12 +25,14 @@ ext { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_25 + targetCompatibility = JavaVersion.VERSION_25 } +wpilibTools.deps.wpilibVersion = "2027.0.0-alpha-5" + dependencies { - implementation wpilibTools.deps.wpilibOpenCvJava("frc2025", "4.10.0-3") + implementation wpilibTools.deps.wpilibOpenCvJava("2027-4.13.0-3") // Junit testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1' @@ -37,6 +40,7 @@ dependencies { implementation wpilibTools.deps.wpilibJava("wpimath") implementation wpilibTools.deps.wpilibJava("wpiunits") + // This is included for protobuf support implementation wpilibTools.deps.wpilibJava("wpiutil") implementation "com.fasterxml.jackson.core:jackson-annotations:2.15.2" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d4081da..bad7c24 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/org/photonvision/mrcal/MrCalJNI.java b/src/main/java/org/photonvision/mrcal/MrCalJNI.java index 16dcf40..f5bd7c8 100644 --- a/src/main/java/org/photonvision/mrcal/MrCalJNI.java +++ b/src/main/java/org/photonvision/mrcal/MrCalJNI.java @@ -17,15 +17,15 @@ package org.photonvision.mrcal; -import edu.wpi.first.math.VecBuilder; -import edu.wpi.first.math.geometry.Pose3d; -import edu.wpi.first.math.geometry.Rotation3d; -import edu.wpi.first.math.geometry.Translation3d; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.opencv.core.MatOfFloat; import org.opencv.core.MatOfPoint2f; +import org.wpilib.math.geometry.Pose3d; +import org.wpilib.math.geometry.Rotation3d; +import org.wpilib.math.geometry.Translation3d; +import org.wpilib.math.linalg.VecBuilder; public class MrCalJNI { public static enum CameraLensModel { diff --git a/versioningHelper.gradle b/versioningHelper.gradle index e9dd6e3..208cc43 100644 --- a/versioningHelper.gradle +++ b/versioningHelper.gradle @@ -2,41 +2,35 @@ import java.nio.file.Path import java.time.LocalDateTime import java.time.format.DateTimeFormatter -gradle.allprojects { - ext.getCurrentVersion = { - -> - def stdout = new ByteArrayOutputStream() - String tagIsh - try { - exec { - commandLine 'git', 'describe', '--tags', "--match=v*" - standardOutput = stdout - } - tagIsh = stdout.toString().trim().toLowerCase() - } catch (Exception e) { - tagIsh = "dev-Unknown" - } - - // Dev tags: v2021.1.6-3-gf922466d - // We're specifically looking to capture the middle -3- - boolean isDev = tagIsh.matches(".*-[0-9]*-g[0-9a-f]*") - if (isDev && !tagIsh.startsWith("dev-")) tagIsh = "dev-" + tagIsh - println("Picked up version: " + tagIsh) - return tagIsh +ext.getCurrentVersion = { + String tagIsh = "dev-unknown" + try { + tagIsh = providers.exec { + commandLine 'git', 'describe', '--tags', '--match=v*' + }.standardOutput.asText.get().trim().toLowerCase() + } catch (Exception ignored) { + tagIsh = "dev-unknown" } - if (!ext.has("versionString")) { - ext.versionString = getCurrentVersion() - } + // Dev tags: v2021.1.6-3-gf922466d + // We're specifically looking to capture the middle -3- + boolean isDev = tagIsh.matches(".*-[0-9]*-g[0-9a-f]*") + if (isDev && !tagIsh.startsWith("dev-")) tagIsh = "dev-" + tagIsh + println("Picked up version: " + tagIsh) + return tagIsh +} - ext.writePhotonVersionFile = {File versionFileIn, Path path, String version -> - println("Writing " + version + " to " + path.toAbsolutePath().toString()) - String date = DateTimeFormatter.ofPattern("yyyy-M-d hh:mm:ss").format(LocalDateTime.now()) - File versionFileOut = new File(path.toAbsolutePath().toString()) - versionFileOut.delete() - def read = versionFileIn.text.replace('${version}', version).replace('${date}', date) - if (!versionFileOut.parentFile.exists()) versionFileOut.parentFile.mkdirs() - if (!versionFileOut.exists()) versionFileOut.createNewFile() - versionFileOut.write(read) - } +if (!ext.has("versionString")) { + ext.versionString = getCurrentVersion() +} + +ext.writePhotonVersionFile = {File versionFileIn, Path path, String version -> + println("Writing " + version + " to " + path.toAbsolutePath().toString()) + String date = DateTimeFormatter.ofPattern("yyyy-M-d hh:mm:ss").format(LocalDateTime.now()) + File versionFileOut = new File(path.toAbsolutePath().toString()) + versionFileOut.delete() + def read = versionFileIn.text.replace('${version}', version).replace('${date}', date) + if (!versionFileOut.parentFile.exists()) versionFileOut.parentFile.mkdirs() + if (!versionFileOut.exists()) versionFileOut.createNewFile() + versionFileOut.write(read) }