Example usage for org.eclipse.jdt.internal.compiler.batch FileSystem cleanup

List of usage examples for org.eclipse.jdt.internal.compiler.batch FileSystem cleanup

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.batch FileSystem cleanup.

Prototype

@Override
    public void cleanup() 

Source Link

Usage

From source file:org.thiesen.ecj4ant.EcjTask.java

License:Open Source License

@Override
public void execute() {
    final long startTime = System.currentTimeMillis();

    final List<String> sourceFilenames = getSourceFilenames();
    final List<String> classPathEntries = getClassPathEntries();

    final FileSystem environment = getLibraryAccess(sourceFilenames, classPathEntries);

    log("Checking " + sourceFilenames.size() + " source files");

    final CompilerOptions compilerOptions = makeCompilerOptions();

    log(compilerOptions.toString(), Project.MSG_VERBOSE);

    final BatchRequestor requestor = getBatchRequestor();

    final Compiler batchCompiler = new Compiler(environment, getHandlingPolicy(), compilerOptions, requestor,
            getProblemFactory(), getOutputWrapper(), null);

    compilerOptions.verbose = false;/*www.jav  a 2  s . co m*/

    batchCompiler.compile(getCompilationUnits(sourceFilenames));

    // cleanup
    environment.cleanup();

    final long endTime = System.currentTimeMillis() - startTime;

    log("Compile finished after " + endTime + "ms with " + requestor.getErrors() + " errors, "
            + requestor.getWarnings() + " warnings and " + requestor.getInfos() + " info messages");

    checkFailErrors(requestor.getErrors());
    checkFailWarnings(requestor.getWarnings());
}