Windows의 경우 an approach to doing what you want on the Sublime Text forums을 고려하십시오. ST2와 관련하여 게시되었지만 ST3에서도 정상적으로 작동하는 것으로 나타났습니다.
Build Systems 문서를 읽은 후 처음부터 솔루션에 도달하려고 시도하는 것보다 포스터의 구체적인 접근 방식을 따르고 적응하기가 더 쉽다고 생각합니다.
{
"cmd": ["C:\\Bin\\Scripts\\sublimetext_csharp_builder.bat", "*.cs", "${file/\\.cs/\\.exe/}"], // NOTE: path set for my Windows environment
//"cmd": ["\\path\\to\\sublimetext_csharp_builder.bat", "$file", "${file/\\.cs/\\.exe/}"],
"working_dir": "${project_path:${folder:${file_path}}}",
"file_regex": "^(...*?)[(]([0-9]*),([0-9]*)[)]",
"selector": "source.cs"
}
: 내 Windows 환경과
이 설정 1)cmd
경로) 현재 파일의 디렉토리에있는 모든 .cs
파일을 컴파일 *.cs
로 대체
$file
와 - 여기
는
.sublime-build
파일의 내용입니다
the related sublimetext_csharp_builter.bat
file on GitHub을 찾을 수 있습니다. 아래에서 나는 단지 을 가지고있다.은 csc
이 %PATH%
으로 해결되거나 전체 경로를 사용하고 으로 해석되는 한 실제로 필요하지 않은 환경 변수를 설정하기 위해 Visual Studio 배치 파일에 대한 의존성을 제거했다. 2) 내가 사용하던 경로에 대해 필요하다고 결과 exe
, 경로 (IT 공백이 포함 된 이후) :
:: 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"
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.
:: NOTE: path quoted to accommodate spaces in it
@"%EXE_NAME%"
@%EXE_NAME%
:end
다른 하나의 CSC에 전화 또는 뭔가 ("CSC/여러 CS 파일을 컴파일하는 방법 질문입니다 ? "는 이전에 도움이 될 것입니다 - 모든 파일을 지정하십시오) ... –
@AlexeiLevenkov 예,'gmcs * .cs; 모노 * .exe', 배쉬 스크립트에서 성공적으로 작동하지만, 스크립트를 실행하는 대신에 이것을'.build-system' 파일에 넣고 싶습니다. (그것이 어떨지는 모르겠지만) . – heltonbiker
제가보기에 - 당신의 질문은 제가 전혀 모르는 것에 관한 것입니다. 그래서 나는 왜 그것을 이해하지 못합니까. 죄송합니다. –