Example usage for com.google.gwt.eclipse.core.compile GWTCompileSettings setExtraArgs

List of usage examples for com.google.gwt.eclipse.core.compile GWTCompileSettings setExtraArgs

Introduction

In this page you can find the example usage for com.google.gwt.eclipse.core.compile GWTCompileSettings setExtraArgs.

Prototype

public void setExtraArgs(String args) 

Source Link

Usage

From source file:com.google.gdt.eclipse.suite.launch.SpeedTracerLaunchDelegate.java

License:Open Source License

private void performGwtCompile(IProject project, File extraDir, List<String> modules, IPath warOutLocation,
        IProgressMonitor monitor) throws CoreException, IOException, InterruptedException {

    monitor.beginTask("Performing GWT compile...", 100);

    try {//  w  w  w  .  j  a  v a 2 s . co  m
        GWTCompileSettings compileSettings = GWTProjectProperties.getGwtCompileSettings(project);
        compileSettings.setEntryPointModules(
                !modules.isEmpty() ? modules : GWTProjectProperties.getEntryPointModules(project));
        compileSettings.setExtraArgs("-extra " + StringUtilities.quote(extraDir.getAbsolutePath()) + " -gen "
                + StringUtilities.quote(
                        GWTPreferences.computeSpeedTracerGeneratedFolderPath(warOutLocation).toOSString()));

        // Get a message console for GWT compiler output
        CustomMessageConsole messageConsole = showGwtCompilationConsole(project);
        OutputStream consoleOutputStream = messageConsole.newMessageStream();

        TerminateProcessAction terminateAction = new TerminateProcessAction();
        messageConsole.setTerminateAction(terminateAction);

        try {
            GWTCompileRunner.compileWithCancellationSupport(JavaCore.create(project), warOutLocation,
                    compileSettings, consoleOutputStream, terminateAction, monitor, terminateAction);
        } finally {
            try {
                assert (consoleOutputStream != null);
                consoleOutputStream.close();
            } catch (IOException e) {
                // Ignore IOExceptions during stream close
            }
        }

        // refresh so that eclipse picks up on the gen files 
        project.refreshLocal(IResource.DEPTH_INFINITE, null);

    } finally {
        monitor.done();
    }
}