Merge pull request #30 from Arkshine/add-travis-ci

Add Travis CI
This commit is contained in:
Vincent Herbet 2014-06-05 19:45:40 +02:00
commit 9558861cb7
2 changed files with 21 additions and 6 deletions

11
.travis.yml Normal file
View File

@ -0,0 +1,11 @@
language: cpp
compiler:
- clang
before_script:
- sudo apt-get update -qq
- sudo apt-get install -y g++-multilib libc6-dev-i386 lib32stdc++6 lib32z1-dev
- CHECKOUT_DIR=$PWD && cd .. && $CHECKOUT_DIR/support/checkout-deps.sh && cd $CHECKOUT_DIR
script:
- mkdir build && cd build
- python ../configure.py --enable-optimize
- ambuild

View File

@ -1,5 +1,6 @@
# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python:
import os, sys
import re
builder.SetBuildFolder('/')
@ -17,16 +18,19 @@ outputs = [
]
with open(os.path.join(builder.sourcePath, '.git', 'HEAD')) as fp:
git_state = fp.read().strip().split(':')[1].strip()
git_head_path = os.path.join(builder.sourcePath, '.git', git_state)
if not os.path.exists(git_head_path):
head_contents = fp.read().strip()
if re.search('^[a-fA-F0-9]{40}$', head_contents):
git_head_path = os.path.join(builder.sourcePath, '.git', 'HEAD')
else:
git_state = head_contents.split(':')[1].strip()
git_head_path = os.path.join(builder.sourcePath, '.git', git_state)
if not os.path.exists(git_head_path):
git_head_path = os.path.join(builder.sourcePath, '.git', 'HEAD')
sources = [
os.path.join(builder.sourcePath, 'product.version'),
# This is a hack, but we need some way to only run this script when HG changes.
# This is a hack, but we need some way to only run this script when Git changes.
git_head_path,
# The script source is a dependency, of course...