Closed mbhave closed 5 years ago
Good point. We should consider that everything in ProjectRequest
will go away once we merge the new API so we need something to express that the build should have properties attached to them.
Build
has a notion of versionProperties
that are quite specific. I think it is important to keep this distinction (to be able to tune the way the property is formatted according to the build system in use).
I guess we need a new map? We should be careful with the name as the semantics may be different. I'd be tempted to create a map in MavenBuild
and GradleBuild
so that things are tailored.
I don't think we need a new map. MavenBuild
already has a properties
map which I think we can move that to Build
since these properties are name/value pairs.
Properties are a bit more complicated in Gradle. They can be configured using ext
in buildscript
and ext
in the main body of the script. We already have support for adding properties to the buildscript
ext
. We could either add similar support for adding properties using the main body's ext
or we could have a common properties
abstraction in Build
. I'm torn on which is better, but leaning towards adding ext
to GradleBuild
as it avoids any risk of premature generalization, and also results in an API that's better-aligned with Gradle concepts.
That's exactly what I meant by adding a map in each abstraction. For the record we're already writing ext
in the main body when a version property is set. So that would be about adding an extra ext
map and handle those two.
That's exactly what MavenBuildWriter
does at the moment by the way.
See this and this.