Build photonlib json first (#952)

This commit is contained in:
Matt
2023-10-15 13:45:30 -04:00
committed by GitHub
parent c8c9e779ab
commit 7f94962791
2 changed files with 7 additions and 9 deletions

View File

@@ -120,23 +120,22 @@ task generateVendorJson() {
outputs.file photonlibFileOutput
inputs.file photonlibFileInput
doLast {
println "Writing version ${pubVersion} to $photonlibFileOutput"
println "Writing vendor JSON ${pubVersion} to $photonlibFileOutput"
if (photonlibFileOutput.exists()) {
photonlibFileOutput.delete()
}
photonlibFileOutput.parentFile.mkdirs()
def read = photonlibFileInput.text
.replace('${photon_version}', pubVersion)
.replace('${frc_year}', frcYear)
photonlibFileOutput.write(read)
}
photonlibFileOutput.text = read
outputs.upToDateWhen { false }
}
build.dependsOn generateVendorJson
build.mustRunAfter generateVendorJson
task writeCurrentVersion {
def versionFileIn = file("${rootDir}/shared/PhotonVersion.java.in")
@@ -147,7 +146,7 @@ task writeCurrentVersion {
versionString)
}
build.dependsOn writeCurrentVersion
build.mustRunAfter writeCurrentVersion
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'

View File

@@ -198,8 +198,7 @@ model {
}
}
// So I don't actually know the _right_ way to tell gradle that the vendordep json publish requires generation first, so we're doing this
getTasksByName("publishVendorjsonPublicationToMavenLocal", false).each {
tasks.withType(PublishToMavenRepository) {
it.mustRunAfter generateVendorJson
}