Repository navigation
Wire central catalog refresh - #1
riccardobl wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request registers a new Gradle task 'refreshCatalog' in 'build.gradle' to download the central NostrGameEngine version catalog, and adds the initial 'gradle/libs.versions.toml' catalog file. Feedback suggests replacing 'outputs.file(outputFile)' with 'outputs.upToDateWhen { false }' to prevent Gradle from incorrectly skipping the task as up-to-date when the catalog file already exists.
| .orElse('https://raw.githubusercontent.com/NostrGameEngine/libs.catalog/main/libs.versions.toml') | ||
| def outputFile = layout.projectDirectory.file('gradle/libs.versions.toml') | ||
|
|
||
| outputs.file(outputFile) |
There was a problem hiding this comment.
Declaring outputs.file(outputFile) without any corresponding inputs causes Gradle's up-to-date check to skip this task if the gradle/libs.versions.toml file already exists. Since the purpose of this task is to refresh/download the latest catalog, it should always run. Replacing this with outputs.upToDateWhen { false } ensures the task is never skipped as up-to-date.
outputs.upToDateWhen { false }
Summary
refreshCatalogGradle task that downloadsNostrGameEngine/libs.catalog.refresh-catalog.ymlworkflow that opens a PR only when the refreshed catalog changes.Verification
tomllib.YAML.load_file../gradlew --no-daemon -q refreshCatalogsuccessfully inbech32as the representative Groovy Gradle task.Note: local Kotlin-task execution in
cap-cache-generatorwas blocked before task execution because the machine ran out of disk space while the Gradle wrapper tried to install Gradle 8.4.