[
https://issues.apache.org/jira/browse/BUILDR-134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ittay Dror reopened BUILDR-134:
-------------------------------
project.layout[:source :main] = project.layout.expand(:source, 'my_main')
project.layout[:source] = 'my_source'
puts project.layout.expand(:source, :main)
=> "source/my_main"
but,
project.layout[:source] = 'my_source'
puts project.layout.expand(:source, :main)
=> "my_source/main"
and
project.layout[:source] = 'my_source'
project.layout[:source :main] = project.layout.expand(:source, 'my_main')
puts project.layout.expand(:source, :main)
=> "my_source/my_main"
So the behavior changes according to the placement of statements. of course
with the current implementation, this is how it behaves, but i think there
should be a way to remain consistent and not break when statements change their
order (the code above is just and example, with multi-module build that uses
extensions, it is more difficult).
this is why i suggested allowing the user something like:
project.layout[:source :main] = [:source, 'my_main']
or maybe rails style (?) of
project.layout[:source :main] = ':source/my_main'
or another alternative
project.relative_layout[:main] = 'my_main'
all of these alternative produce a layout mechanism that is easier to
manipulate, so why not do it? if you agree, i don't mind submitting a patch
(just tell me what API you prefer)
> 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: Bug
> 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.