diff options
Diffstat (limited to 'util/travis')
-rwxr-xr-x | util/travis/before_install.sh | 13 | ||||
-rw-r--r-- | util/travis/clang-format-whitelist.txt | 45 | ||||
-rw-r--r-- | util/travis/common.sh | 47 | ||||
-rw-r--r-- | util/travis/lint.sh | 8 |
4 files changed, 64 insertions, 49 deletions
diff --git a/util/travis/before_install.sh b/util/travis/before_install.sh index a4328fa46..b87668cce 100755 --- a/util/travis/before_install.sh +++ b/util/travis/before_install.sh @@ -1,4 +1,5 @@ #!/bin/bash -e + echo "Preparing for $TRAVIS_COMMIT_RANGE" if [[ "$LINT" == "1" ]]; then @@ -32,18 +33,20 @@ if [[ $PLATFORM == "Unix" ]]; then fi else - brew update - brew install freetype gettext hiredis irrlicht jpeg leveldb libogg libvorbis luajit - #brew upgrade postgresql + install_macosx_deps fi elif [[ $PLATFORM == "Win32" ]]; then - wget http://minetest.kitsunemimi.pw/mingw_w64_i686_ubuntu12.04_4.9.1.7z -O mingw.7z + sudo apt-get update + sudo apt-get install p7zip-full + wget http://minetest.kitsunemimi.pw/mingw-w64-i686_7.1.1_ubuntu14.04.7z -O mingw.7z sed -e "s|%PREFIX%|i686-w64-mingw32|" \ -e "s|%ROOTPATH%|/usr/i686-w64-mingw32|" \ < util/travis/toolchain_mingw.cmake.in > util/buildbot/toolchain_mingw.cmake sudo 7z x -y -o/usr mingw.7z elif [[ $PLATFORM == "Win64" ]]; then - wget http://minetest.kitsunemimi.pw/mingw_w64_x86_64_ubuntu12.04_4.9.1.7z -O mingw.7z + sudo apt-get update + sudo apt-get install p7zip-full + wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_7.1.1_ubuntu14.04.7z -O mingw.7z sed -e "s|%PREFIX%|x86_64-w64-mingw32|" \ -e "s|%ROOTPATH%|/usr/x86_64-w64-mingw32|" \ < util/travis/toolchain_mingw.cmake.in > util/buildbot/toolchain_mingw64.cmake diff --git a/util/travis/clang-format-whitelist.txt b/util/travis/clang-format-whitelist.txt index acb6d51e4..932f59978 100644 --- a/util/travis/clang-format-whitelist.txt +++ b/util/travis/clang-format-whitelist.txt @@ -1,10 +1,8 @@ src/activeobject.h src/ban.cpp -src/ban.h src/camera.cpp src/camera.h src/cavegen.cpp -src/cavegen.h src/cguittfont/CGUITTFont.cpp src/cguittfont/CGUITTFont.h src/cguittfont/irrUString.h @@ -20,7 +18,6 @@ src/clientenvironment.h src/client.h src/clientiface.cpp src/clientiface.h -src/client/inputhandler.h src/client/joystick_controller.cpp src/client/joystick_controller.h src/clientmap.cpp @@ -36,8 +33,6 @@ src/clouds.h src/collision.cpp src/collision.h src/config.h -src/constants.h -src/content_abm.cpp src/content_cao.cpp src/content_cao.h src/content_cso.cpp @@ -55,17 +50,17 @@ src/craftdef.cpp src/craftdef.h src/database.cpp src/database-dummy.cpp -src/database-dummy.h +src/database-files.cpp src/database-leveldb.cpp src/database-postgresql.cpp src/database-postgresql.h src/database-redis.cpp src/database-sqlite3.cpp +src/database-sqlite3.h src/daynightratio.h src/debug.cpp src/debug.h src/defaultsettings.cpp -src/defaultsettings.h src/drawscene.cpp src/drawscene.h src/dungeongen.cpp @@ -73,10 +68,11 @@ src/dungeongen.h src/emerge.cpp src/emerge.h src/environment.cpp -src/environment.h src/event.h src/event_manager.h src/exceptions.h +src/face_position_cache.cpp +src/face_position_cache.h src/filecache.cpp src/filesys.cpp src/filesys.h @@ -94,14 +90,11 @@ src/guiChatConsole.h src/guiEngine.cpp src/guiEngine.h src/guiFileSelectMenu.cpp -src/guiFileSelectMenu.h src/guiFormSpecMenu.cpp src/guiFormSpecMenu.h src/guiKeyChangeMenu.cpp -src/guiKeyChangeMenu.h src/guiMainMenu.h src/guiPasswordChange.cpp -src/guiPasswordChange.h src/guiscalingfilter.cpp src/guiscalingfilter.h src/guiTable.cpp @@ -109,7 +102,6 @@ src/guiTable.h src/guiVolumeChange.cpp src/guiVolumeChange.h src/httpfetch.cpp -src/httpfetch.h src/hud.cpp src/hud.h src/imagefilters.cpp @@ -122,19 +114,13 @@ src/inventorymanager.cpp src/inventorymanager.h src/irrlicht_changes/static_text.cpp src/irrlicht_changes/static_text.h -src/irrlichttypes_bloated.h -src/irrlichttypes_extrabloated.h src/irrlichttypes.h src/itemdef.cpp src/itemdef.h -src/itemgroup.h src/itemstackmetadata.cpp src/keycode.cpp -src/keycode.h src/light.cpp -src/light.h src/localplayer.cpp -src/localplayer.h src/log.cpp src/log.h src/main.cpp @@ -146,14 +132,10 @@ src/mapblock_mesh.h src/map.cpp src/mapgen.cpp src/mapgen_flat.cpp -src/mapgen_flat.h src/mapgen_fractal.cpp -src/mapgen_fractal.h src/mapgen.h src/mapgen_singlenode.cpp -src/mapgen_singlenode.h src/mapgen_v5.cpp -src/mapgen_v5.h src/mapgen_v6.cpp src/mapgen_v6.h src/mapgen_v7.cpp @@ -169,7 +151,7 @@ src/map_settings_manager.cpp src/map_settings_manager.h src/mesh.cpp src/mesh.h -src/metadata.cpp +src/mesh_generator_thread.cpp src/metadata.h src/mg_biome.cpp src/mg_biome.h @@ -182,11 +164,8 @@ src/mg_schematic.h src/minimap.cpp src/minimap.h src/modalMenu.h -src/modifiedstate.h src/mods.cpp src/mods.h -src/nameidmapping.cpp -src/nameidmapping.h src/network/clientopcodes.cpp src/network/clientopcodes.h src/network/clientpackethandler.cpp @@ -233,8 +212,6 @@ src/rollback.cpp src/rollback.h src/rollback_interface.cpp src/rollback_interface.h -src/script/clientscripting.cpp -src/script/clientscripting.h src/script/common/c_content.cpp src/script/common/c_content.h src/script/common/c_converter.cpp @@ -257,7 +234,6 @@ src/script/cpp_api/s_inventory.cpp src/script/cpp_api/s_inventory.h src/script/cpp_api/s_item.cpp src/script/cpp_api/s_item.h -src/script/cpp_api/s_mainmenu.cpp src/script/cpp_api/s_mainmenu.h src/script/cpp_api/s_node.cpp src/script/cpp_api/s_node.h @@ -306,10 +282,12 @@ src/script/lua_api/l_sound.cpp src/script/lua_api/l_storage.cpp src/script/lua_api/l_util.cpp src/script/lua_api/l_vmanip.cpp +src/script/scripting_client.cpp +src/script/scripting_client.h src/script/scripting_mainmenu.cpp src/script/scripting_mainmenu.h -src/script/serverscripting.cpp -src/script/serverscripting.h +src/script/scripting_server.cpp +src/script/scripting_server.h src/serialization.cpp src/serialization.h src/server.cpp @@ -361,14 +339,9 @@ src/unittest/test_filepath.cpp src/unittest/test.h src/unittest/test_inventory.cpp src/unittest/test_keycode.cpp -src/unittest/test_mapnode.cpp src/unittest/test_map_settings_manager.cpp -src/unittest/test_nodedef.cpp src/unittest/test_noderesolver.cpp src/unittest/test_noise.cpp -src/unittest/test_objdef.cpp -src/unittest/test_player.cpp -src/unittest/test_profiler.cpp src/unittest/test_random.cpp src/unittest/test_schematic.cpp src/unittest/test_serialization.cpp diff --git a/util/travis/common.sh b/util/travis/common.sh index 35ceec08d..949540967 100644 --- a/util/travis/common.sh +++ b/util/travis/common.sh @@ -1,9 +1,54 @@ #!/bin/bash -e +set_linux_compiler_env() { + if [[ "${COMPILER}" == "gcc-5.1" ]]; then + export CC=gcc-5.1 + export CXX=g++-5.1 + elif [[ "${COMPILER}" == "gcc-6" ]]; then + export CC=gcc-6 + export CXX=g++-6 + elif [[ "${COMPILER}" == "gcc-7" ]]; then + export CC=gcc-7 + export CXX=g++-7 + elif [[ "${COMPILER}" == "clang-3.6" ]]; then + export CC=clang-3.6 + export CXX=clang++-3.6 + elif [[ "${COMPILER}" == "clang-5.0" ]]; then + export CC=clang-5.0 + export CXX=clang++-5.0 + fi +} + +# Linux build only +install_linux_deps() { + sudo apt-get update + sudo apt-get install libirrlicht-dev cmake libbz2-dev libpng12-dev \ + libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev \ + libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev \ + gettext libpq-dev libleveldb-dev +} + +# Mac OSX build only +install_macosx_deps() { + brew update + brew install freetype gettext hiredis irrlicht leveldb libogg libvorbis luajit + if brew ls | grep -q jpeg; then + brew upgrade jpeg + else + brew install jpeg + fi + #brew upgrade postgresql +} + # Relative to git-repository root: TRIGGER_COMPILE_PATHS="src/.*\.(c|cpp|h)|CMakeLists.txt|cmake/Modules/|util/travis/|util/buildbot/" needs_compile() { - git diff --name-only $TRAVIS_COMMIT_RANGE | egrep -q "^($TRIGGER_COMPILE_PATHS)" + RANGE="$TRAVIS_COMMIT_RANGE" + if [[ "$(git diff --name-only $RANGE -- 2>/dev/null)" == "" ]]; then + RANGE="$TRAVIS_COMMIT^...$TRAVIS_COMMIT" + echo "Fixed range: $RANGE" + fi + git diff --name-only $RANGE -- | egrep -q "^($TRIGGER_COMPILE_PATHS)" } diff --git a/util/travis/lint.sh b/util/travis/lint.sh index 4e816bd94..cd5f41779 100644 --- a/util/travis/lint.sh +++ b/util/travis/lint.sh @@ -9,13 +9,7 @@ function perform_lint() { echo "LINT: Using binary $CLANG_FORMAT" CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" - if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then - # Get list of every file modified in this pull request - files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | true)" - else - # Check everything for branch pushes - files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" - fi + files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" local errorcount=0 local fail=0 |