Author: John Sirois <firstname.lastname@example.org>
Date: Tue Jul 22 19:04:36 2014 -0600
Fixup broken bundle alias.
Bundle was incorrectly saving mutable state at BUILD file scope instead of
per-use scope. This change adds a factory method at the BUILD file scope
(parse_context), and collapses the __init__ and __call__ into one. This is both
clearer and now not broken.
Add a test to exercise this - creating >1 bundle in a BUILD file.
In the course of adding this test, find an fix a bug in BuildFileAliases.merge.
Consequently, add a comprehensive test for BuildFileAliases.
src/python/pants/backend/jvm/register.py | 6 +---
src/python/pants/backend/jvm/targets/jvm_binary.py | 20 ++++++-----
src/python/pants/base/build_file_aliases.py | 4 ++-
tests/python/pants_test/base/BUILD | 11 ++++++
tests/python/pants_test/base/test_build_file_aliases.py | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++
tests/python/pants_test/targets/BUILD | 5 ++-
tests/python/pants_test/targets/test_jvm_app.py | 63 +++++++++++++++++++++++-----------
7 files changed, 163 insertions(+), 37 deletions(-)
Oh, interesting. This was failing before the patch?
The specific case I saw was two bundle arguments to one `bundles` list, but I guess the context that they were being duped in was actually per-BUILD-file?