Changeset 398

Show
Ignore:
Timestamp:
09/24/08 12:39:25 (4 months ago)
Author:
sergey.kol..@gmail.com
Message:

Sergey Kolos:

  • Fixed create exe to work on windows.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/META-INF/MANIFEST.MF

    r375 r398  
    33Bundle-Name: %Bundle-Name.0 
    44Bundle-SymbolicName: jasko.tim.lisp; singleton:=true 
    5 Bundle-Version: 0.9.375 
     5Bundle-Version: 0.9.390 
    66Bundle-ClassPath: cusp.jar 
    77Bundle-Activator: jasko.tim.lisp.LispPlugin 
  • jasko.tim.lisp/plugin.xml

    r380 r398  
    341341                        class="jasko.tim.lisp.navigator.LispNavigator" /> 
    342342        </extension> 
    343          
    344  
    345343 
    346344        <!-- Decorator --> 
  • jasko.tim.lisp/src/jasko/tim/lisp/swank/SBCLImplementation.java

    r394 r398  
    204204                         
    205205                        ArrayList<String> commandLine = new ArrayList<String>(); 
    206                         commandLine.add(executable.getPath()); 
    207                         commandLine.add("--eval"); 
    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)"); 
    213                         if(prefs.getBoolean(PreferenceConstants.USE_UNIT_TEST)){ 
    214                                 commandLine.add("--load"); 
    215                                 commandLine.add(LispPlugin.getDefault().getPluginPath()  
    216                                                 + "lisp-extensions/lisp-unit.lisp"); 
     206                         
     207                        if (System.getProperty("os.name").toLowerCase().contains("windows")) { 
     208                                commandLine.add(executable.getPath()); 
     209                                commandLine.add("--eval"); 
     210                                commandLine.add(LispUtil.cleanPackage(BreakpointAction.macro)); 
     211                                commandLine.add("--eval"); 
     212                                commandLine.add(LispUtil.cleanPackage(WatchAction.macro)); 
     213                                commandLine.add("--eval"); 
     214                                commandLine.add("\"(require 'asdf)\""); 
     215                                if(prefs.getBoolean(PreferenceConstants.USE_UNIT_TEST)){ 
     216                                        commandLine.add("--load"); 
     217                                        commandLine.add("\""+LispPlugin.getDefault().getPluginPath()  
     218                                                        + "lisp-extensions/lisp-unit.lisp\""); 
     219                                } 
     220                                if(prefs.getBoolean(PreferenceConstants.MANAGE_PACKAGES)){ 
     221                                        String code = LispPlugin.getDefault().getLibsPathRegisterCode(); 
     222                                        if( !code.equals("")){ 
     223                                                String asdfext = LispPlugin.getDefault().getPluginPath()  
     224                                                        + "lisp-extensions/asdf-extensions.lisp"; 
     225                                                commandLine.add("--load"); 
     226                                                commandLine.add("\""+asdfext+"\""); 
     227                                                commandLine.add("--eval"); 
     228                                                commandLine.add(LispUtil.cleanPackage(code)); 
     229                                        } 
     230                                         
     231                                } 
     232                                asdFile = asdFile.replace('\\', '/'); 
     233                                asdFile = translateLocalFilePath(asdFile); 
     234                                String[] fpathparts = asdFile.split("/"); 
     235                                if( fpathparts.length <= 0 || !fpathparts[fpathparts.length-1].matches(".+\\.asd") ){ 
     236                                        LispPlugin.getDefault().out("=== Error - no project (.asd) file found.");        
     237                                        return false; 
     238                                } 
     239                                String asdName = fpathparts[fpathparts.length-1].replace(".asd", ""); 
     240                                 
     241                                commandLine.add("--load"); 
     242                                commandLine.add("\""+asdFile+"\""); 
     243                                commandLine.add("--eval"); 
     244                                commandLine.add(LispUtil.cleanPackage("(asdf:oos 'asdf:load-op \""+asdName+"\")")); 
     245                                 
     246                                commandLine.add("--eval"); 
     247                                if( pkg != null && !pkg.equals("") && !pkg.equalsIgnoreCase("nil")){ 
     248                                        commandLine.add(LispUtil.cleanPackage("(sb-ext:save-lisp-and-die \"" 
     249                                                        +exeFile+"\" :executable t :toplevel '"+pkg+"::"+toplevel+" :purify t)"));                               
     250                                } else { 
     251                                        commandLine.add(LispUtil.cleanPackage("(sb-ext:save-lisp-and-die \"" 
     252                                                        +exeFile.replace('\\', '/')+"\" :executable t :toplevel '"+toplevel+" :purify t)"));                             
     253                                } 
     254 
     255                                commandLine.add("--eval"); 
     256                                commandLine.add("(print 1)"); 
     257                                commandLine.add("--eval"); 
     258                                commandLine.add("(print 2)"); 
     259                        } else { 
     260                                commandLine.add(executable.getPath()); 
     261                                commandLine.add("--eval"); 
     262                                commandLine.add(LispUtil.cleanPackage(BreakpointAction.macro).replace("`", "\\`")); 
     263                                commandLine.add("--eval"); 
     264                                commandLine.add(LispUtil.cleanPackage(WatchAction.macro).replace("`", "\\`")); 
     265                                commandLine.add("--eval"); 
     266                                commandLine.add("(require 'asdf)"); 
     267                                if(prefs.getBoolean(PreferenceConstants.USE_UNIT_TEST)){ 
     268                                        commandLine.add("--load"); 
     269                                        commandLine.add(LispPlugin.getDefault().getPluginPath()  
     270                                                        + "lisp-extensions/lisp-unit.lisp"); 
     271                                } 
     272                                if(prefs.getBoolean(PreferenceConstants.MANAGE_PACKAGES)){ 
     273                                        String code = LispPlugin.getDefault().getLibsPathRegisterCode(); 
     274                                        if( !code.equals("")){ 
     275                                                String asdfext = LispPlugin.getDefault().getPluginPath()  
     276                                                        + "lisp-extensions/asdf-extensions.lisp"; 
     277                                                commandLine.add("--load"); 
     278                                                commandLine.add(asdfext); 
     279                                                commandLine.add("--eval"); 
     280                                                commandLine.add(code); 
     281                                        } 
     282                                         
     283                                } 
     284                                asdFile = asdFile.replace('\\', '/'); 
     285                                asdFile = translateLocalFilePath(asdFile); 
     286                                String[] fpathparts = asdFile.split("/"); 
     287                                if( fpathparts.length <= 0 || !fpathparts[fpathparts.length-1].matches(".+\\.asd") ){ 
     288                                        LispPlugin.getDefault().out("=== Error - no project (.asd) file found.");        
     289                                        return false; 
     290                                } 
     291                                String asdName = fpathparts[fpathparts.length-1].replace(".asd", ""); 
     292                                 
     293                                commandLine.add("--load"); 
     294                                commandLine.add(asdFile); 
     295                                commandLine.add("--eval"); 
     296                                commandLine.add("(asdf:oos 'asdf:load-op \""+asdName+"\")"); 
     297                                 
     298                                commandLine.add("--eval"); 
     299                                if( pkg != null && !pkg.equals("") && !pkg.equalsIgnoreCase("nil")){ 
     300                                        commandLine.add("(sb-ext:save-lisp-and-die \"" 
     301                                                        +exeFile+"\" :executable t :toplevel '"+pkg+"::"+toplevel+" :purify t)");                                
     302                                } else { 
     303                                        commandLine.add("(sb-ext:save-lisp-and-die \"" 
     304                                                        +exeFile.replace('\\', '/')+"\" :executable t :toplevel '"+toplevel+" :purify t)");                              
     305                                } 
     306 
     307                                commandLine.add("--eval"); 
     308                                commandLine.add("(print 1)"); 
     309                                commandLine.add("--eval"); 
     310                                commandLine.add("(print 2)"); 
    217311                        } 
    218                         if(prefs.getBoolean(PreferenceConstants.MANAGE_PACKAGES)){ 
    219                                 String code = LispPlugin.getDefault().getLibsPathRegisterCode(); 
    220                                 if( !code.equals("")){ 
    221                                         String asdfext = LispPlugin.getDefault().getPluginPath()  
    222                                                 + "lisp-extensions/asdf-extensions.lisp"; 
    223                                         commandLine.add("--load"); 
    224                                         commandLine.add(asdfext); 
    225                                         commandLine.add("--eval"); 
    226                                         commandLine.add(code); 
    227                                 } 
    228                                  
    229                         } 
    230                         asdFile = asdFile.replace('\\', '/'); 
    231                         asdFile = translateLocalFilePath(asdFile); 
    232                         String[] fpathparts = asdFile.split("/"); 
    233                         if( fpathparts.length <= 0 || !fpathparts[fpathparts.length-1].matches(".+\\.asd") ){ 
    234                                 LispPlugin.getDefault().out("=== Error - no project (.asd) file found.");        
    235                                 return false; 
    236                         } 
    237                         String asdName = fpathparts[fpathparts.length-1].replace(".asd", ""); 
    238                          
    239                         commandLine.add("--load"); 
    240                         commandLine.add(asdFile); 
    241                         commandLine.add("--eval"); 
    242                         commandLine.add("(asdf:oos 'asdf:load-op \""+asdName+"\")"); 
    243                          
    244                         commandLine.add("--eval"); 
    245                         if( pkg != null && !pkg.equals("") && !pkg.equalsIgnoreCase("nil")){ 
    246                                 commandLine.add("(sb-ext:save-lisp-and-die \"" 
    247                                                 +exeFile+"\" :executable t :toplevel '"+pkg+"::"+toplevel+" :purify t)");                                
    248                         } else { 
    249                                 commandLine.add("(sb-ext:save-lisp-and-die \"" 
    250                                                 +exeFile.replace('\\', '/')+"\" :executable t :toplevel '"+toplevel+" :purify t)");                              
    251                         } 
    252  
    253                         commandLine.add("--eval"); 
    254                         commandLine.add("(print 1)"); 
    255                         commandLine.add("--eval"); 
    256                         commandLine.add("(print 2)"); 
    257                         String[] cmd = new String[commandLine.size()]; 
     312                        String[] cmd = new String[commandLine.size()];                           
     313                         
     314                         
    258315                        ProcessBuilder pb = new ProcessBuilder(commandLine.toArray(cmd)); 
    259316                        pb.environment().put("SBCL_HOME", path.getPath());