-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildenv.cmd
58 lines (43 loc) · 1.62 KB
/
buildenv.cmd
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
REM Configures the environment variables required to build Neon.Operator projects.
REM
REM buildenv [ <source folder> ]
REM
REM Note that <source folder> defaults to the folder holding this
REM batch file.
REM
REM This must be [RUN AS ADMINISTRATOR].
echo ====================================================
echo * Neon Operator SDK Build Environment Configurator *
echo ====================================================
REM Default NF_ROOT to the folder holding this batch file after stripping
REM off the trailing backslash.
set NO_ROOT=%~dp0
set NO_ROOT=%NO_ROOT:~0,-2%
if not [%1]==[] set NO_ROOT=%1
if exist %NO_ROOT%\operator-sdk.sln goto goodPath
echo The [%NO_ROOT%\operator-sdk.sln] file does not exist. Please pass the path
echo to the OperatorSDK solution folder.
goto done
:goodPath
REM Get on with configuration.
echo.
echo Configuring...
echo.
REM Configure the environment variables.
set NO_BUILD=%NO_ROOT%\Build
set NO_TEST=%NO_ROOT%\Test
REM Temporarily add [%NF_ROOT%\neonSDK\ToolBin] to the PATH so
REM we'll be able to use things like [pathtool].
REM
REM NOTE: This assumes that NeonSDK is configured first.
set PATH=%PATH%;%NF_ROOT%\neonSDK\ToolBin
REM Persist the environment variables.
setx NO_ROOT "%NO_ROOT%" /M > nul
setx NO_BUILD "%NO_BUILD%" /M > nul
setx NF_TEST "%NF_TEST%" /M > nul
:done
echo.
echo ============================================================================================
echo * Be sure to close and reopen Visual Studio and any command windows to pick up the changes *
echo ============================================================================================