[
https://issues.apache.org/jira/browse/BUILDR-134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623273#action_12623273
]
Assaf Arkin commented on BUILDR-134:
------------------------------------
The behavior of Layout is to return the longest matching path, regardless of
the order in which these paths are specified in the layout:
project.layout[:source] = 'my_source'
project.layout[:source :main] = 'main'
puts project.layout.expand(:source, :main)
=> 'main'
http://incubator.apache.org/buildr/extending.html#using_alternative_layouts
"If you need anything more complex, you can always subclass Layout and add
special handling in the expand method, you'll find one such example in the API
documentation"
The Layout class is not designed to be the most capable layout mechanism, but
rather the simplest one. It strikes a balance between simplicity, utility and
performance that make it suitable for most cases. To prevent the built-in
implementation from being a limiting factor, you can extend it, or in fact pass
any object that provides an expand method.
> changing "parent" component in layout doesn't change child if already
> referenced
> ---------------------------------------------------------------------------------
>
> Key: BUILDR-134
> URL: https://issues.apache.org/jira/browse/BUILDR-134
> Project: Buildr
> Issue Type: Improvement
> Affects Versions: 1.3.2
> Reporter: Ittay Dror
> Fix For: 1.3.3
>
>
> Take this code:
> project.layout[:source :main] = project.layout.expand(:source, 'my_main')
> project.layout[:source] = 'my_source'
> I would expect project.layout.expand(:source, :main) to then expand to
> my_source/my_main. It doesn't, it expands to source/my_main.
> Obviously the above is just a toy example and can be solved by reordering the
> lines, however in a complex buildfile and extensions, this is not so easy.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.