Posted By

reboltutorial on 04/22/10


Tagged

command line BY Ccompile


Versions (?)

csc compiler


 / Published in: C#
 

URL: http://reboltutorial.com/blog/redirect-shell-to-rebol-console/

Easily compile c# exe or library by command line

  1. csc-path: "C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe"
  2.  
  3. set 'csc.exe func[file [string! unset!] /library /references references-list /doc][
  4. either not (value? 'file) [
  5. source: read clipboard://
  6. replace/all source "ReadKey()" "Read()"
  7. delete %temp.cs
  8. write %temp.cs source
  9. command: rejoin [csc-path " /t:exe /checked /debug /out:" "output.exe" " " "temp.cs"]
  10. call/wait/console command
  11. call/console "output.exe"
  12. ][
  13. either library [
  14. command: rejoin [csc-path " /t:library /checked /debug /out:" "output.dll" " " quote file]
  15. ][
  16. command: rejoin [csc-path " /t:exe /checked /debug /out:" "output.exe" " " quote file]
  17. ]
  18.  
  19. if references [
  20. foreach reference references-list [
  21. append command " /reference:"
  22. append command quote reference
  23. ]
  24. ]
  25. if doc [
  26. append command " /doc:"
  27. append command "output.xml"
  28. ]
  29.  
  30. call/wait/console command
  31.  
  32. either library [][
  33. call/console "output.exe"
  34. ]
  35. ]
  36. ]

Report this snippet  

You need to login to post a comment.