Esempio n. 1
0
  @Override
  public void close() throws InterruptedException, BuildFileParseException {
    stdout.close();
    stderr.close();

    BuildFileParseException lastSeen = null;
    try {
      closer.close();
    } catch (IOException e) {
      if (e.getCause() instanceof BuildFileParseException) {
        lastSeen = (BuildFileParseException) e.getCause();
      }
      if (e.getCause() instanceof InterruptedException) {
        throw (InterruptedException) e.getCause();
      }
      Throwables.propagate(e);
    }

    LOG.debug(
        "Cleaning cache of build files with inputs under symlink %s", buildInputPathsUnderSymlink);
    Set<Path> buildInputPathsUnderSymlinkCopy = new HashSet<>(buildInputPathsUnderSymlink);
    buildInputPathsUnderSymlink.clear();
    for (Path buildFilePath : buildInputPathsUnderSymlinkCopy) {
      permState.invalidatePath(buildFilePath);
    }

    if (lastSeen != null) {
      throw lastSeen;
    }
  }
Esempio n. 2
0
  @Override
  public ImmutableSet<TargetNode<?>> getAllTargetNodes(Cell cell, Path buildFile)
      throws InterruptedException, IOException, BuildFileParseException {
    Preconditions.checkState(buildFile.startsWith(cell.getRoot()));

    ProjectBuildFileParser parser = getBuildFileParser(cell);

    return permState.getAllTargetNodes(eventBus, cell, parser, buildFile, symlinkCheckers);
  }
Esempio n. 3
0
  @Override
  public ImmutableList<Map<String, Object>> getAllRawNodes(Cell cell, Path buildFile)
      throws InterruptedException, BuildFileParseException {
    Preconditions.checkState(buildFile.startsWith(cell.getRoot()));

    ProjectBuildFileParser parser = getBuildFileParser(cell);

    // The raw nodes are just plain JSON blobs, and so we don't need to check for symlinks
    return permState.getAllRawNodes(cell, parser, buildFile);
  }
Esempio n. 4
0
  @Override
  public TargetNode<?> getTargetNode(BuildTarget target)
      throws BuildFileParseException, BuildTargetException, InterruptedException, IOException {
    Cell owningCell = getCell(target);
    target = target.withoutCell();

    ProjectBuildFileParser parser = getBuildFileParser(owningCell);

    return permState.getTargetNode(eventBus, owningCell, parser, target, symlinkCheckers);
  }