mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-04 03:11:40 +00:00
Fix version verification with non-default networktable (#407)
Adds version verification to c++ too
This commit is contained in:
@@ -28,13 +28,14 @@ gradle.allprojects {
|
||||
ext.versionString = getCurrentVersion()
|
||||
}
|
||||
|
||||
ext.writePhotonVersionFile = { Path path, String version ->
|
||||
ext.writePhotonVersionFile = {File versionFileIn, Path path, String version ->
|
||||
println("Writing " + version + " to " + path.toAbsolutePath().toString())
|
||||
String date = DateTimeFormatter.ofPattern("yyyy-M-d hh:mm:ss").format(LocalDateTime.now())
|
||||
File versionFileOut = new File(path.toAbsolutePath().toString())
|
||||
versionFileOut.delete()
|
||||
def versionFileIn = file("${rootDir}/shared/PhotonVersion.java.in")
|
||||
def read = versionFileIn.text.replace('${version}', version).replace('${date}', date)
|
||||
if (!versionFileOut.parentFile.exists()) versionFileOut.parentFile.mkdirs()
|
||||
if (!versionFileOut.exists()) versionFileOut.createNewFile()
|
||||
versionFileOut.write(read)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user