Changeset 1742

Show
Ignore:
Timestamp:
11/07/08 20:15:41 (2 months ago)
Author:
Chuck.Esterbrook
Message:

Fix a bug from a previous checkin that broke "cobra -bsl".

Location:
cobra/trunk/Source
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/SharpGenerator.cobra

    r1738 r1742  
    109109#                       .modules[0].fileName.endsWith('SystemInterfaces.cobra')  # no longer the first module 
    110110                body 
    111                         if .verbosity >= 2 
    112                                 print 'Compiling generated code' 
     111                        if .verbosity >= 2, print 'Compiling generated code' 
    113112                        options = .options 
    114113 
     
    133132 
    134133                        # exe names 
     134                        outName = '' 
    135135                        if options.boolValue('test') 
    136136                                outName = _modules[_modules.count-1].sharpFileName 
    137137                        else if options.containsKey('out') 
    138                                 outName = options.get('out') 
    139                         else 
     138                                outName = options.getDefault('out', '') 
     139                        if outName == '' 
    140140                                outName = _firstFileName to ! 
    141141                        if outName.endsWith('.cs') or outName.endsWith('.CS'), outName = outName[:-3] 
    142142                        if outName.endsWith('.cobra') or outName.endsWith('.COBRA'), outName = outName[:-6] 
    143                         target = options.getDefault('target', 'exe') 
    144                         if target in ['exe', 'winexe'] and (outName.endsWith('.exe') or outName.endsWith('.EXE')) 
    145                                 outName = outName[:-4]  # csc always adds the extension itself 
    146                         else if target == 'lib' and (outName.endsWith('.dll') or outName.endsWith('.DLL')) 
    147                                 outName = outName[:-4] 
    148143                        _baseExeFileName = outName 
    149144 
  • cobra/trunk/Source/Utils.cobra

    r1722 r1742  
    300300                                assert Utils.forceExtension('foo', '.exe') == 'foo.exe' 
    301301                                assert Utils.forceExtension('foo', 'exe') == 'foo.exe' 
     302                                assert Utils.forceExtension('foo.bar.csv', '.exe') == 'foo.bar.exe' 
    302303                        body 
    303304                                if not extension.startsWith('.')