-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_wrapper.sh
executable file
·52 lines (42 loc) · 1.05 KB
/
build_wrapper.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
# exit when any command fails
set -o nounset
set -o errexit
set -x
set -euox pipefail
set -e
# force clean it up
function cleanup() {
echo "REMOVING OLD FILES IF EXISTS";
rm -rf build/temp*
rm -rf build/lib.linux*
rm -rf dist/*
rm -rf __pycache__/
rm -rf *cxx
rm -rf *pyc
rm -rf src/swig_interfaces/kSpider_internal_wrap.cpp
rm -rf pykSpider/internal/kSpider_internal.py
rm -rf *so
rm -rf pykSpider/kSpider.egg-info/
rm -rf build/bdist.linux-x86_64
}
trap cleanup EXIT
cleanup
# Build the project if not already built
BUILD_DIR="build"
[[ -d ${BUILD_DIR} ]] || cmake -Bbuild && cmake --build build -j4
echo "BDIST WHEEL"
$(which python) setup.py bdist_wheel
cd dist/
$(which python) -m pip uninstall kSpider -y
$(which python) -m pip install kSpider*cp*.whl
rm -rf build/temp
rm -rf build/lib.linux*
rm -rf __pycache__/
rm -rf *cxx
rm -rf *pyc
rm -rf src/swig_interfaces/kSpider_internal_wrap.cpp
rm -rf kSpider_internal.py
rm -rf *so
rm -rf pykSpider/kSpider.egg-info/
rm -rf build/bdist.linux-x86_64