With Gradle 9.0, will `project.version` be `Proper...
# community-support
j
With Gradle 9.0, will
project.version
be
Property<String>
? It would be great if Gradle creates/uses a public custom class,
GradleVersion
, which implements
Comparable
and so on to remove custom implementations on third party projects that deal with versioning. If it exposes things like
major
,
minor
,
patch
,
metadata
, etc, publicly... it would be amazing.
v
If they change it (hopefully they do) it will probably be
Property<Object>
I guess, as you can set any enriched object as version that does provide more stuff and renders the version in
toString
. I often used this possibility to have a custom version object from which I then can get major version, release version, build number, and so on. I doubt it is a good idea to have a custom version class that is automatically used, as versioning strategies of projects are quite different.
j
I think Gradle should start to remove all APIs that are
Object
or
Any
. They are an antipattern for me and force me to cast unknown things on third-party plugins. For example, imagine one plugin casting the property of version to
String
but I am setting it to a different value. Same, about function allowing them, you are forced to check the documentation or execute the code to know if it works. Any
Object
or
Any
should be deleted for sure to have a good API.
v
For example, imagine one plugin casting the property of version to
String
but I am setting it to a different value.
That is a plugin bug then. 🙂 But yeah, we'll see what they change it to, if they change it.