|select-switch in repo config [message #602648]
||Fri, 12 March 2010 01:25
| Henrik Lindberg
Registered: July 2009
Thomas and I had a discussion today about the repository configuration,
and the lack to limit the resolution of a particular request to take
place only from particular repositories.
This resulted in the following new syntax.
("case" Expression : RepositoryConfiguration ) +
When a resolution is performed, the constant value "request" is bound to
an instance of RequiredCapability. Thus enabling a repository
configuration like this:
This is different than the earlier select-first, which will try all
listed repositories in order until one returns a build unit.
The select-switch will evaluated cases in order until a match is found,
and that repo (and that repo alone) is given a chance to resolve the
Note, that this is a special case of switch-case, as the case
expressions are not any general expression - only repository
declarations are permitted.
An alterantive was considered where this filtering was instead done as
part of the initialization of a repository handler. This would have ment
declaring a lambda to do the filtering. As this is probably a common
construct, we felt that it was better represented as a switch case.
The new proposed syntax has been implemented. Test has not yet been
written though. New version shortly available in SVN.
Powered by FUDForum
. Page generated in 0.03343 seconds