Package javax.tools.JavaCompiler

Examples of javax.tools.JavaCompiler.CompilationTask.call()


   
    CompilationTask cTask = compiler.getTask(null, fileManager, null, null,
        null,
        fileManager.getJavaFileObjects(
            javaFiles.toArray(new File[javaFiles.size()])));
    assertTrue(cTask.call());
  }
}
View Full Code Here


         }
      }
      // Get a CompliationTask from the compiler and compile the sources
      final CompilationTask task = compiler.getTask(null, javaFileManager, diagnostics,
            options, null, sources);
      final Boolean result = task.call();
      if (result == null || !result.booleanValue()) {
         throw new JavaCompilerException("Compilation failed.", classes
               .keySet(), diagnostics);
      }
      try {
View Full Code Here

                    files,
                    null,
                    arguments,
                    Collections.<String>emptyList(),
                    files.getJavaFileObjectsFromFiles(sourceFiles));
            if (task.call() == false) {
                LOG.error("Compilation Failed");
            }
        } finally {
            files.close();
        }
View Full Code Here

                    diagnostics,
                    arguments,
                    Collections.<String>emptyList(),
                    fileManager.getJavaFileObjectsFromFiles(sources));

            Boolean succeeded = task.call();
            pw.close();
            for (Diagnostic<?> diagnostic : diagnostics.getDiagnostics()) {
                switch (diagnostic.getKind()) {
                case ERROR:
                case MANDATORY_WARNING:
View Full Code Here

            Arrays.<String>asList(),
            targets);

        task.setProcessors(processors);

        task.call();
        return collector.getDiagnostics();
    }

    /**
     * 現在までのコンパイル結果を元にしたクラスローダーを生成して返す。
 
View Full Code Here

                    diagnostics,
                    arguments,
                    Collections.<String>emptyList(),
                    emitter.getEmitted());

            Boolean successed = task.call();
            pw.close();
            for (Diagnostic<?> diagnostic : diagnostics.getDiagnostics()) {
                switch (diagnostic.getKind()) {
                case ERROR:
                case MANDATORY_WARNING:
View Full Code Here

      try {
        ContractJavaCompiler compiler =
            new ContractJavaCompiler(sourcePath, classPath, outputDirectory);
        CompilationTask task = compiler.getTask(sources, diagnosticManager);
        success = task.call();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here

        fileManager,
        null,
        buildArguments(Arrays.asList(ErrorProneOptions.processArgs(args).getRemainingArgs())),
        null,
        sources);
    boolean result = task.call();
    assertTrue(String.format("Test program failed to compile with non error-prone error: %s",
        outputStream.toString()), result);
  }

  public static <T> com.sun.tools.javac.util.List<T> asJavacList(Iterable<? extends T> xs) {
View Full Code Here

    String classpath =GlobalValues.jarFilePath+File.pathSeparatorChar+pathOfFile+File.pathSeparatorChar+".";
    Iterable <String> options = Arrays.asList("-cp", classpath);
   
    CompilationTask task = compiler.getTask(compileWriter, fileManager, null, options, null, compilationUnits);
  
    boolean compileResult = task.call();
    if (compileResult == false) {
        compilationResult = false// compilation errors
        JFrame compResultsFrame = new JFrame("Compilation Results");
        String diagnString = compileWriter.toString();
        JTextArea compResultsArea = new JTextArea(diagnString);
View Full Code Here

        final JavaFileManager fileManager = new JciJavaFileManager(units, pStore);
        final DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>();

        CompilationTask task = compiler.getTask(null, fileManager, diagnostics, null, null, units);

        if (task.call().booleanValue()) {
            log.debug("compiled");
        }

        final List<Diagnostic<? extends JavaFileObject>> jsrProblems = diagnostics.getDiagnostics();
        final CompilationProblem[] problems = new CompilationProblem[jsrProblems.size()];
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.