From 35e40a0f8ef8a14f060cad17067481f2e64a4815 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Tue, 6 May 2008 09:50:27 +0000 Subject: [PATCH] 229992: add flag for deletion --- .../internal/core/pdom/export/GeneratePDOM.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOM.java index 022f5e5c103..a80899f47a4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOM.java @@ -41,13 +41,23 @@ public class GeneratePDOM implements ISafeRunnable { protected String[] applicationArguments; protected File targetLocation; protected String indexerID; - + protected boolean deleteOnExit; + public GeneratePDOM(IExportProjectProvider pm, String[] applicationArguments, File targetLocation, String indexerID) { this.pm= pm; this.applicationArguments= applicationArguments; this.targetLocation= targetLocation; 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 { pm.setApplicationArguments(applicationArguments); @@ -97,6 +107,10 @@ public class GeneratePDOM implements ISafeRunnable { } catch(InterruptedException ie) { String msg= MessageFormat.format(Messages.GeneratePDOM_GenericGenerationFailed, new Object[] {ie.getMessage()}); throw new CoreException(CCorePlugin.createStatus(msg, ie)); + } finally { + if(deleteOnExit) { + cproject.getProject().delete(true, new NullProgressMonitor()); + } } }