2021-01-14 21:45:26 -05:00
|
|
|
plugins {
|
2023-10-24 23:02:59 -04:00
|
|
|
id "com.diffplug.spotless" version "6.22.0"
|
2023-10-15 12:17:40 -04:00
|
|
|
id "edu.wpi.first.NativeUtils" version "2024.2.0" apply false
|
2021-01-18 22:12:57 -05:00
|
|
|
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
|
2023-11-04 09:42:30 -04:00
|
|
|
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3"
|
2023-10-25 20:27:56 -04:00
|
|
|
id 'edu.wpi.first.WpilibTools' version '1.3.0'
|
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()
|
2021-01-18 22:12:57 -05:00
|
|
|
maven { url = "https://maven.photonvision.org/repository/internal/" }
|
2021-01-14 21:45:26 -05:00
|
|
|
}
|
2021-01-18 22:12:57 -05:00
|
|
|
wpilibRepositories.addAllReleaseRepositories(it)
|
|
|
|
|
wpilibRepositories.addAllDevelopmentRepositories(it)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Configure the version number.
|
|
|
|
|
apply from: "versioningHelper.gradle"
|
|
|
|
|
|
|
|
|
|
ext {
|
2023-11-04 09:42:30 -04:00
|
|
|
wpilibVersion = "2024.1.1-beta-3"
|
2023-11-01 19:16:41 -04:00
|
|
|
openCVversion = "4.8.0-2"
|
2021-01-18 22:12:57 -05:00
|
|
|
joglVersion = "2.4.0-rc-20200307"
|
2023-10-10 05:06:59 -04:00
|
|
|
javalinVersion = "5.6.2"
|
2023-10-15 12:17:40 -04:00
|
|
|
frcYear = "2024"
|
|
|
|
|
|
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
|
|
|
|
|
String nativeName = wpilibTools.platformMapper.currentPlatform.platformName;
|
|
|
|
|
if (nativeName == "linuxx64") nativeName = "linuxx86-64";
|
|
|
|
|
if (nativeName == "winx64") nativeName = "windowsx86-64";
|
|
|
|
|
if (nativeName == "macx64") nativeName = "osxx86-64";
|
|
|
|
|
if (nativeName == "macarm64") nativeName = "osxarm64";
|
|
|
|
|
jniPlatform = nativeName
|
|
|
|
|
println("Building for platform " + jniPlatform)
|
2021-01-14 21:45:26 -05:00
|
|
|
}
|
|
|
|
|
|
2022-12-16 17:05:23 -08:00
|
|
|
wpilibTools.deps.wpilibVersion = wpilibVersion
|
|
|
|
|
|
2023-11-01 19:16:41 -04:00
|
|
|
// Tell gradlerio what version of things to use (that we care about)
|
|
|
|
|
// See: https://github.com/wpilibsuite/GradleRIO/blob/main/src/main/java/edu/wpi/first/gradlerio/wpi/WPIVersionsExtension.java
|
|
|
|
|
wpi.getVersions().getOpencvVersion().convention(openCVversion);
|
|
|
|
|
wpi.getVersions().getWpilibVersion().convention(wpilibVersion);
|
|
|
|
|
|
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
|
|
|
}
|