forked from zgr0629/RedisDesktopManager-Mac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resp.sh
68 lines (53 loc) · 2.17 KB
/
resp.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
SHELL_FOLDER=$(cd "$(dirname "$0")";pwd)
echo '=======================Clone RDM repository======================='
git clone --recursive https://github.com/uglide/RedisDesktopManager.git resp
echo "=======================Switch to latest tag: ${TAG}===================="
cd $SHELL_FOLDER/resp
TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo 'switch to latest tag: '$TAG
cd $SHELL_FOLDER/resp
git checkout -b $TAG $TAG
echo '=======================Build lz4======================='
cd $SHELL_FOLDER/resp/3rdparty/lz4/build/cmake
cmake -DLZ4_BUNDLED_MODE=ON -DBUILD_SHARED_LIBS=ON --build .
ls
make -s -j 8
echo '=======================Modify RDM version======================='
cd $SHELL_FOLDER
python ./resp/build/utils/set_version.py ${TAG} > ./resp/src/version.h
cd $SHELL_FOLDER/resp/src
echo 'backup resp.pro'
cp resp.pro resp.pro.bak
echo 'modify resp.pro'
sed -i "" "/^\( *\)VERSION=.*/s//\1VERSION=$TAG/" resp.pro
echo '=======================Release Translations======================='
cd $SHELL_FOLDER/resp/src
lupdate resp.pro
lrelease -verbose resp.pro
echo '=======================Install Python requirements======================='
mkdir -p $SHELL_FOLDER/resp/bin/osx/release
cd $SHELL_FOLDER/resp/bin/osx/release
cp -rf $SHELL_FOLDER/resp/src/py .
cd py
echo six >> requirements.txt
sudo pip3 install -t . -r requirements.txt
sudo python3 -m compileall -b .
sudo find . -name "*.py" | sudo xargs rm -rf
sudo find . -name "__pycache__" | sudo xargs rm -rf
sudo find . -name "*.dist-info" | sudo xargs rm -rf
sudo find . -name "*.egg-info" | sudo xargs rm -rf
echo "=======================Build RESP ${TAG}======================="
cd $SHELL_FOLDER/resp/src/resources
echo 'copy Info.plist'
cp Info.plist.sample Info.plist
cd $SHELL_FOLDER/resp/src
qmake resp.pro CONFIG-=debug
make -s -j 8
echo "=======================Copy Translations======================="
cd $SHELL_FOLDER/resp/src
mkdir ../bin/osx/release/RESP.app/Contents/translations
cp -f ./resources/translations/*.qm ../bin/osx/release/RESP.app/Contents/translations
echo "OK!"
echo "=======================SUCCESS======================="
echo 'App file is:'$SHELL_FOLDER/resp/bin/osx/release/RESP.app