Package org.sonar.api.batch.fs

Examples of org.sonar.api.batch.fs.FileSystem


  private void processLine(File coverPerTest, int lineNumber, SensorContext context, String line, InputFile file) {
    try {
      Iterator<String> split = Splitter.on(":").split(line).iterator();
      String otherFileRelativePath = split.next();
      FileSystem fs = context.fileSystem();
      InputFile otherFile = fs.inputFile(fs.predicates().hasRelativePath(otherFileRelativePath));
      if (otherFile == null) {
        throw new IllegalStateException("Unable to find file " + otherFileRelativePath);
      }
      int weight = Integer.parseInt(split.next());
      context.newDependency()
View Full Code Here


      .workOnFileTypes(InputFile.Type.MAIN);
  }

  @Override
  public void execute(SensorContext context) {
    FileSystem fs = context.fileSystem();
    FilePredicates p = fs.predicates();
    for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(InputFile.Type.MAIN)))) {
      processDependencies(file, context);
    }
  }
View Full Code Here

      .workOnFileTypes(InputFile.Type.TEST);
  }

  @Override
  public void execute(SensorContext context) {
    FileSystem fs = context.fileSystem();
    FilePredicates p = fs.predicates();
    for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(InputFile.Type.TEST)))) {
      processFileTestPlan(file, context);
    }
  }
View Full Code Here

  private void processLine(File coverPerTest, int lineNumber, SensorContext context, String line, InputFile testFile) {
    try {
      Iterator<String> split = Splitter.on(":").split(line).iterator();
      String testCaseName = split.next();
      String mainFileRelativePath = split.next();
      FileSystem fs = context.fileSystem();
      InputFile mainFile = fs.inputFile(fs.predicates().hasRelativePath(mainFileRelativePath));
      if (mainFile == null) {
        throw new IllegalStateException("Unable to find file " + mainFileRelativePath);
      }
      List<Integer> coveredLines = new ArrayList<Integer>();
      Iterator<String> lines = Splitter.on(",").split(split.next()).iterator();
View Full Code Here

      .workOnFileTypes(InputFile.Type.TEST);
  }

  @Override
  public void execute(SensorContext context) {
    FileSystem fs = context.fileSystem();
    FilePredicates p = fs.predicates();
    for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(InputFile.Type.TEST)))) {
      processCoveragePerTest(file, context);
    }
  }
View Full Code Here

    this.configuration = configuration;
  }

  @Override
  public void blame(final BlameInput input, final BlameOutput output) {
    FileSystem fs = input.fileSystem();
    LOG.debug("Working directory: " + fs.baseDir().getAbsolutePath());
    ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1);
    List<Future<Void>> tasks = new ArrayList<Future<Void>>();
    for (InputFile inputFile : input.filesToBlame()) {
      tasks.add(submitTask(fs, output, executorService, inputFile));
    }
View Full Code Here

    this.commandExecutor = commandExecutor;
  }

  @Override
  public void blame(BlameInput input, BlameOutput output) {
    FileSystem fs = input.fileSystem();
    LOG.debug("Working directory: " + fs.baseDir().getAbsolutePath());
    ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() + 1);
    List<Future<Void>> tasks = new ArrayList<Future<Void>>();
    for (InputFile inputFile : input.filesToBlame()) {
      tasks.add(submitTask(fs.baseDir(), output, inputFile, executorService));
    }
    for (Future<Void> task : tasks) {
      try {
        task.get();
      } catch (ExecutionException e) {
View Full Code Here

TOP

Related Classes of org.sonar.api.batch.fs.FileSystem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.