2015-03-04 05:45:47 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# Build the project with Biicode.
|
|
|
|
|
2015-03-04 16:53:51 +00:00
|
|
|
import bootstrap, glob, os, shutil, sys
|
2015-03-04 05:45:47 +00:00
|
|
|
from download import Downloader
|
|
|
|
from subprocess import check_call
|
|
|
|
|
|
|
|
os_name = os.environ['TRAVIS_OS_NAME']
|
2015-03-04 16:53:51 +00:00
|
|
|
if os_name != 'linux':
|
|
|
|
sys.exit()
|
|
|
|
|
2015-03-04 15:07:13 +00:00
|
|
|
cmake_dir = 'cmake-dir'
|
2015-03-04 15:36:30 +00:00
|
|
|
cmake_program = 'cmake'
|
2015-03-04 16:53:51 +00:00
|
|
|
|
|
|
|
# Install newer version of CMake.
|
|
|
|
cmake_program = bootstrap.install_cmake(
|
|
|
|
'cmake-3.1.1-Linux-i386.tar.gz', check_installed=False, download_dir=None, install_dir='.')
|
|
|
|
cmake_dir = glob.glob('cmake*')[0]
|
|
|
|
with Downloader().download('http://www.biicode.com/downloads/latest/ubuntu64') as f:
|
|
|
|
check_call(['sudo', 'dpkg', '-i', f])
|
2015-03-04 05:45:47 +00:00
|
|
|
|
2015-03-04 16:07:26 +00:00
|
|
|
env = os.environ.copy()
|
|
|
|
env['PATH'] = os.path.abspath(os.path.dirname(cmake_program)) + ':' + env['PATH']
|
|
|
|
env['CMAKE_ROOT'] = os.path.abspath(cmake_dir)
|
|
|
|
|
2015-03-04 05:45:47 +00:00
|
|
|
project_dir = 'biicode_project'
|
2015-03-04 16:07:26 +00:00
|
|
|
check_call(['bii', 'init', project_dir], env=env)
|
2015-03-04 05:45:47 +00:00
|
|
|
cppformat_dir = os.path.join(project_dir, 'blocks/vitaut/cppformat')
|
2015-03-04 06:07:20 +00:00
|
|
|
shutil.copytree('.', cppformat_dir,
|
2015-03-04 15:07:13 +00:00
|
|
|
ignore=shutil.ignore_patterns('biicode_project', cmake_dir))
|
2015-03-04 05:45:47 +00:00
|
|
|
for f in glob.glob('support/biicode/*'):
|
|
|
|
shutil.copy(f, cppformat_dir)
|
2015-03-04 16:33:13 +00:00
|
|
|
print env['CMAKE_ROOT']
|
2015-03-04 16:53:51 +00:00
|
|
|
check_call(['cmake', '--version', project_dir], env=env)
|
2015-03-04 16:33:13 +00:00
|
|
|
#check_call(['bii', 'cpp:build'], cwd=project_dir, env=env)
|