Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix photonlib publish error #952

Merged
merged 1 commit into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions photon-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -147,7 +146,7 @@ task writeCurrentVersion {
versionString)
}

build.dependsOn writeCurrentVersion
build.mustRunAfter writeCurrentVersion

tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
Expand Down
3 changes: 1 addition & 2 deletions photon-lib/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down