Changeset 1701
- Timestamp:
- 10/22/08 20:45:20 (3 months ago)
- Location:
- cobra/trunk/Source
- Files:
-
- 1 added
- 2 modified
-
install-from-workspace (added)
-
InstallFromWorkspace.cobra (modified) (9 diffs)
-
SharpGenerator.cobra (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/InstallFromWorkspace.cobra
r1689 r1701 39 39 40 40 Use the script: 41 $ install-from-workspace41 $ sudo ./install-from-workspace 42 42 43 43 … … 227 227 output = CobraCore.runAndCaptureAllOutput(p).trim 228 228 process = p 229 if displayOutput 229 if displayOutput and output <> '' 230 230 for line in output.replace('\r', '').split(c'\n') 231 print ' [line]'232 231 print ' : [line]' 232 print 233 233 return output 234 234 … … 270 270 if not File.exists('Compiler.cobra'), .error(msg) 271 271 if not Directory.exists('Snapshot'), .error(msg) 272 print 'Verified.' 273 print 272 274 273 275 def locateSnapshotCompiler … … 292 294 CobraCore.runAndCaptureAllOutput(p) 293 295 found = true 296 print 'found in system PATH' 294 297 catch exc as Exception 295 298 if 'cannot find the file' not in exc.message … … 311 314 if File.exists(path) 312 315 print 'found:', path 313 print314 316 gacutil = path 315 317 found = true … … 321 323 322 324 _gacutil = gacutil 325 print 323 326 324 327 def buildCobraCompiler … … 409 412 print 'writing :', _cobraCommandPath 410 413 using f = File.createText(_cobraCommandPath) 411 f.writeLine("'[versionDir][slash]bin[slash]cobra.exe' $*") 414 f.writeLine('#!/bin/sh') 415 f.writeLine('exec mono "[versionDir][slash]bin[slash]cobra.exe" "$@"') 412 416 .runCommand('chmod', "a+x '[_cobraCommandPath]'") 413 417 else … … 416 420 using f = File.createText(_cobraCommandPath) 417 421 f.writeLine('@"[versionDir][slash]bin[slash]cobra.exe" %*') 418 print419 422 print 423 420 424 # record "svn info" in the installation directory 421 425 output = .runCommand('svn', 'info', false) … … 445 449 paths = (Environment.getEnvironmentVariable('PATH') ? '').split(Path.pathSeparator) 446 450 for commandDir in paths 451 if commandDir == '.', continue # skip the 'cobra' in the <workspace>/Source directory 447 452 # print 'checking path:', commandDir 448 453 commandPath = '[commandDir][slash][commandName]' -
cobra/trunk/Source/SharpGenerator.cobra
r1699 r1701 68 68 assert File.exists(cobraExePath) 69 69 infoPath = Path.combine(Path.getDirectoryName(cobraExePath), 'CobraInfo.cs') 70 using sw = File.createText(infoPath) 71 print to sw 72 print 'using System;' 73 print 'namespace Cobra.Lang {' 74 print ' class CobraInfo {' 75 print ' static public String CobraPath {' 76 print ' get { return @"[cobraExePath]"; }' 77 print ' }' 78 print ' }' 79 print '}' 70 try 71 using sw = File.createText(infoPath) 72 print to sw 73 print 'using System;' 74 print 'namespace Cobra.Lang {' 75 print ' class CobraInfo {' 76 print ' static public String CobraPath {' 77 print ' get { return @"[cobraExePath]"; }' 78 print ' }' 79 print ' }' 80 print '}' 81 catch UnauthorizedAccessException 82 # an installed Cobra may not have perms to write this file 83 # and this CobraInfo.cs approach may be going away soon in favor of using the new internal 'extra-source' option 84 pass 80 85 _didWriteSharpInfoClass = true 81 86
