pw_env_setup: use env vars for bootstrap opts
The following environment variables are now used to pass options into
pw_env_setup:
* PW_CIPD_PACKAGEFILES
* PW_VIRTUALENV_REQUIREMENTS
* PW_VIRTUALENV_SETUPPYROOTS
* PW_CARGO_PACKAGEFILES
Each of these variables can contain multiple entries separated by ':'
(or ';' on Windows) like PATH. However, they will also be interpreted
as globs, so PW_VIRTUALENV_REQUIREMENTS="/foo/bar/*/requirements.txt"
is perfectly valid. They should be full paths.
Projects depending on Pigweed should prepend to these variables and
then invoke Pigweed's bootstrap.sh (or bootstrap.bat). Users wanting
additional setup should set these variables in their shell init files.
Change-Id: Ibf0f1d5279028856a590ffc50850df2174c38e28
Bug: 138
diff --git a/bootstrap.bat b/bootstrap.bat
index 2cf0cdf..8713718 100644
--- a/bootstrap.bat
+++ b/bootstrap.bat
@@ -48,6 +48,16 @@
)
)
+set _PW_OLD_CIPD_PACKAGE_FILES=%PW_CIPD_PACKAGE_FILES%
+set _PW_OLD_VIRTUALENV_REQUIREMENTS=%PW_VIRTUALENV_REQUIREMENTS%
+set _PW_OLD_VIRTUALENV_SETUP_PY_ROOTS=%PW_VIRTUALENV_SETUP_PY_ROOTS%
+set _PW_OLD_CARGO_PACKAGE_FILES=%PW_CARGO_PACKAGE_FILES%
+
+set PW_CIPD_PACKAGE_FILES=%PW_ROOT%\pw_env_setup\py\pw_env_setup\cipd_setup\*.json;%PW_CIPD_PACKAGE_FILES%
+set PW_VIRTUALENV_REQUIREMENTS=%PW_ROOT%\pw_env_setup\py\pw_env_setup\virtualenv_setup\requirements.txt;%PW_VIRTUALENV_REQUIREMENTS%
+set PW_VIRTUALENV_SETUP_PY_ROOTS=%PW_ROOT%;%PW_VIRTUALENV_SETUP_PY_ROOTS%
+set PW_CARGO_PACKAGE_FILES=%PW_ROOT%\pw_env_setup\py\pw_env_setup\cargo_setup\packages.txt;%PW_CARGO_PACKAGE_FILES%
+
set "_pw_start_script=%PW_ROOT%\pw_env_setup\py\pw_env_setup\windows_env_start.py"
set "shell_file=%PW_ROOT%\pw_env_setup\.env_setup.bat"
@@ -68,6 +78,11 @@
)
)
+set PW_CIPD_PACKAGE_FILES=%_PW_OLD_CIPD_PACKAGE_FILES%
+set PW_VIRTUALENV_REQUIREMENTS=%_PW_OLD_VIRTUALENV_REQUIREMENTS%
+set PW_VIRTUALENV_SETUP_PY_ROOTS=%_PW_OLD_VIRTUALENV_SETUP_PY_ROOTS%
+set PW_CARGO_PACKAGE_FILES=%_PW_OLD_CARGO_PACKAGE_FILES%
+
call "%shell_file%"
:finish