blob: 5620ae68058008e68dbe840c3023be331dda5422 [file] [log] [blame]
@rem Builds Windows Shell integration library
@rem Usage:
@rem build-win-shell-integration.cmd <out_dir> <dist_dir> <build_number>
@rem The binary is built in <out_dir>, and WinShellIntegrationBridge.dll artifact copied to <dist_dir>
setlocal enabledelayedexpansion
set OUT_DIR=%1
set DIST_DIR=%2
set BUILD_ID=%3
set SCRIPT_DIR=%~dp0
for %%F in ("%SCRIPT_DIR%..\..") do set TOP=%%~dpF
set CMAKE="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake"
set JDK_11_0_x64=%TOP%prebuilts\studio\jdk\jdk11\win\
if not exist %OUT_DIR% (mkdir %OUT_DIR%)
cd %OUT_DIR%
if exist WinShellIntegration rmdir /s /q WinShellIntegration
mkdir WinShellIntegration && cd WinShellIntegration
@rem if BUILD_ID is a number, pass it to cmake via BUILD_NUMBER
@rem BUILD_NUMBER is also set by ab/, so always override
IF 1%BUILD_ID% EQU +1%BUILD_ID% (set BUILD_NUMBER=%BUILD_ID%) else (set BUILD_NUMBER=)
set PATH=%JDK_11_0_x64%include;%PATH%
%CMAKE% %TOP%tools\idea\native\WinShellIntegration
%CMAKE% --build . --config Release -A x64 -- -clp:ShowCommandLine
cd ..\..
if not exist %DIST_DIR% (mkdir %DIST_DIR%)
xcopy /f /y %OUT_DIR%\WinShellIntegration\src\winshellintegrationbridge\Release\WinShellIntegrationBridge64.dll %DIST_DIR%