ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Matthies <ml_ivy-u...@nmhq.net>
Subject Re: Version Pattern Matcher
Date Fri, 24 Jul 2009 00:02:00 GMT
On Fri 2009-07-24 at 01:59h, Niklas Matthies wrote on ivy-user:
> The new Version Pattern Matcher effectively provides a macro-like
> functionality for version constraints. This macro facility would be
> useful regardless of the version constraint syntax, it could "wrap"
> any of the other version matchers (or even itself).
> 
> In fact, aren't version matchers and pattern matchers conceptually the
> same? Both represent predicates on strings, right? So it would make
> sense to give version matchers identifiers (typedefs) so they can play
> the role of pattern matchers, like "regexp" etc.
> 
> Changing the "pattern-vm" syntax slightly to emphasize the macro
> functionality, one could for example have:
> 
>     <version-matcher-macros>
>         <macro name="atMost" args="max"
>                expansion="(,max]" matcher="range" />

This should have been expansion="(,${max}]", of course.

>     </version-matcher-macros>
> 
> And use it like:
> 
>     <dependency org="acme" name="tool" rev="atMost(3.0)" />
> 
> The example assumes that the Version Range Matcher is available as a
> pattern matcher via the typedef "range".
> 
> What do you think?
> 
> -- Niklas Matthies

-- Niklas Matthies

Mime
View raw message