mirror of
https://github.com/mesonbuild/meson.git
synced 2026-11-06 05:16:42 +00:00
Convert builddist to a Python script.
This commit is contained in:
1 parent
fb1046d9e9
commit
dd7cf67f00
2 files changed
+32
-19
No files matched your search
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright 2025 The Meson development team
|
||||
|
||||
# This script must be run from the source root.
|
||||
|
||||
import pathlib, shutil, subprocess
|
||||
|
||||
gendir = pathlib.Path('distgendir')
|
||||
distdir = pathlib.Path('dist')
|
||||
gitdir = pathlib.Path('.git')
|
||||
|
||||
if distdir.is_dir():
|
||||
shutil.rmtree(distdir)
|
||||
distdir.mkdir()
|
||||
|
||||
if gendir.is_dir():
|
||||
shutil.rmtree(gendir)
|
||||
gendir.mkdir()
|
||||
|
||||
shutil.copytree(gitdir, gendir / '.git')
|
||||
|
||||
subprocess.check_call(['git', 'reset', '--hard'],
|
||||
cwd=gendir)
|
||||
subprocess.check_call(['python3', 'setup.py', 'sdist', 'bdist_wheel'],
|
||||
cwd=gendir)
|
||||
for f in (gendir / 'dist').glob('*'):
|
||||
shutil.copy(f, distdir)
|
||||
|
||||
shutil.rmtree(gendir)
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/zsh
|
||||
|
||||
# This script must be run from the source root.
|
||||
|
||||
set -e
|
||||
|
||||
GENDIR=distgendir
|
||||
|
||||
rm -rf dist
|
||||
rm -rf $GENDIR
|
||||
mkdir dist
|
||||
mkdir $GENDIR
|
||||
cp -r .git $GENDIR
|
||||
cd $GENDIR
|
||||
git reset --hard
|
||||
python3 setup.py sdist bdist_wheel
|
||||
cp dist/* ../dist
|
||||
cd ..
|
||||
rm -rf $GENDIR
|
||||
Reference in new issue
Block a user