mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Given that WPILib is nuking their Java tooling, it becomes necessary to pull said tooling into PV itself. This migrates the CombinedRuntimeLoader into PV, which should finalize all of the tooling migration.
118 lines
3.5 KiB
Groovy
118 lines
3.5 KiB
Groovy
import edu.wpi.first.toolchain.*
|
|
|
|
plugins {
|
|
id "cpp"
|
|
id "com.diffplug.spotless" version "8.1.0"
|
|
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
|
|
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
|
id 'org.photonvision.tools.WpilibTools' version '2.3.3-photon'
|
|
id 'com.google.protobuf' version '0.9.3' apply false
|
|
id 'edu.wpi.first.GradleJni' version '1.1.0'
|
|
id "org.ysb33r.doxygen" version "2.0.0" apply false
|
|
id 'com.gradleup.shadow' version '8.3.4' apply false
|
|
id "com.github.node-gradle.node" version "7.0.1" apply false
|
|
}
|
|
|
|
allprojects {
|
|
repositories {
|
|
maven { url = "https://frcmaven.wpi.edu/artifactory/ex-mvn/" }
|
|
mavenCentral()
|
|
mavenLocal()
|
|
maven { url = "https://maven.photonvision.org/releases" }
|
|
maven { url = "https://maven.photonvision.org/snapshots" }
|
|
}
|
|
wpilibRepositories.addAllReleaseRepositories(it)
|
|
wpilibRepositories.addAllDevelopmentRepositories(it)
|
|
}
|
|
|
|
ext.localMavenURL = file("$project.buildDir/outputs/maven")
|
|
ext.allOutputsFolder = file("$project.buildDir/outputs")
|
|
|
|
// Configure the version number.
|
|
apply from: "versioningHelper.gradle"
|
|
|
|
ext {
|
|
wpilibVersion = "2026.2.1"
|
|
wpimathVersion = wpilibVersion
|
|
openCVYear = "2025"
|
|
openCVversion = "4.10.0-3"
|
|
javalinVersion = "6.7.0"
|
|
libcameraDriverVersion = "v2026.0.0"
|
|
rknnVersion = "v2026.0.1"
|
|
rubikVersion = "v2026.0.1"
|
|
frcYear = "2026"
|
|
mrcalVersion = "v2026.0.0";
|
|
|
|
pubVersion = versionString
|
|
isDev = pubVersion.startsWith("dev")
|
|
|
|
wpilibNativeName = wpilibTools.platformMapper.currentPlatform.platformName;
|
|
jniPlatform = wpilibTools.platformMapper.wpilibClassifier;
|
|
|
|
println("Building for platform " + jniPlatform + " wpilib: " + wpilibNativeName)
|
|
println("Using Wpilib: " + wpilibVersion)
|
|
println("Using OpenCV: " + openCVversion)
|
|
|
|
|
|
photonMavenURL = 'https://maven.photonvision.org/' + (isDev ? 'snapshots' : 'releases');
|
|
println("Publishing Photonlib to " + photonMavenURL)
|
|
}
|
|
|
|
spotless {
|
|
java {
|
|
target fileTree('.') {
|
|
include '**/*.java'
|
|
exclude '**/build/**', '**/build-*/**', '**/src/generated/**'
|
|
}
|
|
toggleOffOn()
|
|
googleJavaFormat()
|
|
leadingSpacesToTabs(2)
|
|
leadingTabsToSpaces(4)
|
|
removeUnusedImports()
|
|
trimTrailingWhitespace()
|
|
endWithNewline()
|
|
}
|
|
groovyGradle {
|
|
target fileTree('.') {
|
|
include '**/*.gradle'
|
|
exclude '**/build/**', '**/build-*/**'
|
|
}
|
|
greclipse()
|
|
leadingTabsToSpaces(4)
|
|
trimTrailingWhitespace()
|
|
endWithNewline()
|
|
}
|
|
format 'misc', {
|
|
target fileTree('.') {
|
|
include '**/*.md', '**/.gitignore'
|
|
exclude '**/build/**', '**/build-*/**', '**/node_modules/**'
|
|
}
|
|
trimTrailingWhitespace()
|
|
leadingTabsToSpaces(2)
|
|
endWithNewline()
|
|
}
|
|
}
|
|
|
|
wrapper {
|
|
gradleVersion = '8.14.3'
|
|
}
|
|
|
|
ext.getCurrentArch = {
|
|
return NativePlatforms.desktop
|
|
}
|
|
|
|
subprojects {
|
|
tasks.withType(JavaCompile) {
|
|
options.compilerArgs.add '-XDstringConcat=inline'
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
// Enables UTF-8 support in Javadoc
|
|
tasks.withType(Javadoc) {
|
|
options.addStringOption("charset", "utf-8")
|
|
options.addStringOption("docencoding", "utf-8")
|
|
options.addStringOption("encoding", "utf-8")
|
|
options.addBooleanOption("Xdoclint/package:-org.photonvision.proto,-org.photonvision.struct,-org.photonvision.targeting.proto,-org.photonvision.jni", true)
|
|
}
|
|
}
|