Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
name: "wpiformat"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Fetch all history and metadata
run: |
git fetch --prune --unshallow
git checkout -b pr
git branch -f main origin/main
- uses: actions/setup-python@v4
- uses: actions/setup-python@v6
with:
python-version: 3.11
python-version: 3.14
- name: Install wpiformat
run: pip3 install wpiformat==2025.79
- name: Run
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
name: "mrcal-jni - Build - ${{ matrix.arch-name }}"

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
submodules: 'true'
fetch-depth: 0
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- run: find

# Push to dev release on pushes to master
- uses: pyTooling/Actions/releaser@r0
- uses: pyTooling/Actions/releaser@r6
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: 'Dev'
Expand Down
16 changes: 0 additions & 16 deletions .wpiformat
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
cppHeaderFileInclude {
\.h$
\.hpp$
\.inc$
\.inl$
}

cppSrcFileInclude {
\.cpp$
}

modifiableFileExclude {
\.jpg$
\.jpeg$
\.png$
\.gif$
\.so$
\.dll$
\.webp$
\.ico$
gradlew
mrcal/
libdogleg/
vnlog/
Expand Down
38 changes: 9 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.24)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(mrcal_jni LANGUAGES C CXX VERSION 1.0.0)

Expand Down Expand Up @@ -62,6 +62,13 @@ set(USE_LOCKING ON)
set(USE_THREAD OFF)
set(NOFORTRAN ON)

# ARMv8 is what our coprocessors run, but not the CI machines. Ensure we don't accidentally include ARMv9 instructions
if(
CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64"
AND CMAKE_SYSTEM_NAME STREQUAL "Linux"
)
set(TARGET ARMV8)
endif()
# We need PIC for this to work as a shared library
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

Expand All @@ -83,28 +90,6 @@ if(NOT APPLE)
elseif(TARGET OpenBLAS)
set(OPENBLAS_TARGET OpenBLAS)
message(STATUS "Using OpenBLAS target")
elseif(TARGET libopenblas)
set(OPENBLAS_TARGET libopenblas)
message(STATUS "Using libopenblas target")
else()
# Fallback: find the library file manually
find_library(
OPENBLAS_LIB
NAMES openblas libopenblas
PATHS
${openblas_external_BINARY_DIR}
${openblas_external_BINARY_DIR}/lib
${openblas_external_BINARY_DIR}/lib/Release
NO_DEFAULT_PATH
REQUIRED
)
message(STATUS "Using OpenBLAS library file: ${OPENBLAS_LIB}")
add_library(openblas_imported STATIC IMPORTED)
set_target_properties(
openblas_imported
PROPERTIES IMPORTED_LOCATION ${OPENBLAS_LIB}
)
set(OPENBLAS_TARGET openblas_imported)
endif()
else()
set(BLA_VENDOR Apple)
Expand Down Expand Up @@ -142,12 +127,7 @@ else()
endif()

# And pull in JNI
find_package(JNI)
if(JNI_FOUND)
# Fixes odd AWT dependency
set(JNI_INCLUDE_DIRS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
message(STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}")
endif()
find_package(JNI REQUIRED COMPONENTS JVM)

# headers and sources
set(INCLUDE_HPP)
Expand Down
13 changes: 5 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id "java"
id 'edu.wpi.first.WpilibTools' version '1.3.0'
id 'org.photonvision.tools.WpilibTools' version '2.3.1-photon'
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
id "com.diffplug.spotless" version "6.22.0"
id "com.diffplug.spotless" version "8.1.0"
}

allprojects {
Expand All @@ -24,8 +24,8 @@ ext {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

dependencies {
Expand Down Expand Up @@ -57,10 +57,7 @@ test {
useJUnitPlatform()
}

ext.nativeName = wpilibTools.platformMapper.wpilibClassifier
.replace('windows', 'windows/')
.replace('osx', 'osx/')
.replace('linux', 'linux/')
def nativeName = wpilibTools.platformMapper.platformPath
ext.outputsFolder = file("$buildDir/outputs")

println("Building for $nativeName")
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=permwrapper/dists
zipStorePath=wrapper/dists
12 changes: 7 additions & 5 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ publishing {
mavenJava(MavenPublication) {
groupId = artifactGroupId
artifactId = "${baseArtifactId}-java"
version = pubVersion;// + "-" + nativeName;
version = pubVersion;

from components.java
}
mavenJNI(MavenPublication) {
groupId = artifactGroupId
artifactId = "${baseArtifactId}-jni"
version = pubVersion;// + "-" + nativeName;
version = pubVersion;

artifact nativeLibraryJar
}
Expand Down
11 changes: 11 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pluginManagement {
repositories {
maven { url = "https://frcmaven.wpi.edu/artifactory/ex-mvn/" }
mavenCentral()
gradlePluginPortal()
maven {
url = uri('https://maven.photonvision.org/releases')
}
mavenLocal()
}
}