Example usage for com.google.gwt.eclipse.core.preferences GWTPreferences computeSpeedTracerGeneratedFolderPath

List of usage examples for com.google.gwt.eclipse.core.preferences GWTPreferences computeSpeedTracerGeneratedFolderPath

Introduction

In this page you can find the example usage for com.google.gwt.eclipse.core.preferences GWTPreferences computeSpeedTracerGeneratedFolderPath.

Prototype

public static IPath computeSpeedTracerGeneratedFolderPath(IPath warOutLocation) 

Source Link

Document

Returns the folder path where the genfiles from the gwt compile are located.

Usage

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

License:Open Source License

private static boolean needsGenFiles(IPath warOutLocation) {
    IPath genFilesPath = GWTPreferences.computeSpeedTracerGeneratedFolderPath(warOutLocation);
    File genFilesFile = genFilesPath.toFile();
    return !ResourceUtils.folderExistsAndHasContents(genFilesFile);
}

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  . java 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();
    }
}