Skip to content

Commit

Permalink
Merge pull request #19 from REVrobotics/2025
Browse files Browse the repository at this point in the history
Update for 2025
  • Loading branch information
jfabellera authored Jan 13, 2025
2 parents 1dd11eb + 54dc94f commit d7ae1b9
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 113 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
2 changes: 2 additions & 0 deletions LabVIEW/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/*.lvlps
/*.aliases
2 changes: 0 additions & 2 deletions LabVIEW/2m Distance Sensor/2m Distance Sensor.aliases

This file was deleted.

10 changes: 0 additions & 10 deletions LabVIEW/2m Distance Sensor/2m Distance Sensor.lvlps

This file was deleted.

11 changes: 5 additions & 6 deletions LabVIEW/2m Distance Sensor/2m Distance Sensor.lvproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</Property>
<Property Name="NIPKG_installerBuiltBefore" Type="Bool">true</Property>
<Property Name="NIPKG_installerDestination" Type="Path">/C/Users/Public/Documents/REV2m-LabVIEW/builds/Installer</Property>
<Property Name="NIPKG_lastBuiltPackage" Type="Str">2m-distance-sensor_2024.0.4-0_windows_all.nipkg</Property>
<Property Name="NIPKG_lastBuiltPackage" Type="Str">2m-distance-sensor_2025.0.0-0_windows_all.nipkg</Property>
<Property Name="NIPKG_license" Type="Ref"></Property>
<Property Name="NIPKG_packageVersion" Type="Bool">false</Property>
<Property Name="NIPKG_releaseNotes" Type="Str"></Property>
Expand All @@ -56,7 +56,7 @@
<Property Name="PKG_dependencies[0].Enhanced" Type="Bool">false</Property>
<Property Name="PKG_dependencies[0].MaxVersion" Type="Str"></Property>
<Property Name="PKG_dependencies[0].MaxVersionInclusive" Type="Bool">false</Property>
<Property Name="PKG_dependencies[0].MinVersion" Type="Str">23.3.0.49272-0+f120</Property>
<Property Name="PKG_dependencies[0].MinVersion" Type="Str">23.3.5.49154-0+f2</Property>
<Property Name="PKG_dependencies[0].MinVersionType" Type="Str">Inclusive</Property>
<Property Name="PKG_dependencies[0].NIPKG.DisplayName" Type="Str">LabVIEW Runtime (32-bit)</Property>
<Property Name="PKG_dependencies[0].Package.Name" Type="Str">ni-labview-2023-runtime-engine-x86</Property>
Expand Down Expand Up @@ -107,7 +107,7 @@
<Property Name="PKG_sources[0].ID" Type="Ref">/My Computer/Build Specifications/WPILib Third-Party</Property>
<Property Name="PKG_sources[0].Type" Type="Str">Build</Property>
<Property Name="PKG_synopsis" Type="Str">REV 2m Distance Sensor LabVIEW API</Property>
<Property Name="PKG_version" Type="Str">2024.0.4</Property>
<Property Name="PKG_version" Type="Str">2025.0.0</Property>
</Item>
<Item Name="WPILib Third-Party" Type="Source Distribution">
<Property Name="Bld_buildCacheID" Type="Str">{7C52C9E8-1805-4972-9778-4F7F5AEE00E3}</Property>
Expand All @@ -126,8 +126,7 @@
<Property Name="Bld_localDestDir" Type="Path">/C/Users/Public/Documents/REV2m-LabVIEW/WPILib/ThirdParty</Property>
<Property Name="Bld_previewCacheID" Type="Str">{BD7521DF-B566-4760-9656-AE8025F6DCEB}</Property>
<Property Name="Bld_removeVIObj" Type="Int">1</Property>
<Property Name="Bld_version.major" Type="Int">2024</Property>
<Property Name="Bld_version.patch" Type="Int">4</Property>
<Property Name="Bld_version.major" Type="Int">2025</Property>
<Property Name="Destination[0].destName" Type="Str">Destination Directory</Property>
<Property Name="Destination[0].path" Type="Path">/C/Users/Public/Documents/REV2m-LabVIEW/WPILib/ThirdParty</Property>
<Property Name="Destination[0].path.type" Type="Str">&lt;none&gt;</Property>
Expand All @@ -151,7 +150,7 @@
<Property Name="Destination[6].path" Type="Path">/C/Users/Public/Documents/REV2m-LabVIEW/WPILib/ThirdParty/REV Robotics/NI_AB_PROJECTNAME</Property>
<Property Name="Destination[6].path.type" Type="Str">&lt;none&gt;</Property>
<Property Name="DestinationCount" Type="Int">7</Property>
<Property Name="Source[0].itemID" Type="Str">{D5C36313-3364-4D5F-9F59-1895B940C622}</Property>
<Property Name="Source[0].itemID" Type="Str">{DC5DF021-9B2F-4FF5-8781-0A6280263A68}</Property>
<Property Name="Source[0].type" Type="Str">Container</Property>
<Property Name="Source[1].Container.applyDestination" Type="Bool">true</Property>
<Property Name="Source[1].Container.applyInclusion" Type="Bool">true</Property>
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ roboRIO library for the [REV Robotics 2M Distance Sensor](http://www.revrobotics
Download the latest `REV-2m-Distance-Sensor-roboRIO-SDK-[version].zip` from the [release](https://github.com/REVrobotics/2m-Distance-Sensor/releases) tab and unzip it.

Inside `REV-2m-Distance-Sensor-roboRIO-SDK-[version]` there will be vendordeps and maven folders. Copy the file `REV2mDistanceSensor.json` under vendordeps to the frc vendordeps folder on your machine. It is typically located in the following places:
* Windows: C:\Users\Public\wpilib\2024\vendordeps
* Mac/Linux: ~/wpilib/2024/vendordeps
* Windows: C:\Users\Public\wpilib\2025\vendordeps
* Mac/Linux: ~/wpilib/2025/vendordeps

Next, merge the maven folder with the frc maven folder on your machine, typically located at:
* Windows: C:\Users\Public\wpilib\2024\maven
* Mac/Linux: ~/wpilib/2024/maven
* Windows: C:\Users\Public\wpilib\2025\maven
* Mac/Linux: ~/wpilib/2025/maven

In order to use these libraries in your robot code, open a project in VsCode.
* Press `Ctrl-Shift-P` to open the WPI commands window.
Expand Down
12 changes: 8 additions & 4 deletions Source/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'cpp'
id 'java'
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2020.2'
id 'edu.wpi.first.NativeUtils' version '2024.6.1'
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2025.0'
id 'edu.wpi.first.NativeUtils' version '2025.9.0'
id 'edu.wpi.first.GradleJni' version '1.1.0'
id 'edu.wpi.first.GradleVsCode' version '2.1.0'
id 'google-test-test-suite'
Expand Down Expand Up @@ -83,11 +83,15 @@ model {
}

javadoc {
options.addBooleanOption('-no-module-directories', true)
options {
// Just configuring links to WPILib docs also sets up links to the appropriate version of
// the JDK docs. Things broke when Harper tried to directly configure both.
addStringOption("link", "https://github.wpilib.org/allwpilib/docs/release/java/")
}
}

apply from: 'publish.gradle'

wrapper {
gradleVersion = '7.5.1'
gradleVersion = '8.11'
}
27 changes: 27 additions & 0 deletions Source/build_and_publish_locally.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/bash
set -e

LIB=DistanceSensor
BUILD_YEAR=2025
VENDOR_GENERATED_DIR=./vendordeps/*
BUILD_REPO_DIR=./build/repos
RELEASE_DIR=$BUILD_REPO_DIR/releases/com/revrobotics/frc
MOVE_DIR=C:/Users/Public/wpilib/$BUILD_YEAR/maven/com/revrobotics/frc
VENDOR_DIR=C:/Users/Public/wpilib/$BUILD_YEAR/vendordeps

echo "*** Building ***"
./gradlew build -PreleaseMode

echo "*** Generating maven directories ***"
./gradlew publish -PreleaseMode

echo "*** Ensuring destination maven directories exist ***"
mkdir -p $MOVE_DIR

echo "*** Moving maven directories ***"
cp -r $RELEASE_DIR/$LIB-cpp $MOVE_DIR
cp -r $RELEASE_DIR/$LIB-driver $MOVE_DIR
cp -r $RELEASE_DIR/$LIB-java $MOVE_DIR

echo "*** Moving vendor deps ***"
cp -r $VENDOR_GENERATED_DIR $VENDOR_DIR
21 changes: 11 additions & 10 deletions Source/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ nativeUtils.withCrossRoboRIO()
nativeUtils {
wpi {
configureDependencies {
wpiVersion = "2024.+"
opencvYear = "frc2024"
googleTestYear = "frc2024"
niLibVersion = "2024.2.1"
opencvVersion = "4.8.0-2"
googleTestVersion = "1.14.0-1"
wpiVersion = "2025.+"
opencvYear = "frc2025"
niLibVersion = "2025.0.0"
opencvVersion = "4.10.0-2"
wpimathVersion = "2024.+"
googleTestYear = "frc2024"
googleTestVersion = "1.14.0-1"
}
}
}
Expand Down Expand Up @@ -92,7 +93,7 @@ ext.createComponentZipTasks = { components, names, base, type, project, func ->
def task = project.tasks.create(base + "-${key}", type) {
description = 'Creates component archive for platform ' + key
destinationDirectory = outputsFolder
classifier = key
archiveClassifier = key
archiveBaseName = '_M_' + base
duplicatesStrategy = 'exclude'

Expand All @@ -119,9 +120,9 @@ ext.createAllCombined = { list, name, base, type, project ->

def task = project.tasks.create(base + "-all", type) {
description = "Creates component archive for all classifiers"
destinationDir = outputsFolder
classifier = "all"
baseName = base
destinationDirectory = outputsFolder
archiveClassifier = "all"
archiveBaseName = base
duplicatesStrategy = 'exclude'

list.each {
Expand Down
18 changes: 9 additions & 9 deletions Source/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
dependencies {
implementation 'edu.wpi.first.cscore:cscore-java:2024.+'
implementation 'edu.wpi.first.cameraserver:cameraserver-java:2024.+'
implementation 'edu.wpi.first.ntcore:ntcore-java:2024.+'
implementation 'edu.wpi.first.wpilibj:wpilibj-java:2024.+'
implementation 'edu.wpi.first.wpiutil:wpiutil-java:2024.+'
implementation 'edu.wpi.first.wpimath:wpimath-java:2024.+'
implementation 'edu.wpi.first.wpiunits:wpiunits-java:2024.+'
implementation 'edu.wpi.first.hal:hal-java:2024.+'
implementation 'edu.wpi.first.cscore:cscore-java:2025.+'
implementation 'edu.wpi.first.cameraserver:cameraserver-java:2025.+'
implementation 'edu.wpi.first.ntcore:ntcore-java:2025.+'
implementation 'edu.wpi.first.wpilibj:wpilibj-java:2025.+'
implementation 'edu.wpi.first.wpiutil:wpiutil-java:2025.+'
implementation 'edu.wpi.first.wpimath:wpimath-java:2025.+'
implementation 'edu.wpi.first.wpiunits:wpiunits-java:2025.+'
implementation 'edu.wpi.first.hal:hal-java:2025.+'
implementation "org.ejml:ejml-simple:0.43.1"
implementation "com.fasterxml.jackson.core:jackson-annotations:2.12.4"
implementation "com.fasterxml.jackson.core:jackson-core:2.12.4"
implementation "com.fasterxml.jackson.core:jackson-databind:2.12.4"
implementation 'edu.wpi.first.thirdparty.frc2024.opencv:opencv-java:4.8.0-2'
implementation 'edu.wpi.first.thirdparty.frc2025.opencv:opencv-java:4.10.0-2'
testImplementation(platform('org.junit:junit-bom:5.7.0'))
testImplementation('org.junit.jupiter:junit-jupiter')
}
Binary file modified Source/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion Source/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
38 changes: 25 additions & 13 deletions Source/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -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/.
Expand All @@ -80,13 +82,12 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# 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
Expand Down Expand Up @@ -133,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
Expand Down Expand Up @@ -193,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" \
Expand Down
23 changes: 13 additions & 10 deletions Source/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##########################################################################
Expand All @@ -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%

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

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

Expand Down
Loading

0 comments on commit d7ae1b9

Please sign in to comment.