diff --git a/scripts/build_dist.bat b/scripts/build_dist.bat index e061c83..d5a41c3 100644 --- a/scripts/build_dist.bat +++ b/scripts/build_dist.bat @@ -12,7 +12,26 @@ call %FUNC% GetLibName LIBNAME call %FUNC% GetModName MODNAME call %FUNC% SetPythonPath call %FUNC% UsePython -if exist MANIFEST ( del /q MANIFEST ) +call %FUNC% GetVersion VERSION + +set REPODIR=%SCRIPTPATH%\.. + +@REM Clone repository in a temporary directory +set CLONEDIR=%REPODIR%\..\%LIBNAME%-tempdir +if exist %CLONEDIR% ( rmdir /s /q %CLONEDIR% ) +git clone -l -s . %CLONEDIR% + +@REM Build distribution files +pushd %CLONEDIR% %PYTHON% -m build -rmdir /s /q %LIBNAME%.egg-info +popd + +@REM Copy distribution files to the repository +set DISTDIR=%REPODIR%\dist +if not exist %DISTDIR% ( mkdir %DISTDIR% ) +copy /y %CLONEDIR%\dist\%MODNAME%-%VERSION%*.whl %DISTDIR% +copy /y %CLONEDIR%\dist\%MODNAME%-%VERSION%*.tar.gz %DISTDIR% + +@REM Clean up +rmdir /s /q %CLONEDIR% call %FUNC% EndOfScript \ No newline at end of file