mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-23 01:21:40 +00:00
53 lines
2.2 KiB
Groovy
53 lines
2.2 KiB
Groovy
import java.time.LocalDateTime
|
|
import java.time.format.DateTimeFormatter
|
|
|
|
apply from: "${rootDir}/shared/common.gradle"
|
|
|
|
dependencies {
|
|
implementation project(':photon-targeting')
|
|
|
|
implementation 'io.javalin:javalin:3.7.0'
|
|
|
|
implementation 'org.msgpack:msgpack-core:0.8.20'
|
|
implementation 'org.msgpack:jackson-dataformat-msgpack:0.8.20'
|
|
|
|
// wpiutil
|
|
compile "edu.wpi.first.wpiutil:wpiutil-jni:$wpilibVersion:linuxaarch64bionic"
|
|
compile "edu.wpi.first.wpiutil:wpiutil-jni:$wpilibVersion:linuxraspbian"
|
|
compile "edu.wpi.first.wpiutil:wpiutil-jni:$wpilibVersion:linuxx86-64"
|
|
compile "edu.wpi.first.wpiutil:wpiutil-jni:$wpilibVersion:osxx86-64"
|
|
compile "edu.wpi.first.wpiutil:wpiutil-jni:$wpilibVersion:windowsx86-64"
|
|
|
|
// JOGL stuff (currently we only distribute for aarch64, which is Pi 4)
|
|
implementation "org.jogamp.gluegen:gluegen-rt:$joglVersion"
|
|
implementation "org.jogamp.jogl:jogl-all:$joglVersion"
|
|
|
|
implementation "org.jogamp.gluegen:gluegen-rt:$joglVersion:natives-linux-aarch64"
|
|
implementation "org.jogamp.jogl:jogl-all:$joglVersion:natives-linux-aarch64"
|
|
|
|
// Zip
|
|
compile 'org.zeroturnaround:zt-zip:1.14'
|
|
}
|
|
|
|
task writeCurrentVersionJava {
|
|
String date = DateTimeFormatter.ofPattern("yyyy-M-d hh:mm:ss").format(LocalDateTime.now())
|
|
File versionFile = new File(java.nio.file.Path.of("$projectDir", "src", "main", "java", "org", "photonvision", "PhotonVersion.java")
|
|
.toAbsolutePath().toString())
|
|
versionFile.delete()
|
|
versionFile << "package org.photonvision;\n" +
|
|
"\n" +
|
|
"/*\n" +
|
|
" * Autogenerated file! Do not manually edit this file. This version is regenerated\n" +
|
|
" * any time the publish task is run, or when this file is deleted.\n" +
|
|
" */\n" +
|
|
"\n" +
|
|
"@SuppressWarnings(\"ALL\")\n" +
|
|
"public final class PhotonVersion {\n" +
|
|
" public static final String versionString = \"${versionString}\";\n" +
|
|
" public static final String buildDate = \"${date}\";\n" +
|
|
" public static final boolean isRelease = !versionString.startsWith(\"dev\");\n" +
|
|
"}"
|
|
}
|
|
|
|
build.dependsOn writeCurrentVersionJava
|