path = os.path.join(self.root_dir, relpath) if relpath else self.root_dir
self._build_basename = self._BUILD_FILE_PREFIX
buildfile = os.path.join(path, self._build_basename) if self._isdir(path) else path
// There is no BUILD file without a prefix so select any viable sibling
if not self._exists(buildfile) or self._isdir(buildfile):
for build in self._get_all_build_files(os.path.dirname(buildfile)):
After Change
buildfile = path
// There is no BUILD file without a prefix so select any viable sibling
buildfile_relpath = fast_relpath(buildfile, self.root_dir)
if not project_tree.exists(buildfile_relpath) or project_tree.isdir(buildfile_relpath):
for build in self._get_all_build_files(os.path.dirname(buildfile)):
self._build_basename = build
buildfile = os.path.join(path, self._build_basename)