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"
|
2024-01-15 15:44:43 -05:00
|
|
|
id "com.diffplug.spotless" version "6.24.0"
|
2021-01-18 22:12:57 -05:00
|
|
|
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
|
2025-03-19 00:31:59 -05:00
|
|
|
id "edu.wpi.first.GradleRIO" version "2025.3.2"
|
2023-10-25 20:27:56 -04:00
|
|
|
id 'edu.wpi.first.WpilibTools' version '1.3.0'
|
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'
|
2024-12-26 01:25:12 +08:00
|
|
|
id "org.ysb33r.doxygen" version "1.0.4" apply false
|
|
|
|
|
id 'com.gradleup.shadow' version '8.3.4' apply false
|
|
|
|
|
id "com.github.node-gradle.node" version "7.0.1" apply false
|
|
|
|
|
id "org.hidetake.ssh" version "2.11.2" apply false
|
2021-01-14 21:45:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
|
repositories {
|
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" }
|
|
|
|
|
maven { url = "https://jogamp.org/deployment/maven/" }
|
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 {
|
2025-03-19 00:31:59 -05:00
|
|
|
wpilibVersion = "2025.3.2"
|
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"
|
2023-10-10 05:06:59 -04:00
|
|
|
javalinVersion = "5.6.2"
|
2025-01-13 15:15:42 -08:00
|
|
|
libcameraDriverVersion = "v2025.0.3"
|
2025-02-08 19:11:01 -06:00
|
|
|
rknnVersion = "dev-v2025.0.0-1-g33b6263"
|
2024-10-31 02:59:39 -04:00
|
|
|
frcYear = "2025"
|
2024-12-20 09:54:48 +08:00
|
|
|
mrcalVersion = "v2025.0.0";
|
2023-10-15 12:17:40 -04:00
|
|
|
|
2024-01-15 22:28:34 -05: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
|
|
|
|
2022-12-31 19:56:16 -08:00
|
|
|
// A list, for legacy reasons, with only the current platform contained
|
2024-01-05 12:26:17 -07:00
|
|
|
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";
|
2022-12-31 19:56:16 -08:00
|
|
|
jniPlatform = nativeName
|
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'
|
|
|
|
|
exclude '**/build/**', '**/build-*/**'
|
|
|
|
|
}
|
|
|
|
|
trimTrailingWhitespace()
|
|
|
|
|
indentWithSpaces(2)
|
|
|
|
|
endWithNewline()
|
2021-01-14 21:45:26 -05:00
|
|
|
}
|
|
|
|
|
}
|
2023-10-15 12:17:40 -04:00
|
|
|
|
|
|
|
|
wrapper {
|
2024-11-20 23:42:30 -05:00
|
|
|
gradleVersion '8.11'
|
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")
|
|
|
|
|
}
|
|
|
|
|
}
|