- // System.out.println(compilerArgs);
-
- CompilationProgress compilationProgress = new CompilationProgress() {
- int totalWork;
- long currentChunk = 0;
-
- long chunksCount = 80;
-
- @Override
- public void worked(int workIncrement, int remainingWork) {
- long chunk = ((totalWork - remainingWork) * chunksCount) / totalWork;
- if (chunk != currentChunk) {
- currentChunk = chunk;
- for (long i = 0; i < currentChunk; i++) {
- System.out.print("#");
- }
- for (long i = currentChunk; i < chunksCount; i++) {
- System.out.print("-");
- }
- System.out.print("\r");
- }
- if (remainingWork == 0)
- System.out.print("\n");
- }
-
- @Override
- public void setTaskName(String name) {
- }
-
- @Override
- public boolean isCanceled() {
- return false;
- }
-
- @Override
- public void done() {
- }
-
- @Override
- public void begin(int remainingWork) {
- this.totalWork = remainingWork;
- }
- };
- // Use Main instead of BatchCompiler to workaround the fact that
- // org.eclipse.jdt.core.compiler.batch is not exported
- boolean success = org.eclipse.jdt.internal.compiler.batch.Main.compile(