2024-01-13 16:57:56 -08:00
|
|
|
import edu.wpi.first.toolchain.*
|
|
|
|
|
|
2021-01-14 21:45:26 -05:00
|
|
|
plugins {
|
2024-01-15 15:44:43 -05:00
|
|
|
id "com.diffplug.spotless" version "6.24.0"
|
2024-06-30 02:08:58 -04:00
|
|
|
id "edu.wpi.first.NativeUtils" version "2024.7.2" apply false
|
2021-01-18 22:12:57 -05:00
|
|
|
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
|
2024-03-18 00:00:22 -04:00
|
|
|
id "edu.wpi.first.GradleRIO" version "2024.3.2"
|
2023-10-25 20:27:56 -04:00
|
|
|
id 'edu.wpi.first.WpilibTools' version '1.3.0'
|
2023-12-31 00:14:21 -05:00
|
|
|
id 'com.google.protobuf' version '0.9.4' 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 {
|
2024-06-30 02:08:58 -04:00
|
|
|
wpilibVersion = "2025.0.0-alpha-1"
|
2023-11-22 20:08:23 -05:00
|
|
|
wpimathVersion = wpilibVersion
|
2023-11-01 19:16:41 -04:00
|
|
|
openCVversion = "4.8.0-2"
|
2024-05-29 12:29:08 -05:00
|
|
|
joglVersion = "2.4.0"
|
2023-10-10 05:06:59 -04:00
|
|
|
javalinVersion = "5.6.2"
|
2024-06-12 18:06:25 -04:00
|
|
|
libcameraDriverVersion = "dev-v2023.1.0-12-gfb1eafb"
|
2024-05-29 12:29:08 -05:00
|
|
|
rknnVersion = "dev-v2024.0.1-4-g0db16ac"
|
2023-10-15 12:17:40 -04:00
|
|
|
frcYear = "2024"
|
2024-05-29 12:29:08 -05:00
|
|
|
mrcalVersion = "dev-v2024.0.0-24-gc1efcf0";
|
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'
|
|
|
|
|
exclude '**/build/**', '**/build-*/**', "photon-core\\src\\main\\java\\org\\photonvision\\PhotonVersion.java", "photon-lib\\src\\main\\java\\org\\photonvision\\PhotonVersion.java"
|
|
|
|
|
}
|
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 'xml', {
|
|
|
|
|
target fileTree('.') {
|
|
|
|
|
include '**/*.xml'
|
|
|
|
|
exclude '**/build/**', '**/build-*/**', "**/.idea/**"
|
|
|
|
|
}
|
|
|
|
|
eclipseWtp('xml')
|
|
|
|
|
trimTrailingWhitespace()
|
|
|
|
|
indentWithSpaces(2)
|
|
|
|
|
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 {
|
2023-10-25 20:27:56 -04:00
|
|
|
gradleVersion '8.4'
|
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")
|
|
|
|
|
}
|
|
|
|
|
}
|