Skip to content

Commit

Permalink
Use photonvision/thirdparty opencv
Browse files Browse the repository at this point in the history
  • Loading branch information
Alextopher committed Oct 9, 2024
1 parent c4b273e commit dbee768
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ apply from: "versioningHelper.gradle"
ext {
wpilibVersion = "2024.3.2"
wpimathVersion = wpilibVersion
openCVversion = "4.8.0-2"
openCVversion = "4.8.0-4"
joglVersion = "2.4.0"
javalinVersion = "5.6.2"
libcameraDriverVersion = "dev-v2023.1.0-14-g787ab59"
Expand Down Expand Up @@ -63,6 +63,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
2 changes: 1 addition & 1 deletion photon-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,4 @@ 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())
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
2 changes: 1 addition & 1 deletion shared/javacommon.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,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
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

0 comments on commit dbee768

Please sign in to comment.