Skip to content

Commit

Permalink
Enables travis to cache scons' build/ directory.
Browse files Browse the repository at this point in the history
Scons makes this simple - all the object files are placed in build/release/, and the build/sconsign.dblite file keeps track of the md5 sum of each file built. This then means all that's necessary to prevent scons from doing a full rebuild each time is to cache the build/ directory.

Keep in mind however, that this does not make the actual compiling faster, it just means that most of the time fewer things will need to be compiled. Any change that would trigger a rebuild of most or all of the source files will still take just as long as before.
  • Loading branch information
Pentarctagon authored and Vultraz committed Feb 9, 2018
1 parent ff6fcb8 commit 3cbf4aa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Expand Up @@ -4,6 +4,10 @@ sudo: required
services:
- docker

cache:
directories:
- build-cache

matrix:
include:
- compiler: clang
Expand Down Expand Up @@ -52,8 +56,9 @@ install:
docker build -t wesnoth-repo:16.04 -f docker/Dockerfile-travis .;
fi

script:
script:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
ln -s build-cache/ build;
./utils/travis/check_utf8.sh;
./utils/travis/utf8_bom_dog.sh;
"$CXX" --version;
Expand All @@ -62,7 +67,7 @@ script:
export DISPLAY=:99.0;
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1024x768x24;

docker run wesnoth-repo:16.04 bash -c './docker_run.sh "$@"' bash "$NLS" "$TOOL" "$CC" "$CXX" "$CXXSTD" "$EXTRA_FLAGS_RELEASE" "$WML_TESTS" "$WML_TEST_TIME" "$PLAY_TEST" "$MP_TEST" "$BOOST_TEST";
docker run -v `pwd`/build-cache:/home/wesnoth-travis/build wesnoth-repo:16.04 bash -c './docker_run.sh "$@"' bash "$NLS" "$TOOL" "$CC" "$CXX" "$CXXSTD" "$EXTRA_FLAGS_RELEASE" "$WML_TESTS" "$WML_TEST_TIME" "$PLAY_TEST" "$MP_TEST" "$BOOST_TEST";
fi

notifications:
Expand Down

0 comments on commit 3cbf4aa

Please sign in to comment.