Skip to content

Commit

Permalink
VSCode build script: building in a clone repo
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Apr 10, 2024
1 parent 2ea8392 commit 8200f9e
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions scripts/build_dist.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8200f9e

Please sign in to comment.