forked from OrchardCMS/Orchard
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClickToBuild.cmd
More file actions
Latest commit
36 lines (26 loc) · 904 Bytes
/
Copy pathClickToBuild.cmd
File metadata and controls
36 lines (26 loc) · 904 Bytes
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
@echooff
REM Necessary for the InstallDir variable to work inside the MsBuild-finding loop below.
SETLOCALENABLEDELAYEDEXPANSION
for /f "usebackq tokens=1* delims=: "%%iin (`lib\vswhere\vswhere -latest -version "[16.0,18.0)" -requires Microsoft.Component.MSBuild`) do (
if /i "%%i"=="installationPath" (
setInstallDir=%%j
echo!InstallDir!
ifexist"!InstallDir!\MSBuild\Current\Bin\MSBuild.exe" (
echo"Using MSBuild from !InstallDir!"
setmsbuild="!InstallDir!\MSBuild\Current\Bin\MSBuild.exe"
goto build
)
)
)
echo"Unable to detect suitable environment. Build may not succeed."
:build
SETtarget=%1
SETproject=%2
SETsolution=%3
IF"%target%"==""SETtarget=Build
IF"%project%"==""SETproject=Orchard.proj
IF"%solution%"==""SETsolution=src\Orchard.sln
lib\nuget\nuget.exe restore %solution%
%msbuild% /t:%target%%project% /p:Solution=%solution% /m
:end
pause