Repository navigation
Expand file tree
/
Copy pathgenerate_vsix.bat
More file actions
39 lines (33 loc) · 1.63 KB
/
Copy pathgenerate_vsix.bat
File metadata and controls
39 lines (33 loc) · 1.63 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
REM Builds the Prism language server (Profile) and packs it with the generated highlighting into
REM bin\editor\prism.vsix (double-click that file to install it).
REM
REM generate_vsix.bat build Prism, then bin\editor\prism.vsix
REM generate_vsix.bat --install-user also copy the highlighting-only extension into
REM %USERPROFILE%\.vs\Extensions\Prism (no VSIX needed)
REM
REM Needs Visual Studio with the "Visual Studio extension development" workload, Python, and
REM projects\spectrum.sln (generate_project.bat creates it).
setlocal
cd /d "%~dp0"
if not exist projects\spectrum.sln (
echo projects\spectrum.sln is missing -- run generate_project.bat first.
exit /b 1
)
set MSBUILD=
for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do set MSBUILD=%%i
if not defined MSBUILD (
echo MSBuild not found.
exit /b 1
)
REM The extension carries a copy of bin\profile\prismc.exe as its language server, so build it first.
"%MSBUILD%" projects\spectrum.sln /t:Prism /p:Configuration=Profile-D3D12 /p:Platform=x64 /m -nodeReuse:false /nologo /v:minimal
set BUILD_RESULT=%ERRORLEVEL%
REM A lingering MSBuild or compiler server locks files and blocks Visual Studio installers.
powershell -NoProfile -Command "Get-Process MSBuild,VBCSCompiler -ErrorAction SilentlyContinue | Stop-Process -Force"
if not %BUILD_RESULT%==0 (
echo Prism build failed.
exit /b %BUILD_RESULT%
)
python sources\Prism\editor\gen_vs_extension.py %*
exit /b %ERRORLEVEL%