Changeset 3779 for devel-tools


Ignore:
Timestamp:
May 24, 2008, 1:46:48 PM (12 years ago)
Author:
yura
Message:
  • Cleaning output folder.
Location:
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpBuilder.java

    r3778 r3779  
    297297    }
    298298
    299     @Override
    300     protected void clean (IProgressMonitor monitor) throws CoreException {
    301         IProject project = getProject();
    302         project.deleteMarkers(RfpCore.MARKER_ID, false, IResource.DEPTH_INFINITE);
    303         // We are relying on JavaBuilder for cleaning.
    304         // project.accept(new IResourceVisitor() {
    305         // public boolean visit (IResource resource) throws CoreException {
    306         // if (isRfFile(resource))
    307         // deleteClassFiles((IFile) resource);
    308         // return true;
    309         // }
    310         // });
    311     }
    312 
    313299    @SuppressWarnings("unchecked")
    314300    private void checkAndCompileModuleImplem (IResource resource) {
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpPreBuilder.java

    r3778 r3779  
    155155    @Override
    156156    protected void clean (IProgressMonitor monitor) throws CoreException {
    157         // FIXME!
    158         IProject project = getProject();
    159         project.deleteMarkers(RfpCore.MARKER_ID, false, IResource.DEPTH_INFINITE);
     157        getProject().deleteMarkers(RfpCore.MARKER_ID, false, IResource.DEPTH_INFINITE);
     158        getRfpProject().cleanOutputFolder();
    160159        // We are relying on JavaBuilder for cleaning.
    161160        // project.accept(new IResourceVisitor() {
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpProject.java

    r3778 r3779  
    88import org.eclipse.core.resources.IResource;
    99import org.eclipse.core.resources.IResourceStatus;
     10import org.eclipse.core.resources.IResourceVisitor;
    1011import org.eclipse.core.resources.IWorkspaceRoot;
    1112import org.eclipse.core.runtime.CoreException;
     
    1415import org.eclipse.jdt.core.IJavaProject;
    1516import org.eclipse.jdt.core.JavaCore;
    16 import org.eclipse.jdt.core.JavaModelException;
    1717
    1818public class RfpProject {
     
    4141    public IFile getFile (IPath path) {
    4242        return workspaceRoot.getFile(path);
     43    }
     44
     45    public void cleanOutputFolder () {
     46        try {
     47            IFolder folder = workspaceRoot.getFolder(javaProject.getOutputLocation());
     48            folder.accept(new IResourceVisitor() {
     49                public boolean visit (IResource resource) throws CoreException {
     50                    if (resource.getType() == IResource.FILE && resource.getFileExtension().equals("class")) {
     51                        resource.delete(IResource.FORCE, null);
     52                        return false;
     53                    }
     54                    return true;
     55                }
     56            });
     57        } catch (CoreException e) {
     58            RfpCore.log(e);
     59        }
    4360    }
    4461
     
    97114            return workspaceRoot.getFile(javaProject.getOutputLocation()
    98115                    .append(moduleName.replace('.', '/') + ".class"));
    99         } catch (JavaModelException e) {
     116        } catch (CoreException e) {
    100117            RfpCore.log(e);
    101118        }
     
    113130                        return file;
    114131                }
    115         } catch (JavaModelException e) {
     132        } catch (CoreException e) {
    116133            RfpCore.log(e);
    117134        }
     
    134151                        return filePath.removeFirstSegments(entryPath.segmentCount()).toString().replace('/', '.');
    135152                }
    136         } catch (JavaModelException e) {
     153        } catch (CoreException e) {
    137154            RfpCore.log(e);
    138155        }
Note: See TracChangeset for help on using the changeset viewer.