Files
PhotonVision/shared/common.gradle
2021-12-18 12:53:08 -05:00

80 lines
2.5 KiB
Groovy

import java.nio.file.Path
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
// Plugins
apply plugin: "jacoco"
apply plugin: "java"
sourceCompatibility = 11
dependencies {
// Jackson
implementation "com.fasterxml.jackson.core:jackson-annotations:2.10.0"
implementation "com.fasterxml.jackson.core:jackson-core:2.10.0"
implementation "com.fasterxml.jackson.core:jackson-databind:2.10.0"
// Apache commons
implementation group: "org.apache.commons", name: "commons-lang3", version: "3.9"
implementation group: "commons-io", name: "commons-io", version: "2.6"
implementation group: "commons-cli", name: "commons-cli", version: "1.4"
implementation "org.apache.commons:commons-collections4:4.4"
implementation "org.apache.commons:commons-exec:1.3"
// WPILib deps
implementation "edu.wpi.first.wpiutil:wpiutil-java:$wpilibVersion"
implementation "edu.wpi.first.cameraserver:cameraserver-java:$wpilibVersion"
implementation "edu.wpi.first.cscore:cscore-java:$wpilibVersion"
jniPlatforms.each { implementation "edu.wpi.first.cscore:cscore-jni:$wpilibVersion:$it" }
implementation "edu.wpi.first.ntcore:ntcore-java:$wpilibVersion"
jniPlatforms.each { implementation "edu.wpi.first.ntcore:ntcore-jni:$wpilibVersion:$it" }
implementation "edu.wpi.first.thirdparty.frc2022.opencv:opencv-java:$opencvVersion"
jniPlatforms.each { implementation "edu.wpi.first.thirdparty.frc2022.opencv:opencv-jni:$opencvVersion:$it" }
implementation "edu.wpi.first.wpimath:wpimath-java:2022.1.1-beta-2"
implementation "org.ejml:ejml-simple:0.41"
// test stuff
testImplementation("org.junit.jupiter:junit-jupiter:5.6.0")
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
workingDir = new File("${rootDir}")
}
task testHeadless(type: Test) {
group = "verification"
systemProperty("java.awt.headless", "true")
useJUnitPlatform()
exclude '**/*BenchmarkTest*'
}
task generateJavaDocs(type: Javadoc) {
source = sourceSets.main.allJava
classpath = sourceSets.main.compileClasspath
destinationDir = file("${projectDir}/build/docs")
}
jacocoTestReport {
// dependsOn testHeadless // Tests are required to run before generating the report
reports {
xml.enabled true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: "edu/wpi/**"
)
}))
}
}