You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We current use Gradle's support for convention mappings in a few places in the Gradle plugin. This is an internal API so it'd be nice to move off it. Gradle 4.0 introduced PropertyState and Provider that can be used to achieve the same end result.
I have some reservations about the PropertyState and Provider APIs in their current form. As far as I can tell you have to be comfortable with losing some type safety. For example, if you want to have a List<String> property, you cannot have a PropertyState<List<String>> and Provider<List<String>> for it. Instead, have to make do with PropertyState<List> and Provider<List> and hope for the best.
Convention mappings have a similar lack of type safety but it doesn't leak into a task's own API (unlike setThings(Provider<List> thingsProvider) would for example). I also believe that convention mappings benefit from some of Groovy's type coercion and property states do not.
We may well decide that continuing to use convention mappings is the least bad option here.
The text was updated successfully, but these errors were encountered:
This is important as user code may want to create such a Provider and we want to be able to offer setters that take Provider<List<String>> and the like.
The PropertyState side of things is a bit more awkward, but the problem can be worked around by casting:
This commit reworks BootRun so that it no longer subclasses JavaExec.
This provides Boot with greater control of how the executed JVM is
configured, including the possibility of using @option to provide args
and JVM args via the command line (gh-1176). It also allows some usage
of convention mappings to be removed in favour of PropertyState and
Provider (gh-9891). For users who relied up the advanced (and rather
complex) configuration options provided by JavaExec, an escape hatch
is provided by allowing the JavaExecSpec that's used to execute the
JVM to be customized.
Closesgh-9884
We current use Gradle's support for convention mappings in a few places in the Gradle plugin. This is an internal API so it'd be nice to move off it. Gradle 4.0 introduced
PropertyState
andProvider
that can be used to achieve the same end result.I have some reservations about the
PropertyState
andProvider
APIs in their current form. As far as I can tell you have to be comfortable with losing some type safety. For example, if you want to have aList<String>
property, you cannot have aPropertyState<List<String>>
andProvider<List<String>>
for it. Instead, have to make do withPropertyState<List>
andProvider<List>
and hope for the best.Convention mappings have a similar lack of type safety but it doesn't leak into a task's own API (unlike
setThings(Provider<List> thingsProvider)
would for example). I also believe that convention mappings benefit from some of Groovy's type coercion and property states do not.We may well decide that continuing to use convention mappings is the least bad option here.
The text was updated successfully, but these errors were encountered: