Changeset 409

Show
Ignore:
Timestamp:
10/06/08 21:03:17 (3 months ago)
Author:
scooter.p..@gmail.com
Message:

Scott Michel:
Expand cusp's concept of compiler output to be more than just ".fasl". This
is in preparation for lisp implementation management.

Currently, only the compiler outputs known from SBCL (.fasl) and Clozure CL
(.dx86cl, .dfsl, .d64fsl) have been added. More will surely follow.

- Add new method to LispImplementation?.java: isCompilerOutput(). Tests if a

file name is actually a compiler output. The list of possible extensions
is maintained in LispImplementation?.

- Update LispResourceFilter? and CleanFaslsAction? so that compiler outputs

are properly filtered and deleted. (Note: Rename the CleanFaslsAction?
class to a more appropriate name...)

- Update plugin.xml and plugin.properties, "Delete fasls" -> "Delete compiler

output"

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/plugin.properties

    r375 r409  
    1515Action.LoadProject = Load Project 
    1616Action.LoadFile = Load file 
    17 Action.DeleteFASLs = Delete .fasl
     17Action.DeleteCompilerOutputs = Delete compiler output
    1818 
    1919LispViewsCategory = Lisp 
  • jasko.tim.lisp/plugin.xml

    r404 r409  
    206206                        <action 
    207207                                id="jasko.tim.lisp.navigator.CleanFaslsAction" 
    208                                 label="%Action.DeleteFASLs" 
     208                                label="%Action.DeleteCompilerOutputs" 
    209209                                icon="icons/clear.gif" 
    210210                                menubarPath="group.add" 
  • jasko.tim.lisp/src/jasko/tim/lisp/navigator/CleanFaslsAction.java

    r354 r409  
    55import jasko.tim.lisp.LispPlugin; 
    66import jasko.tim.lisp.swank.SwankInterface; 
     7import jasko.tim.lisp.swank.LispImplementation; 
    78 
    89import org.eclipse.core.resources.*; 
     
    6263                                        } else if (resource instanceof IFile) { 
    6364                                                IFile file = (IFile) resource; 
     65                                                String fname = file.getName(); 
    6466                                                 
    65                                                 if (file.exists() && file.getName().endsWith(".fasl")) { 
     67                                                if (file.exists() && LispImplementation.isCompilerOutput(fname)) { 
    6668                                                        file.delete(true, monitor); 
    6769                                                } 
  • jasko.tim.lisp/src/jasko/tim/lisp/navigator/LispResourceFilter.java

    r11 r409  
    44import org.eclipse.jface.viewers.Viewer; 
    55import org.eclipse.ui.views.navigator.ResourcePatternFilter; 
     6import jasko.tim.lisp.swank.LispImplementation; 
    67 
    78 
     
    1718                                        || fileName.equals(".DS_Store") 
    1819                                        || fileName.endsWith(".fas") 
    19                                         || fileName.endsWith(".fasl"
     20                                        || LispImplementation.isCompilerOutput(fileName
    2021                                        || fileName.endsWith("~") 
    2122                                        || fileName.endsWith(".lib")) { 
  • jasko.tim.lisp/src/jasko/tim/lisp/swank/LispImplementation.java

    r407 r409  
    1212        protected String flispType = ""; //possible values SBCL, CLISP etc. 
    1313        protected boolean hasthreads = true;  
     14        private static final String [] compilerOutputs = new String[] { 
     15                        ".fasl",                // SBCL compiler output 
     16                        ".dfsl",                // Clozure CL, openmcl output 
     17                        ".d64fsl",              // Same as above 
     18                        ".dx64fsl"              // Same as above 
     19        }; 
    1420         
    1521        // Probably lisp implementation specific - tested with SBCL 
     
    1925        public String lispType(){ return flispType; } 
    2026        public boolean hasThreads(){ return hasthreads; } 
     27         
     28        public static boolean isCompilerOutput(String lispFile) { 
     29                boolean result = false; 
     30                for (int i = 0; i < compilerOutputs.length && !result; ++i) { 
     31                        if (lispFile.endsWith(compilerOutputs[i])) 
     32                                result = true; 
     33                } 
     34                return result; 
     35        } 
    2136        /** 
    2237         * @return whether this instance is valid (ie can roll off a process)