public
Last active

A simple C# builder for Sublime Text 2. Accompanying C# builder definition here: https://gist.github.com/1387543

  • Download Gist
sublimetext_csharp_builder.bat
Batchfile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
:: Assumptions:
:: - Sublime Text has set the working directory and both the source and executable files
:: are in that directory
:: - The script is only capable of handling simple C# apps that do not reference 3rd-party
:: libraries
 
:: Inputs from Sublime Text
:: %1 - The full path and filename of the source file to build
:: %2 - The name of the executable file
@SET SRC_FILE="%1"
@SET EXE_NAME="%2"
 
:: Set up build environment. Change this as necessary depending on the version
:: of Visual Studio you wish to use.
@CALL "%VS90COMNTOOLS%vsvars32.bat"
 
csc %SRC_FILE% /nologo /debug:full /platform:x86
@IF errorlevel 1 GOTO end
 
:: Execute compiled binary if build was successful.
@ECHO.
@ECHO Executing %EXE_NAME%:
@ECHO.
@%EXE_NAME%
 
:end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.