Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PhotonVision/thirdparty-opencv #1450

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
11 changes: 10 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ apply from: "versioningHelper.gradle"
ext {
wpilibVersion = "2024.3.2"
wpimathVersion = wpilibVersion
openCVversion = "4.8.0-2"
openCVversion = "4.8.0-4"
photonlib_openCVversion = "4.8.0-5"
joglVersion = "2.4.0"
javalinVersion = "5.6.2"
libcameraDriverVersion = "dev-v2023.1.0-14-g787ab59"
Expand Down Expand Up @@ -63,6 +64,14 @@ ext {
println("Publishing Photonlib to " + photonMavenURL)
}

Dependency photonOpenCvJava(String frcYear, String version) {
return project.getDependencies().create("org.photonvision.thirdparty." + frcYear + ".opencv:opencv-java:" + version);
}

Dependency photonOpenCv(String frcYear, String version) {
return project.getDependencies().create("org.photonvision.thirdparty." + frcYear + ".opencv:opencv-cpp:" + version + ":" + jniPlatform + "@zip");
}

spotless {
java {
target fileTree('.') {
Expand Down
2 changes: 1 addition & 1 deletion photon-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal")
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
nativeConfig.dependencies.add photonOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())

dependencies {
// JOGL stuff (currently we only distribute for aarch64, which is Pi 4)
Expand Down
6 changes: 6 additions & 0 deletions photon-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ apply plugin: 'google-test-test-suite'
apply plugin: 'edu.wpi.first.NativeUtils'

apply from: "${rootDir}/shared/config.gradle"
// reset the opencv version again lol
nativeUtils.wpi.configureDependencies {
opencvVersion = photonlib_openCVversion
}
wpi.getVersions().getOpencvVersion().convention(photonlib_openCVversion);

apply from: "${rootDir}/shared/javacommon.gradle"

apply from: "${rootDir}/versioningHelper.gradle"
Expand Down
2 changes: 1 addition & 1 deletion shared/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
implementation wpilibTools.deps.wpilibJava("wpilibj")
implementation wpilibTools.deps.wpilibJava("apriltag")
implementation wpilibTools.deps.wpilibJava("wpiunits")
implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
implementation photonOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())

implementation group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: wpi.versions.jacksonVersion.get()
implementation group: "com.fasterxml.jackson.core", name: "jackson-core", version: wpi.versions.jacksonVersion.get()
Expand Down
7 changes: 6 additions & 1 deletion shared/javacommon.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ dependencies {
implementation wpilibTools.deps.wpilibJava("wpilibj")
implementation wpilibTools.deps.wpilibJava("apriltag")
implementation wpilibTools.deps.wpilibJava("wpiunits")
implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
if (project.name == "photon-lib") {
println "Depending on wpilib opencv version " + wpi.versions.opencvVersion.get()
implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
} else {
implementation photonOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
}

implementation group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: wpi.versions.jacksonVersion.get()
implementation group: "com.fasterxml.jackson.core", name: "jackson-core", version: wpi.versions.jacksonVersion.get()
Expand Down
2 changes: 1 addition & 1 deletion shared/javacpp/setupBuild.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag")
nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal")
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
nativeConfig.dependencies.add photonOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())

// Windows specific functionality to export all symbols from a binary automatically
nativeUtils {
Expand Down
Loading