Skip to content

Commit 8200f9e

Browse files
committed
VSCode build script: building in a clone repo
1 parent 2ea8392 commit 8200f9e

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

scripts/build_dist.bat

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,26 @@ call %FUNC% GetLibName LIBNAME
1212
call %FUNC% GetModName MODNAME
1313
call %FUNC% SetPythonPath
1414
call %FUNC% UsePython
15-
if exist MANIFEST ( del /q MANIFEST )
15+
call %FUNC% GetVersion VERSION
16+
17+
set REPODIR=%SCRIPTPATH%\..
18+
19+
@REM Clone repository in a temporary directory
20+
set CLONEDIR=%REPODIR%\..\%LIBNAME%-tempdir
21+
if exist %CLONEDIR% ( rmdir /s /q %CLONEDIR% )
22+
git clone -l -s . %CLONEDIR%
23+
24+
@REM Build distribution files
25+
pushd %CLONEDIR%
1626
%PYTHON% -m build
17-
rmdir /s /q %LIBNAME%.egg-info
27+
popd
28+
29+
@REM Copy distribution files to the repository
30+
set DISTDIR=%REPODIR%\dist
31+
if not exist %DISTDIR% ( mkdir %DISTDIR% )
32+
copy /y %CLONEDIR%\dist\%MODNAME%-%VERSION%*.whl %DISTDIR%
33+
copy /y %CLONEDIR%\dist\%MODNAME%-%VERSION%*.tar.gz %DISTDIR%
34+
35+
@REM Clean up
36+
rmdir /s /q %CLONEDIR%
1837
call %FUNC% EndOfScript

0 commit comments

Comments
 (0)