mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-09 18:15:23 +02:00
229992: add flag for deletion
This commit is contained in:
parent
c6ce322757
commit
35e40a0f8e
1 changed files with 15 additions and 1 deletions
|
@ -41,13 +41,23 @@ public class GeneratePDOM implements ISafeRunnable {
|
||||||
protected String[] applicationArguments;
|
protected String[] applicationArguments;
|
||||||
protected File targetLocation;
|
protected File targetLocation;
|
||||||
protected String indexerID;
|
protected String indexerID;
|
||||||
|
protected boolean deleteOnExit;
|
||||||
|
|
||||||
public GeneratePDOM(IExportProjectProvider pm, String[] applicationArguments, File targetLocation, String indexerID) {
|
public GeneratePDOM(IExportProjectProvider pm, String[] applicationArguments, File targetLocation, String indexerID) {
|
||||||
this.pm= pm;
|
this.pm= pm;
|
||||||
this.applicationArguments= applicationArguments;
|
this.applicationArguments= applicationArguments;
|
||||||
this.targetLocation= targetLocation;
|
this.targetLocation= targetLocation;
|
||||||
this.indexerID= indexerID;
|
this.indexerID= indexerID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When set, the project created by the associated {@link IExportProjectProvider} will
|
||||||
|
* be deleted after {@link #run()} completes. By default this is not set.
|
||||||
|
* @param deleteOnExit
|
||||||
|
*/
|
||||||
|
public void setDeleteOnExit(boolean deleteOnExit) {
|
||||||
|
this.deleteOnExit= deleteOnExit;
|
||||||
|
}
|
||||||
|
|
||||||
public final void run() throws CoreException {
|
public final void run() throws CoreException {
|
||||||
pm.setApplicationArguments(applicationArguments);
|
pm.setApplicationArguments(applicationArguments);
|
||||||
|
@ -97,6 +107,10 @@ public class GeneratePDOM implements ISafeRunnable {
|
||||||
} catch(InterruptedException ie) {
|
} catch(InterruptedException ie) {
|
||||||
String msg= MessageFormat.format(Messages.GeneratePDOM_GenericGenerationFailed, new Object[] {ie.getMessage()});
|
String msg= MessageFormat.format(Messages.GeneratePDOM_GenericGenerationFailed, new Object[] {ie.getMessage()});
|
||||||
throw new CoreException(CCorePlugin.createStatus(msg, ie));
|
throw new CoreException(CCorePlugin.createStatus(msg, ie));
|
||||||
|
} finally {
|
||||||
|
if(deleteOnExit) {
|
||||||
|
cproject.getProject().delete(true, new NullProgressMonitor());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue