Skip to content

Conversation

@rivancic
Copy link

  • Change projectVersion from Property<Object> to Property<String>
  • Initialize via Provider and toString() to ensure a String value
  • Remove redundant public modifiers (Groovy defaults to public)
  • Update getters to return correctly typed properties

- Change `projectVersion` from `Property<Object>` to `Property<String>`
- Initialize via `Provider` and `toString()` to ensure a `String` value
- Remove redundant `public` modifiers (Groovy defaults to public)
- Update getters to return correctly typed properties
@rivancic
Copy link
Author

I’m not fully sure whether narrowing projectVersion from Property<Object> to Property<String> could limit any existing usage where a non-String value (e.g., GString or custom type) was being provided. In practice Gradle treats version as stringy and we explicitly coerce to String via a Provider, but I’d appreciate feedback from maintainers/users if you know of cases that rely on the broader Object typing.

I tested this locally with the fr.brouillard.oss.gradle.jgitver plugin (I know not really maintained 🙃 ) and the project version was resolved correctly with this change. It fixed the behavior described in #239.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant