Rewrite biicode build script in Python and simplify

This commit is contained in:
Victor Zverovich 2015-03-03 21:45:47 -08:00
parent 7c0a23329e
commit e6113fb9f5
2 changed files with 22 additions and 28 deletions

22
support/biicode-build.py Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
# Build the project with Biicode.
import glob, os, shutil
from download import Downloader
from subprocess import check_call
os_name = os.environ['TRAVIS_OS_NAME']
if os_name == 'linux':
with Downloader().download('http://www.biicode.com/downloads/latest/ubuntu64') as f:
check_call(['sudo', 'dpkg', '-i', f])
elif os_name == 'osx':
with Downloader().download('http://www.biicode.com/downloads/latest/macos') as f:
check_call(['sudo', 'installer', '-pkg', f, '-target', '/'])
project_dir = 'biicode_project'
check_call(['bii', 'init', project_dir])
cppformat_dir = os.path.join(project_dir, 'blocks/vitaut/cppformat')
shutil.copytree('.', cppformat_dir, ignore=shutil.ignore_patterns('biicode_project'))
for f in glob.glob('support/biicode/*'):
shutil.copy(f, cppformat_dir)
check_call(['bii', 'cpp:build'], cwd=project_dir)

View File

@ -1,28 +0,0 @@
#!/bin/bash
if [ $TRAVIS_OS_NAME == linux ]; then
sudo apt-get install libglu1-mesa-dev xorg-dev
wget http://www.biicode.com/downloads/latest/ubuntu64
mv ubuntu64 bii-ubuntu64.deb
(sudo dpkg -i bii-ubuntu64.deb) && sudo apt-get -f install
rm bii-ubuntu64.deb
wget https://s3.amazonaws.com/biibinaries/thirdparty/cmake-3.0.2-Linux-64.tar.gz
tar -xzf cmake-3.0.2-Linux-64.tar.gz
sudo cp -fR cmake-3.0.2-Linux-64/* /usr
rm -rf cmake-3.0.2-Linux-64
rm cmake-3.0.2-Linux-64.tar.gz
elif [ $TRAVIS_OS_NAME == osx ]; then
wget http://www.biicode.com/downloads/latest/macos
mv macos macos.pkg
sudo installer -pkg macos.pkg -target /
rm macos.pkg
fi
cmake --version
bii init biicode_project
mkdir -p ./biicode_project/blocks/vitaut/cppformat
shopt -s extglob
mv support/biicode/* biicode_project/blocks/vitaut/cppformat
mv !(biicode_project|cmake-3.0.2-Darwin64-universal) biicode_project/blocks/vitaut/cppformat
cd biicode_project
bii cpp:build