Commits

Anonymous committed 5564c64

Added LocalLispLauncher.

  • Participants
  • Parent commits 93da7cc

Comments (0)

Files changed (4)

META-INF/MANIFEST.MF

 Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.lispdev.swank.SwankPlugin
 Require-Bundle: org.eclipse.core.runtime,
- org.junit4;bundle-version="4.5.0"
+ org.junit4;bundle-version="4.5.0",
+ org.lispdev.log;bundle-version="1.0.0"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Export-Package: org.lispdev.swank

src/org/lispdev/swank/LispImplementation.java

  */
 public abstract class LispImplementation
 {
-  protected boolean hasthreads = true;
-
   // Probably lisp implementation specific - tested with SBCL
   protected String fatalError = "fatal error";
 
   }
 
   /**
-   * @return true if lisp implementation is multithreaded
-   */
-  public boolean hasThreads()
-  {
-    return hasthreads;
-  }
-
-  /**
-   * @return whether this instance is valid (ie can roll off a process)
-   */
-  public abstract boolean isValid();
-
-  /**
    * @param msg
    * @return message wrapped into code that would not produce compilation
    * warnings

src/org/lispdev/swank/SBCLImplementation.java

  */
 public class SBCLImplementation extends LispImplementation
 {
-  /**
-   * @return whether an SBCL implementation can be found on the host computer
-   */
-  static public boolean existsOnSystem(String pluginDir)
-  {
-    return findExecutable(pluginDir) != null;
-  }
 
   /**
    *
     this.path = sbclDirectory;
     this.loadPath = loadPath;
     this.port = port;
-    if( System.getProperty("os.name").toLowerCase().contains("windows") )
-    {
-      hasthreads = false;
-    }
-  }
-
-  @Override
-  public boolean isValid()
-  {
-    return executable != null && path != null;
   }
 
   @Override
   @Override
   public Process start() throws IOException
   {
-    System.out.println("start");
+    ProcessBuilder pb;
+    String[] commandLine = new String[]{executable.getPath()
+    // ,"--dynamic-space-size", "50000" // simulate the error some windows
+    // users get
+         ,"--load", loadPath
+        };
 
-    if( isValid() )
-    {
-      ProcessBuilder pb;
-      String[] commandLine = new String[]{executable.getPath()
-      // ,"--dynamic-space-size", "50000" // simulate the error some windows
-      // users get
-           ,"--load", loadPath
-          };
-
-      pb = new ProcessBuilder(commandLine);
-      pb.environment().put("SBCL_HOME", path.getPath());
-      Process lispEngine = pb.start();
-      DataOutputStream commandInterface =
-        new DataOutputStream(lispEngine.getOutputStream());
-      commandInterface
-        .writeBytes("(swank-loader::init :load-contribs t :setup t)");
-      commandInterface.flush();
-      commandInterface
-        .writeBytes("(progn (swank:create-server :coding-system \"utf-8\" :port "
-            + port + "))\n");
-      commandInterface.flush();
-      return lispEngine;
-    }
-    return null;
+    pb = new ProcessBuilder(commandLine);
+    pb.environment().put("SBCL_HOME", path.getPath());
+    Process lispEngine = pb.start();
+    DataOutputStream commandInterface =
+      new DataOutputStream(lispEngine.getOutputStream());
+    commandInterface
+      .writeBytes("(swank-loader::init :load-contribs t :setup t)");
+    commandInterface.flush();
+    commandInterface
+      .writeBytes("(progn (swank:create-server :coding-system \"utf-8\" :port "
+          + port + "))\n");
+    commandInterface.flush();
+    return lispEngine;
   }
 }

src/org/lispdev/swank/SwankInterface.java

               + "(swank:swank-require :swank-presentations)\n";
       // + BreakpointAction.macro +"\n"+ WatchAction.macro+"\n";
 
-      final String plPath = pluginPath.replace("\\\\", "/").replace("\\", "/");
+      final String plPath = (pluginPath+"/").replace("\\\\", "/").replace("\\", "/").replace("//","/");
       String asdfext = plPath + "lisp-extensions/asdf-extensions.lisp";
       startupCode += "(load \"" + asdfext + "\")\n";