2024-01-13 16:57:56 -08:00
|
|
|
import edu.wpi.first.toolchain.*
|
|
|
|
|
|
2021-01-14 21:45:26 -05:00
|
|
|
plugins {
|
2024-09-23 22:44:09 -04:00
|
|
|
id "cpp"
|
2026-01-12 16:00:11 -06:00
|
|
|
id "com.diffplug.spotless" version "8.1.0"
|
2021-01-18 22:12:57 -05:00
|
|
|
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
|
2026-01-16 16:55:30 -08:00
|
|
|
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
2026-01-12 16:00:11 -06:00
|
|
|
id 'org.photonvision.tools.WpilibTools' version '2.3.3-photon'
|
2024-10-31 02:59:39 -04:00
|
|
|
id 'com.google.protobuf' version '0.9.3' apply false
|
2024-09-23 22:44:09 -04:00
|
|
|
id 'edu.wpi.first.GradleJni' version '1.1.0'
|
2025-10-16 10:22:55 +08:00
|
|
|
id "org.ysb33r.doxygen" version "2.0.0" apply false
|
2024-12-26 01:25:12 +08:00
|
|
|
id 'com.gradleup.shadow' version '8.3.4' apply false
|
|
|
|
|
id "com.github.node-gradle.node" version "7.0.1" apply false
|
2021-01-14 21:45:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
|
repositories {
|
2026-01-04 19:23:42 -08:00
|
|
|
maven { url = "https://frcmaven.wpi.edu/artifactory/ex-mvn/" }
|
2022-10-31 08:32:49 -04:00
|
|
|
mavenCentral()
|
2022-12-27 10:47:20 -08:00
|
|
|
mavenLocal()
|
2024-05-29 12:29:08 -05:00
|
|
|
maven { url = "https://maven.photonvision.org/releases" }
|
|
|
|
|
maven { url = "https://maven.photonvision.org/snapshots" }
|
2021-01-14 21:45:26 -05:00
|
|
|
}
|
2021-01-18 22:12:57 -05:00
|
|
|
wpilibRepositories.addAllReleaseRepositories(it)
|
|
|
|
|
wpilibRepositories.addAllDevelopmentRepositories(it)
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-10 21:37:01 -04:00
|
|
|
ext.localMavenURL = file("$project.buildDir/outputs/maven")
|
|
|
|
|
ext.allOutputsFolder = file("$project.buildDir/outputs")
|
|
|
|
|
|
2021-01-18 22:12:57 -05:00
|
|
|
// Configure the version number.
|
|
|
|
|
apply from: "versioningHelper.gradle"
|
|
|
|
|
|
|
|
|
|
ext {
|
2026-01-16 16:55:30 -08:00
|
|
|
wpilibVersion = "2026.2.1"
|
2023-11-22 20:08:23 -05:00
|
|
|
wpimathVersion = wpilibVersion
|
2024-12-20 09:54:48 +08:00
|
|
|
openCVYear = "2025"
|
|
|
|
|
openCVversion = "4.10.0-3"
|
2025-10-13 20:58:14 -05:00
|
|
|
javalinVersion = "6.7.0"
|
2026-01-12 16:00:11 -06:00
|
|
|
libcameraDriverVersion = "v2026.0.0"
|
|
|
|
|
rknnVersion = "v2026.0.1"
|
|
|
|
|
rubikVersion = "v2026.0.1"
|
|
|
|
|
frcYear = "2026"
|
|
|
|
|
mrcalVersion = "v2026.0.0";
|
2023-10-15 12:17:40 -04:00
|
|
|
|
2021-01-18 22:12:57 -05:00
|
|
|
pubVersion = versionString
|
2021-02-23 15:07:43 -05:00
|
|
|
isDev = pubVersion.startsWith("dev")
|
2021-12-18 12:53:08 -05:00
|
|
|
|
2024-01-05 12:26:17 -07:00
|
|
|
wpilibNativeName = wpilibTools.platformMapper.currentPlatform.platformName;
|
2026-01-06 10:11:33 -05:00
|
|
|
jniPlatform = wpilibTools.platformMapper.wpilibClassifier;
|
2024-01-05 12:26:17 -07:00
|
|
|
|
|
|
|
|
println("Building for platform " + jniPlatform + " wpilib: " + wpilibNativeName)
|
2023-11-22 20:08:23 -05:00
|
|
|
println("Using Wpilib: " + wpilibVersion)
|
|
|
|
|
println("Using OpenCV: " + openCVversion)
|
2024-05-29 12:29:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
photonMavenURL = 'https://maven.photonvision.org/' + (isDev ? 'snapshots' : 'releases');
|
|
|
|
|
println("Publishing Photonlib to " + photonMavenURL)
|
2021-01-14 21:45:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
spotless {
|
|
|
|
|
java {
|
2023-10-24 23:02:59 -04:00
|
|
|
target fileTree('.') {
|
|
|
|
|
include '**/*.java'
|
2024-11-16 21:30:34 -05:00
|
|
|
exclude '**/build/**', '**/build-*/**', '**/src/generated/**'
|
2023-10-24 23:02:59 -04:00
|
|
|
}
|
2022-01-08 10:17:28 -08:00
|
|
|
toggleOffOn()
|
2021-01-14 21:45:26 -05:00
|
|
|
googleJavaFormat()
|
|
|
|
|
indentWithTabs(2)
|
|
|
|
|
indentWithSpaces(4)
|
|
|
|
|
removeUnusedImports()
|
2022-01-08 10:17:28 -08:00
|
|
|
trimTrailingWhitespace()
|
|
|
|
|
endWithNewline()
|
2021-01-14 21:45:26 -05:00
|
|
|
}
|
2023-10-24 23:02:59 -04:00
|
|
|
groovyGradle {
|
|
|
|
|
target fileTree('.') {
|
|
|
|
|
include '**/*.gradle'
|
|
|
|
|
exclude '**/build/**', '**/build-*/**'
|
|
|
|
|
}
|
|
|
|
|
greclipse()
|
|
|
|
|
indentWithSpaces(4)
|
|
|
|
|
trimTrailingWhitespace()
|
|
|
|
|
endWithNewline()
|
|
|
|
|
}
|
|
|
|
|
format 'misc', {
|
|
|
|
|
target fileTree('.') {
|
|
|
|
|
include '**/*.md', '**/.gitignore'
|
2025-11-01 17:42:30 -04:00
|
|
|
exclude '**/build/**', '**/build-*/**', '**/node_modules/**'
|
2023-10-24 23:02:59 -04:00
|
|
|
}
|
|
|
|
|
trimTrailingWhitespace()
|
|
|
|
|
indentWithSpaces(2)
|
|
|
|
|
endWithNewline()
|
2021-01-14 21:45:26 -05:00
|
|
|
}
|
|
|
|
|
}
|
2023-10-15 12:17:40 -04:00
|
|
|
|
|
|
|
|
wrapper {
|
2025-10-16 10:22:55 +08:00
|
|
|
gradleVersion = '8.14.3'
|
2023-10-15 12:17:40 -04:00
|
|
|
}
|
2024-01-13 16:57:56 -08:00
|
|
|
|
|
|
|
|
ext.getCurrentArch = {
|
|
|
|
|
return NativePlatforms.desktop
|
|
|
|
|
}
|
2024-05-29 17:28:35 -04:00
|
|
|
|
|
|
|
|
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")
|
2026-01-11 14:25:49 -05:00
|
|
|
options.addBooleanOption("Xdoclint/package:-org.photonvision.proto,-org.photonvision.struct,-org.photonvision.targeting.proto,-org.photonvision.jni", true)
|
2024-05-29 17:28:35 -04:00
|
|
|
}
|
|
|
|
|
}
|