Example usage for org.eclipse.jdt.core.compiler CompilationProgress CompilationProgress

List of usage examples for org.eclipse.jdt.core.compiler CompilationProgress CompilationProgress

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.compiler CompilationProgress CompilationProgress.

Prototype

CompilationProgress

Source Link

Usage

From source file:com.liferay.mobile.sdk.core.MobileSDKBuilder.java

License:Open Source License

private static boolean compile(String sourceDir, String destDir) throws IOException {
    final List<String> args = new ArrayList<String>();

    args.add("-cp");

    final String jsonPath = libPath("jars/org.json_20131018.0.0.jar");
    final String sdkPath = libPath("jars/liferay-android-sdk-6.2.0.1.jar");

    args.add(jsonPath + File.pathSeparatorChar + sdkPath);

    args.add("-1.6");

    args.add("-d");
    args.add(destDir);/*ww w.  ja  v  a  2  s  .com*/

    args.add(sourceDir);

    final CompilationProgress progress = new CompilationProgress() {
        public void begin(int remainingWork) {
        }

        public void done() {
        }

        public boolean isCanceled() {
            return false;
        }

        public void setTaskName(String name) {
        }

        public void worked(int workIncrement, int remainingWork) {
        }
    };

    return BatchCompiler.compile(args.toArray(new String[0]), new PrintWriter(System.out),
            new PrintWriter(System.err), progress);
}