Commit e76dad7e authored by Adam Knapp's avatar Adam Knapp

Merge branch 'master' into 'master'

change invokeBuild

See merge request eclipse/titan/titan.EclipsePlug-ins!626
parents 24e2bdd0 e71bbf8d
......@@ -8,11 +8,15 @@
package org.eclipse.titan.designer.application;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.titan.designer.core.TITANBuilder;
import org.eclipse.titan.common.logging.ErrorReporter;
/**
* Externally callable application, that takes exactly one argument: the name of the project it should build.
......@@ -34,12 +38,22 @@ public final class InvokeBuild implements IApplication {
final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (final IProject project : projects) {
if (project.getName().equals(projectNames[0])) {
TITANBuilder.invokeBuild(project);
if (project != null && project.getName().equals(projectNames[0])) {
try {
project.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
ErrorReporter.logExceptionStackTrace(e);
}
project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
try {
ResourcesPlugin.getWorkspace().save(true, null);
} catch (CoreException e) {
ErrorReporter.logExceptionStackTrace("Error while closing workspace",e);
}
return EXIT_OK;
}
}
System.out.println("The project with name `" + projectNames[0] + "' could not be found.");
return Integer.valueOf(-1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment