Fix/plugin file generation#214
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the surf-api-gradle-plugin to a new patch version and corrects the Gradle task output annotation for plugin-file generation so Gradle tracks the task output as a single file (not a directory).
Changes:
- Bump Gradle plugin version suffix from
-1.12.1to-1.12.2. - Fix
GeneratePluginFile.outputFileannotation from@OutputDirectoryto@OutputFile.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| surf-api-gradle-plugin/src/main/kotlin/dev/slne/surf/surfapi/gradle/generators/GeneratePluginFile.kt | Corrects task output annotation to a file output for proper Gradle up-to-date/cache behavior. |
| surf-api-gradle-plugin/build.gradle.kts | Bumps the plugin patch version suffix for release/versioning alignment. |
Comments suppressed due to low confidence (1)
surf-api-gradle-plugin/src/main/kotlin/dev/slne/surf/surfapi/gradle/generators/GeneratePluginFile.kt:25
- With
@OutputFile, the task is declared to produce a file output, butgenerate()deletes that file whenpluginFileJsonis blank (see theelsebranch). In that scenario Gradle will consider the declared output missing and the task will be out-of-date on every build (and remote/local build cache reuse may be impacted). Consider either (a) not registering/adding this task as a resources source when generation is skipped, or (b) making the output explicitly optional / usingonlyIf { pluginFileJson.get().isNotBlank() }plus a separate cleanup step to avoid packaging stale files.
@get:OutputFile
abstract val outputFile: RegularFileProperty
@TaskAction
fun generate() {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the versioning scheme of the Gradle plugin and corrects the output annotation for the plugin file generation task. The main changes include incrementing the plugin's patch version and ensuring that the plugin file task is properly marked as producing a single output file rather than a directory.
Versioning update:
-1.12.1to-1.12.2inbuild.gradle.ktsto reflect a new patch release.Gradle task annotation fix:
outputFileproperty inGeneratePluginFilefrom@OutputDirectoryto@OutputFile, correctly indicating that the task produces a single file output instead of a directory. [1] [2]