mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Fixes failure in #2481. The pnpm version was unpinned, so it quietly moved to pnpm 11, which introduced several breaking changes including one with approved builds (specifically, strictDepBuilds). Since we're on pnpm 11 anyways, use their new system for approving postinstalls for certain dependencies.
125 lines
3.8 KiB
Groovy
125 lines
3.8 KiB
Groovy
import org.wpilib.toolchain.*
|
|
|
|
plugins {
|
|
id "cpp"
|
|
id "com.diffplug.spotless" version "8.1.0"
|
|
id "org.wpilib.WPILibRepositoriesPlugin" version "2027.0.0"
|
|
id 'org.wpilib.NativeUtils' version '2027.4.1' apply false
|
|
id 'org.wpilib.DeployUtils' version '2027.1.0' apply false
|
|
id 'org.photonvision.tools.WpilibTools' version '3.0.0-photon'
|
|
id 'com.google.protobuf' version '0.9.5' apply false
|
|
id 'org.wpilib.GradleJni' version '2027.0.0'
|
|
id "org.ysb33r.doxygen" version "2.0.0" apply false
|
|
id 'com.gradleup.shadow' version '9.0.0' apply false
|
|
id "com.github.node-gradle.node" version "7.1.0" 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.use2027Repos()
|
|
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 = "2027.0.0-alpha-4"
|
|
wpimathVersion = wpilibVersion
|
|
openCVYear = "2025"
|
|
openCVversion = "4.10.0-3"
|
|
ejmlVersion = "0.43.1";
|
|
jacksonVersion = "2.15.2";
|
|
quickbufVersion = "1.3.3";
|
|
jacocoVersion = "0.8.14";
|
|
|
|
javalinVersion = "6.7.0"
|
|
libcameraDriverVersion = "dev-v2026.0.0-2-gef3d7a0"
|
|
rknnVersion = "dev-v2026.0.1-1-g89b2888"
|
|
rubikVersion = "dev-v2026.0.1-4-g13d6279"
|
|
frcYear = "2027_alpha4"
|
|
mrcalVersion = "v2027.0.1";
|
|
|
|
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 = '9.4.0'
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|