Changeset 394

Show
Ignore:
Timestamp:
09/23/08 19:27:34 (4 months ago)
Author:
tjas..@bitfauna.com
Message:

Tim Jasko
-Fixed up the exe creation to work on Linux. Hope I didn't break it on windows.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/src/jasko/tim/lisp/swank/SBCLImplementation.java

    r318 r394  
    206206                        commandLine.add(executable.getPath()); 
    207207                        commandLine.add("--eval"); 
    208                         commandLine.add(LispUtil.cleanPackage(BreakpointAction.macro)); 
    209                         commandLine.add("--eval"); 
    210                         commandLine.add(LispUtil.cleanPackage(WatchAction.macro)); 
    211                         commandLine.add("--eval"); 
    212                         commandLine.add("\"(require 'asdf)\""); 
     208                        commandLine.add(LispUtil.cleanPackage(BreakpointAction.macro).replace("`", "\\`")); 
     209                        commandLine.add("--eval"); 
     210                        commandLine.add(LispUtil.cleanPackage(WatchAction.macro).replace("`", "\\`")); 
     211                        commandLine.add("--eval"); 
     212                        commandLine.add("(require 'asdf)"); 
    213213                        if(prefs.getBoolean(PreferenceConstants.USE_UNIT_TEST)){ 
    214214                                commandLine.add("--load"); 
    215                                 commandLine.add("\""+LispPlugin.getDefault().getPluginPath()  
    216                                                 + "lisp-extensions/lisp-unit.lisp\""); 
     215                                commandLine.add(LispPlugin.getDefault().getPluginPath()  
     216                                                + "lisp-extensions/lisp-unit.lisp"); 
    217217                        } 
    218218                        if(prefs.getBoolean(PreferenceConstants.MANAGE_PACKAGES)){ 
     
    222222                                                + "lisp-extensions/asdf-extensions.lisp"; 
    223223                                        commandLine.add("--load"); 
    224                                         commandLine.add("\""+asdfext+"\""); 
     224                                        commandLine.add(asdfext); 
    225225                                        commandLine.add("--eval"); 
    226                                         commandLine.add(LispUtil.cleanPackage(code)); 
     226                                        commandLine.add(code); 
    227227                                } 
    228228                                 
     
    238238                         
    239239                        commandLine.add("--load"); 
    240                         commandLine.add("\""+asdFile+"\""); 
     240                        commandLine.add(asdFile); 
    241241                        commandLine.add("--eval"); 
    242                         commandLine.add(LispUtil.cleanPackage("(asdf:oos 'asdf:load-op \""+asdName+"\")")); 
     242                        commandLine.add("(asdf:oos 'asdf:load-op \""+asdName+"\")"); 
    243243                         
    244244                        commandLine.add("--eval"); 
    245245                        if( pkg != null && !pkg.equals("") && !pkg.equalsIgnoreCase("nil")){ 
    246                                 commandLine.add(LispUtil.cleanPackage("(sb-ext:save-lisp-and-die \"" 
    247                                                 +exeFile+"\" :executable t :toplevel '"+pkg+"::"+toplevel+" :purify t)"));                             
     246                                commandLine.add("(sb-ext:save-lisp-and-die \"" 
     247                                                +exeFile+"\" :executable t :toplevel '"+pkg+"::"+toplevel+" :purify t)");                              
    248248                        } else { 
    249                                 commandLine.add(LispUtil.cleanPackage("(sb-ext:save-lisp-and-die \"" 
    250                                                 +exeFile.replace('\\', '/')+"\" :executable t :toplevel '"+toplevel+" :purify t)"));                           
     249                                commandLine.add("(sb-ext:save-lisp-and-die \"" 
     250                                                +exeFile.replace('\\', '/')+"\" :executable t :toplevel '"+toplevel+" :purify t)");                            
    251251                        } 
    252                          
     252 
     253                        commandLine.add("--eval"); 
     254                        commandLine.add("(print 1)"); 
     255                        commandLine.add("--eval"); 
     256                        commandLine.add("(print 2)"); 
    253257                        String[] cmd = new String[commandLine.size()]; 
    254258                        ProcessBuilder pb = new ProcessBuilder(commandLine.toArray(cmd)); 
     
    258262                                LispPlugin.getDefault().out("--- compilation command:"); 
    259263                                for(String str : cmd){ 
     264                                        System.out.println("$" + str); 
    260265                                        LispPlugin.getDefault().out(str); 
    261266                                } 
    262267                                LispPlugin.getDefault().out("--- compilation log:"); 
     268                                pb.redirectErrorStream(true); 
    263269                                Process p = pb.start(); 
    264                             BufferedReader is = new BufferedReader(new InputStreamReader(p.getInputStream())); 
     270                                BufferedReader is = new BufferedReader(new InputStreamReader(p.getInputStream())); 
     271                             
    265272                            String line; 
    266273                            while ((line = is.readLine()) != null){ 
    267274                                        LispPlugin.getDefault().out(line); 
    268275                                        if( line.contains("[QUIT ") ){ //ended up in debugger 
     276                                                /*BufferedReader es = new BufferedReader(new InputStreamReader(p.getErrorStream())); 
     277                                                String errline; 
     278                                            while ((errline = es.readLine()) != null){ 
     279                                                        LispPlugin.getDefault().out(errline); 
     280                                                        System.out.println(errline); 
     281                                            }*/ 
    269282                                                p.destroy(); 
    270283                                                LispPlugin.getDefault().out("=== Error.");                               
    271284                                                return false; 
     285                                        } else if (line.contains("DONE")) { 
     286                                                //hacky way to detect the finishing point. 
     287                                                break; 
    272288                                        } 
    273289                            } 
  • jasko.tim.lisp/src/jasko/tim/lisp/swank/SwankInterface.java

    r356 r394  
    18651865                                                        } 
    18661866                                                        System.out.print("]"); 
    1867                                                         System.out.print(curr); 
     1867                                                        System.out.println(curr); 
    18681868                                                        runFilters(curr); 
    18691869                                                        if(curr.toLowerCase().contains(implementation.fatalErrorString())){