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 "2026.1.1-beta-1" id 'org.photonvision.tools.WpilibTools' version '2.2.0-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.1.1-beta-1" wpimathVersion = wpilibVersion openCVYear = "2025" openCVversion = "4.10.0-3" javalinVersion = "6.7.0" libcameraDriverVersion = "dev-v2025.0.4-3-g95e2b38" rknnVersion = "dev-v2025.0.0-7-g83c1bf3" rubikVersion = "dev-v2025.1.0-7-g39588a8" frcYear = "2026beta" mrcalVersion = "dev-v2025.0.0-3-g2dc275f"; 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") } }