2020-12-16 02:59:07 +01:00
|
|
|
echo --- Building
|
2020-12-09 11:09:07 +01:00
|
|
|
set BAZEL=\bazel\bazel.exe --output_user_root=\bazel\ankici --output_base=\bazel\ankici\base
|
2020-12-07 12:26:52 +01:00
|
|
|
set BUILDARGS=--config=ci
|
|
|
|
|
|
|
|
if exist \bazel\node_modules (
|
2021-10-07 03:34:00 +02:00
|
|
|
move \bazel\node_modules .\node_modules
|
2020-12-07 12:26:52 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
:: rollup may fail on the first build, so we build once without checking return code
|
|
|
|
call %BAZEL% build %BUILDARGS% ... -k
|
|
|
|
|
|
|
|
:: now build/test
|
2020-12-16 02:59:07 +01:00
|
|
|
echo +++ Running tests
|
2020-12-07 12:26:52 +01:00
|
|
|
call %BAZEL% test %BUILDARGS% ...
|
|
|
|
IF %ERRORLEVEL% NEQ 0 exit /B 1
|
|
|
|
|
|
|
|
:: build the wheels
|
|
|
|
@REM call %BAZEL% build %BUILDARGS% pylib/anki:wheel qt/aqt:wheel
|
|
|
|
@REM IF %ERRORLEVEL% NEQ 0 exit /B 1
|
|
|
|
|
|
|
|
@REM :: install them into a new venv
|
|
|
|
@REM echo Creating venv...
|
|
|
|
@REM \python\python.exe -m venv venv
|
|
|
|
@REM IF %ERRORLEVEL% NEQ 0 exit /B 1
|
|
|
|
@REM call venv\scripts\activate
|
|
|
|
|
|
|
|
@REM :: expand wildcards
|
|
|
|
@REM for %%i in (bazel-bin/pylib/anki/*.whl) do set "pylib=%%~i"
|
|
|
|
@REM for %%i in (bazel-bin/qt/aqt/*.whl) do set "qt=%%~i"
|
|
|
|
@REM echo Installing wheels...
|
|
|
|
@REM venv\scripts\pip install bazel-bin/pylib/anki/%pylib% bazel-bin/qt/aqt/%qt%
|
|
|
|
@REM IF %ERRORLEVEL% NEQ 0 exit /B 1
|
|
|
|
|
|
|
|
@REM echo Importing...
|
|
|
|
@REM python -c "import aqt"
|
|
|
|
@REM IF %ERRORLEVEL% NEQ 0 exit /B 1
|
|
|
|
@REM echo Import succesful.
|
|
|
|
|
2020-12-16 02:59:07 +01:00
|
|
|
echo --- Cleanup
|
2021-10-07 03:34:00 +02:00
|
|
|
move node_modules \bazel\node_modules
|