incubator-ivy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Hanin (JIRA)" <>
Subject [jira] Commented: (IVY-324) Conditional patterns
Date Wed, 21 Feb 2007 14:52:05 GMT


Xavier Hanin commented on IVY-324:

Mmm, interesting. To be honest, I like your proposition for its readibility, and because it's
in the same spirit as the filtering on type which is currently available on the several ant
tasks (like retrieve for instance).

What I like less is that it's less flexible. You try to figure out what kind of filtering
is possible, but it's very difficult to guess all the use cases. Maybe someone would like
to write a conditional pattern based on revision, e.g. all revision ending with dev are located
somewhere, the others elsewhere. I don't really know. But note that your proposition could
stil make sense even if we accept all the possible tokens as attributes. The problem is that
it's still less flexible than the other propositions, because you can't combine filtering
on several tokens with OR or AND operators. We will have to assume one operator only. Another
problem is that you can't filter on extra attribute, and this is something that could be very

Hence even if I like your proposition I think we should find something which would allow more
flexibility. Maybe accept several syntax? What do you think?

> Conditional patterns
> --------------------
>                 Key: IVY-324
>                 URL:
>             Project: Ivy
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Xavier Hanin
>         Assigned To: Xavier Hanin
> For the moment Ivy supports optional parts in patterns, but sometimes pattern need to
be truly conditional.
> Two solutions can be considered:
> - add a condition attribute on patterns occuring in a list, like for all resource based
dependency resolvers. For instance:
> <artifact pattern="path/to/[organisation]/[module]/[revision]/[artifact].[ext]" if="type=jar"/>
> <artifact pattern="path/to/[organisation]/[module]/[revision]/[artifact]-src.[ext]"
> - add a special syntax to allow conditional patterns everywhere. The drawback of this
solution is that it may be difficult to read. The advantage is that it could be used wherever
patterns are used (without requiring an additional attribute). Example:
> <artifact pattern="path/to/[organisation]/[module]/[revision]/[artifact]-src.[ext](if
type=source)|path/to/[organisation]/[module]/[revision]/[artifact].[ext](if type=jar)"/>

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message