Closed snicoll closed 5 years ago
@wilkinsona I've started to hack on this one, see 1a14914. I was wondering if you could have a look to the general direction. The idea is to extend this notion of container to BOMs and repositories. On the initializr side, we'd need to create the Build
instance with another BuildItemResolver
implementation (typically the metadata or something that's wrapping it) could implement that interface).
👍 Looks good to me.
Let's improve
Build
to be able to easily add item that are known by the metadata, that is: dependencies, boms and repositories.Each of those could use a dedicated object rather than returning a raw list. This dedicated object could have additional methods to filter and manipulate the elements.
In order to make that link, we need an
BuildResolver
interface of some sort where given an id an element is returned or an exception is thrown which will allow use to have something likeaddDependency(String id)
.In the integration layer, the metadata can implement this interface so that a "smart'
Build
instance can be created as easily asnew GradleBuild(metadata)
.