mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
## Description Updating to take advantage of the now independent mrcal-java (no longer need to install SuiteSparse and friends!) ## 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_ - [ ] 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 settings back to v2025.3.2 - [ ] 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 --------- Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
124 lines
3.7 KiB
Groovy
124 lines
3.7 KiB
Groovy
import edu.wpi.first.toolchain.*
|
|
|
|
plugins {
|
|
id "cpp"
|
|
id "com.diffplug.spotless" version "6.24.0"
|
|
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
|
|
id "edu.wpi.first.GradleRIO" version "2025.3.2"
|
|
id 'edu.wpi.first.WpilibTools' version '1.3.0'
|
|
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 {
|
|
mavenCentral()
|
|
mavenLocal()
|
|
maven { url = "https://maven.photonvision.org/releases" }
|
|
maven { url = "https://maven.photonvision.org/snapshots" }
|
|
maven { url = "https://jogamp.org/deployment/maven/" }
|
|
}
|
|
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 = "2025.3.2"
|
|
wpimathVersion = wpilibVersion
|
|
openCVYear = "2025"
|
|
openCVversion = "4.10.0-3"
|
|
javalinVersion = "6.7.0"
|
|
libcameraDriverVersion = "v2025.0.4"
|
|
rknnVersion = "dev-v2025.0.0-5-g666c0c6"
|
|
rubikVersion = "dev-v2025.1.0-6-g4a5e508"
|
|
frcYear = "2025"
|
|
mrcalVersion = "dev-v2025.0.0-2-g2adb187";
|
|
|
|
|
|
pubVersion = versionString
|
|
isDev = pubVersion.startsWith("dev")
|
|
|
|
// A list, for legacy reasons, with only the current platform contained
|
|
wpilibNativeName = wpilibTools.platformMapper.currentPlatform.platformName;
|
|
def nativeName = wpilibNativeName
|
|
if (wpilibNativeName == "linuxx64") nativeName = "linuxx86-64";
|
|
if (wpilibNativeName == "winx64") nativeName = "windowsx86-64";
|
|
if (wpilibNativeName == "macx64") nativeName = "osxx86-64";
|
|
if (wpilibNativeName == "macarm64") nativeName = "osxarm64";
|
|
jniPlatform = nativeName
|
|
|
|
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()
|
|
indentWithTabs(2)
|
|
indentWithSpaces(4)
|
|
removeUnusedImports()
|
|
trimTrailingWhitespace()
|
|
endWithNewline()
|
|
}
|
|
groovyGradle {
|
|
target fileTree('.') {
|
|
include '**/*.gradle'
|
|
exclude '**/build/**', '**/build-*/**'
|
|
}
|
|
greclipse()
|
|
indentWithSpaces(4)
|
|
trimTrailingWhitespace()
|
|
endWithNewline()
|
|
}
|
|
format 'misc', {
|
|
target fileTree('.') {
|
|
include '**/*.md', '**/.gitignore'
|
|
exclude '**/build/**', '**/build-*/**', '**/node_modules/**'
|
|
}
|
|
trimTrailingWhitespace()
|
|
indentWithSpaces(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")
|
|
}
|
|
}
|