Files
PhotonVision/shared/common.gradle
Alan Everett 0525e762b4 Switch from FasterXML Jackson to Avaje Jsonb (#2503)
## Description

WPILib switched from FasterXML Jackson to Avaje Jsonb for speed reasons
in https://github.com/wpilibsuite/allwpilib/pull/8721. This does the
same for PhotonVision. Some temporary Jackson adapters are present to
allow compatibility with alpha-4 ahead of updating Photon's WPILib
version. A few old backwards compatibility migrations were also dropped
if they were difficult to port to Avaje Jsonb or otherwise complicated
the code.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_, including events
that led to this PR
- [ ] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with all settings going back to the previous seasons's last release
(seasons end after champs ends)
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
- [ ] If this PR adds a dependency, the license has been checked for
compatibility and steps taken to follow it

---------

Co-authored-by: samfreund <samf.236@proton.me>
Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
2026-05-24 17:05:10 +00:00

90 lines
3.2 KiB
Groovy

// Plugins
apply plugin: "java"
apply plugin: "jacoco"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
wpilibTools.deps.wpilibVersion = wpilibVersion
dependencies {
implementation project(':photon-targeting')
implementation "io.javalin:javalin:$javalinVersion"
implementation "org.msgpack:msgpack-core:$msgpackVersion"
implementation "org.msgpack:jackson-dataformat-msgpack:$msgpackVersion"
implementation "org.wpilib.wpiutil:wpiutil-java:$wpilibVersion"
implementation "org.wpilib.datalog:datalog-java:$wpilibVersion"
implementation "org.wpilib.cameraserver:cameraserver-java:$wpilibVersion"
implementation "org.wpilib.cscore:cscore-java:$wpilibVersion"
implementation "org.wpilib.wpinet:wpinet-java:$wpilibVersion"
implementation "org.wpilib.wpimath:wpimath-java:$wpilibVersion"
implementation "org.wpilib.ntcore:ntcore-java:$wpilibVersion"
implementation "org.wpilib.hal:hal-java:$wpilibVersion"
implementation "org.wpilib.wpilibj:wpilibj-java:$wpilibVersion"
implementation "org.wpilib.apriltag:apriltag-java:$wpilibVersion"
implementation "org.wpilib.wpiunits:wpiunits-java:$wpilibVersion"
implementation wpilibTools.deps.wpilibOpenCvJava("frc" + openCVYear, openCVversion)
implementation group: "com.fasterxml.jackson.core", name: "jackson-core", version: jacksonVersion
implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: jacksonVersion
implementation group: "io.avaje", name: "avaje-jsonb", version: avajeJsonbVersion
annotationProcessor group: "io.avaje", name: "avaje-jsonb-generator", version: avajeJsonbVersion
implementation group: "io.avaje", name: "avaje-jsonb-jackson", version: avajeJsonbVersion
implementation group: "org.ejml", name: "ejml-simple", version: ejmlVersion
implementation group: "us.hebi.quickbuf", name: "quickbuf-runtime", version: quickbufVersion;
implementation "commons-io:commons-io:2.11.0"
implementation "commons-cli:commons-cli:1.5.0"
testImplementation(platform('org.junit:junit-bom:5.11.4'))
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
test {
useJUnitPlatform()
systemProperty("java.awt.headless", !project.hasProperty("enableTestUi"))
systemProperty 'jsonb.disableAdapterSpi', 'true'
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat = "full"
showStandardStreams = true
}
workingDir = new File("${rootDir}")
finalizedBy jacocoTestReport
}
jacoco {
toolVersion = jacocoVersion
reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir')
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: "edu/wpi/**"
)
}))
}
}