Skip to content

Commit

Permalink
Fix missing search&replace of .buildfile -> .build_file
Browse files Browse the repository at this point in the history
Find cases of .buildfile and replace with .build_file.  Running python tests with coverage was broken.

Testing Done:
Ran python tests with PANTS_PY_COVERAGE=1

Reviewed at https://rbcommons.com/s/twitter/r/593/
  • Loading branch information
wickman authored and Patrick Lawson committed Jun 25, 2014
1 parent 6befa97 commit b4a3f30
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/python/pants/backend/core/tasks/build_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def execute(self):
def add_buildfile_for_target(target, genmap):
missing_dep_map = genmap[target]
missing_deps = missing_dep_map[self.context._buildroot] if missing_dep_map else defaultdict(list)
buildfile_paths[target.address.buildfile.full_path][target.name] += missing_deps
buildfile_paths[target.address.build_file.full_path][target.name] += missing_deps

if self.transitive:
targets = self.context.targets()
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/core/tasks/pathdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

class PathDeps(ConsoleTask):
def console_output(self, targets):
return set(t.address.buildfile.parent_path for t in targets if hasattr(t, 'address'))
return set(t.address.build_file.parent_path for t in targets if hasattr(t, 'address'))
8 changes: 4 additions & 4 deletions src/python/pants/backend/jvm/tasks/ide_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,12 @@ def configure_target(target):
# this target globs children as well. Gather all these candidate BUILD files to test for
# sources they own that live in the directories this targets sources live in.
target_dirset = find_source_basedirs(target)
candidates = Target.get_all_addresses(target.address.buildfile)
for ancestor in target.address.buildfile.ancestors():
candidates = Target.get_all_addresses(target.address.build_file)
for ancestor in target.address.build_file.ancestors():
candidates.update(Target.get_all_addresses(ancestor))
for sibling in target.address.buildfile.siblings():
for sibling in target.address.build_file.siblings():
candidates.update(Target.get_all_addresses(sibling))
for descendant in target.address.buildfile.descendants():
for descendant in target.address.build_file.descendants():
candidates.update(Target.get_all_addresses(descendant))

def is_sibling(target):
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/jvm/tasks/jar_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,15 @@ def parse_jarcoordinate(coordinate):
try:
target = Target.get(address)
if not target:
siblings = Target.get_all_addresses(address.buildfile)
siblings = Target.get_all_addresses(address.build_file)
prompt = 'did you mean' if len(siblings) == 1 else 'maybe you meant one of these'
raise TaskError('%s => %s?:\n %s' % (address, prompt,
'\n '.join(str(a) for a in siblings)))
if not target.is_exported:
raise TaskError('%s is not an exported target' % coordinate)
return target.provides.org, target.provides.name
except (ImportError, SyntaxError, TypeError):
raise TaskError('Failed to parse %s' % address.buildfile.relpath)
raise TaskError('Failed to parse %s' % address.build_file.relpath)
except IOError:
raise TaskError('No BUILD file could be found at %s' % coordinate)

Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/python/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def generate_coverage_config(targets):
cp.add_section('html')
if len(targets) == 1:
target = targets[0]
relpath = os.path.join(os.path.dirname(target.address.buildfile.relpath), target.name)
relpath = os.path.join(os.path.dirname(target.address.build_file.relpath), target.name)
else:
relpath = Target.maybe_readable_identify(targets)
target_dir = os.path.join(Config.load().getdefault('pants_distdir'), 'coverage', relpath)
Expand Down Expand Up @@ -126,7 +126,7 @@ def generate_junit_args(targets):
xml_base = os.path.abspath(os.path.normpath(xml_base))
if len(targets) == 1:
target = targets[0]
relpath = os.path.join(os.path.dirname(target.address.buildfile.relpath),
relpath = os.path.join(os.path.dirname(target.address.build_file.relpath),
target.name + '.xml')
else:
relpath = Target.maybe_readable_identify(targets) + '.xml'
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/pants_doc/doc_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def build(self, targets, _):
template = pkgutil.get_data(__name__, template_path)
for target in targets:
assert is_doc(target), 'DocBuilder can only build DocTargets, given %s' % str(target)
base_dir = os.path.dirname(target.address.buildfile.full_path)
base_dir = os.path.dirname(target.address.build_file.full_path)
target_base = target.target_base
print('building doc for %s' % str(target))
output_dir = os.path.normpath(os.path.join(self.root_dir, target.id))
Expand Down

0 comments on commit b4a3f30

Please sign in to comment.