Skip to content

Commit

Permalink
Fix PhotonLib gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
srimanachanta committed Oct 23, 2023
1 parent 7e8c3d4 commit edf26e9
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions photon-lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id "java"
id 'cpp'
id "google-test-test-suite"
id 'edu.wpi.first.WpilibTools' version '1.3.0'
}

import java.nio.file.Path

apply plugin: "cpp"
apply plugin: "java"
apply plugin: "google-test-test-suite"
apply plugin: "edu.wpi.first.NativeUtils"

apply from: "${rootDir}/shared/config.gradle"
Expand All @@ -16,20 +16,14 @@ test {
useJUnitPlatform()
}

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

wpilibTools.deps.wpilibVersion = wpilibVersion
wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get()
println("Building for WPILib ${wpilibTools.deps.wpilibVersion}")

// From wpilib shared/config.gradle:
// NativeUtils adds the following OpenCV warning suppression for Linux, but not
// for macOS
// https://github.com/opencv/opencv/issues/20269
nativeUtils.platformConfigs.osxuniversal.cppCompiler.args.add("-Wno-deprecated-anon-enum-enum-conversion")
nativeUtils.platformConfigs.linuxathena.cppCompiler.args.add("-Wno-deprecated-anon-enum-enum-conversion")
// nativeUtils.platformConfigs.linuxx64.cppCompiler.args.add("-Wno-deprecated-anon-enum-enum-conversion")

// Apply Java configuration
dependencies {
implementation project(":photon-targeting")
Expand All @@ -44,16 +38,15 @@ dependencies {
implementation wpilibTools.deps.wpilibJava("ntcore")
implementation wpilibTools.deps.wpilibJava("wpilibj")
implementation wpilibTools.deps.wpilibJava("apriltag")
implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())

// Jackson
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:$openCVversion"
implementation "edu.wpi.first.thirdparty.frc2024.opencv:opencv-jni:$openCVversion:$jniPlatform"
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()
implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: wpi.versions.jacksonVersion.get()

implementation "org.ejml:ejml-simple:0.42"
implementation group: "org.ejml", name: "ejml-simple", version: wpi.versions.ejmlVersion.get()
implementation group: "us.hebi.quickbuf", name: "quickbuf-runtime", version: wpi.versions.quickbufVersion.get();

// Junit
testImplementation wpilibTools.deps.wpilibJava("cscore")
Expand Down Expand Up @@ -167,10 +160,10 @@ def testNativeTasks = wpilibTools.createExtractionTasks {

testNativeTasks.addToSourceSetResources(sourceSets.test)

testNativeConfig.dependencies.add wpilibTools.deps.cscore()
testNativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
testNativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
testNativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet")
testNativeConfig.dependencies.add wpilibTools.deps.wpilib("hal")
testNativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil")
testNativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath")
testNativeConfig.dependencies.add wpilibTools.deps.cscore()
testNativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())

0 comments on commit edf26e9

Please sign in to comment.