-
Notifications
You must be signed in to change notification settings - Fork 32
/
devenv.bat
42 lines (34 loc) · 1.15 KB
/
devenv.bat
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
rem
rem Configures developer environment such that:
rem - PATH and PYTHONPATH point to $BUILD_BIN
rem - PYTHONPATH points to each module in $SOURCE/Python
rem
rem Example when build directory is inside source:
rem (shapeworks) c:\code\ShapeWorks>devenv .\build\bin\Debug
rem
rem After calling this, processes in the environment will use executables from
rem the given build and import modules from the developer's source (including the
rem compiled portion of the Python bindings).
rem
set argC=0
for %%x in (%*) do Set /A argC+=1
echo %argC%
if not %argC%==1 (
echo Must call using "devenv BUILD_BIN"
goto :eof
)
set SOURCE=%~dp0
rem batch-relative trick to get full path to BUILD_BIN
pushd .
cd %~dp0
set BUILD=%~f1
popd
echo source: %SOURCE%
echo build: %BUILD%
set PATH=%BUILD%;%PATH%
set PYTHONPATH=%BUILD%;%PYTHONPATH%
rem add each module in ${SOURCE}/Python to the PYTHONPATH
for /d %%D in ("%SOURCE%\Python\*") DO for /d %%M in ("%%D\*") DO call set PYTHONPATH=%%M;%%PYTHONPATH%%
md %USERPROFILE%\.shapeworks
python -c "import sys; print('\n'.join(sys.path))" > %USERPROFILE%\.shapeworks\python_path.txt
echo %PATH% > %USERPROFILE%\.shapeworks\path.txt