I would have hoped for `val javaLanguageVersion: I...
# community-support
s
I would have hoped for
val javaLanguageVersion: Int by project
to "just work" if the named string property can be turned into an int, and only fail the build if it doesn't. But it does not seem to work at all, and I always need to use
String
as a type here it seems. Is this already tracked as some issue that I can upvote?
v
I'm not sure whether that is a good idea. Actually you can set properties with any type. And then also retrieve them like that. But things coming from
gradle.properties
or
-P
or similar are simply `String`s . Not sure whether it would be a good idea to auto-transform. Actually, I'd anyway set this in the version catalog instead. And additionally, the receiver of that value most probably supports `String`s in this specific case. πŸ™‚
s
And additionally, the receiver of that value most probably supports `String`s in this specific case. πŸ™‚
Indeed it does (as I had also found out after writing my post) πŸ˜‰
πŸ‘Œ 1
v
It is about "by settings" but it's the same
s
Gist:
This is the intended behavior and there’s no plan to change it. [...] There is no automatic conversion, you can do the conversion in your script.
Oh well, with that argument you don't need any convenience functions at all. Thanks anyway!
v
Well, you can request it again, maybe if demand is high enough something will added, or if someone provides a PR. πŸ€·β€β™‚οΈ Just stumbled upon it and thought I let you know that it at least was once already discarded as works-as-designed. πŸ™‚
πŸ‘ 1