def execute(self): for buildfile in BuildFile.scan_buildfiles(self.root_dir): for address in Target.get_all_addresses(buildfile): target = Target.get(address) if hasattr(target, 'sources'): for sourcefile in target.sources: print sourcefile, address
def scan_addresses(root_dir, base_path=None): """Parses all targets available in BUILD files under base_path and returns their addresses. If no base_path is specified, root_dir is assumed to be the base_path""" addresses = OrderedSet() for buildfile in BuildFile.scan_buildfiles(root_dir, base_path): addresses.update(Target.get_all_addresses(buildfile)) return addresses
def scan_addresses(root_dir, base_path = None): """Parses all targets available in BUILD files under base_path and returns their addresses. If no base_path is specified, root_dir is assumed to be the base_path""" addresses = OrderedSet() for buildfile in BuildFile.scan_buildfiles(root_dir, base_path): addresses.update(Target.get_all_addresses(buildfile)) return addresses
def _parse_buildfiles(self): buildfiles = OrderedSet() for spec in self.args: try: if self.options.is_directory_list: for buildfile in BuildFile.scan_buildfiles(self.root_dir, spec): buildfiles.add(buildfile) else: buildfiles.add(Address.parse(self.root_dir, spec).buildfile) except: self.error("Problem parsing spec %s: %s" % (spec, traceback.format_exc())) return buildfiles
def __init__(self, root_dir, parser, argv): Command.__init__(self, root_dir, parser, argv) self.buildfiles = self._parse_buildfiles() if self.args else BuildFile.scan_buildfiles(root_dir)
def __init__(self, root_dir, parser, argv): Command.__init__(self, root_dir, parser, argv) self.buildfiles = self._parse_buildfiles( ) if self.args else BuildFile.scan_buildfiles(root_dir)