Use container-based infrastructure for Travis
This commit is contained in:
parent
b5ed23d2a6
commit
5751ba0c1c
20
.travis.yml
20
.travis.yml
@ -1,20 +1,17 @@
|
|||||||
language: cpp
|
language: cpp
|
||||||
|
sudo: false
|
||||||
|
|
||||||
compiler:
|
compiler:
|
||||||
- clang
|
- clang
|
||||||
- gcc
|
- gcc
|
||||||
|
|
||||||
before_install:
|
addons:
|
||||||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
apt:
|
||||||
- sudo apt-get update -qq
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
install:
|
packages:
|
||||||
- sudo apt-get install -qq g++-4.8
|
- g++-4.8
|
||||||
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
|
- lua5.1
|
||||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90
|
|
||||||
|
|
||||||
# lua, needed for style checking and possibly later on for bindings generation
|
|
||||||
- sudo apt-get install -qq lua5.1
|
|
||||||
|
|
||||||
script: ./CIbuild.sh
|
script: ./CIbuild.sh
|
||||||
|
|
||||||
@ -26,3 +23,4 @@ notifications:
|
|||||||
email:
|
email:
|
||||||
on_success: change
|
on_success: change
|
||||||
on_failure: always
|
on_failure: always
|
||||||
|
|
||||||
|
@ -6,6 +6,11 @@ export MCSERVER_BUILD_SERIES_NAME="Travis $CC $TRAVIS_MCSERVER_BUILD_TYPE"
|
|||||||
export MCSERVER_BUILD_ID=$TRAVIS_JOB_NUMBER
|
export MCSERVER_BUILD_ID=$TRAVIS_JOB_NUMBER
|
||||||
export MCSERVER_BUILD_DATETIME=`date`
|
export MCSERVER_BUILD_DATETIME=`date`
|
||||||
|
|
||||||
|
if [ "$CXX" == "g++" ]; then
|
||||||
|
# This is a temporary workaround to allow the identification of GCC-4.8 by CMake, required for C++11 features
|
||||||
|
# Travis Docker containers don't allow sudo, which update-alternatives needs, and it seems no alternative to this command is provided, hence:
|
||||||
|
export CXX="/usr/bin/g++-4.8"
|
||||||
|
fi
|
||||||
cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1;
|
cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1;
|
||||||
|
|
||||||
echo "Checking basic style..."
|
echo "Checking basic style..."
|
||||||
|
@ -266,11 +266,18 @@ macro(set_exe_flags)
|
|||||||
add_flags_cxx("-Wno-documentation")
|
add_flags_cxx("-Wno-documentation")
|
||||||
endif()
|
endif()
|
||||||
if ("${CLANG_VERSION}" VERSION_GREATER 3.5)
|
if ("${CLANG_VERSION}" VERSION_GREATER 3.5)
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
check_cxx_compiler_flag(-Wno-reserved-id-macro HAS_NO_RESERVED_ID_MACRO)
|
check_cxx_compiler_flag(-Wno-reserved-id-macro HAS_NO_RESERVED_ID_MACRO)
|
||||||
|
check_cxx_compiler_flag(-Wno-documentation-unknown-command HAS_NO_DOCUMENTATION_UNKNOWN)
|
||||||
if (HAS_NO_RESERVED_ID_MACRO)
|
if (HAS_NO_RESERVED_ID_MACRO)
|
||||||
# Use this flag to ignore error for a reserved macro problem in sqlite 3
|
# Use this flag to ignore error for a reserved macro problem in sqlite 3
|
||||||
add_flags_cxx("-Wno-reserved-id-macro")
|
add_flags_cxx("-Wno-reserved-id-macro")
|
||||||
endif()
|
endif()
|
||||||
|
if (HAS_NO_DOCUMENTATION_UNKNOWN)
|
||||||
|
# Ignore another problem in sqlite
|
||||||
|
add_flags_cxx("-Wno-documentation-unknown-command")
|
||||||
|
endif()
|
||||||
|
add_flags_cxx("-Wno-format-pedantic")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -868,7 +868,7 @@ cLuaState::cStackValue cLuaState::WalkToValue(const AString & a_Name)
|
|||||||
// Remove the previous value from the stack (keep only the new one):
|
// Remove the previous value from the stack (keep only the new one):
|
||||||
lua_remove(m_LuaState, -2);
|
lua_remove(m_LuaState, -2);
|
||||||
} // for elem - path[]
|
} // for elem - path[]
|
||||||
return std::move(cStackValue(*this));
|
return cStackValue(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1040,7 +1040,7 @@ cEnchantments cEnchantments::SelectEnchantmentFromVector(const cWeightedEnchantm
|
|||||||
{
|
{
|
||||||
// Sum up all the enchantments' weights:
|
// Sum up all the enchantments' weights:
|
||||||
int AllWeights = 0;
|
int AllWeights = 0;
|
||||||
for (const auto Enchantment : a_Enchantments)
|
for (const auto & Enchantment : a_Enchantments)
|
||||||
{
|
{
|
||||||
AllWeights += Enchantment.m_Weight;
|
AllWeights += Enchantment.m_Weight;
|
||||||
}
|
}
|
||||||
@ -1054,7 +1054,7 @@ cEnchantments cEnchantments::SelectEnchantmentFromVector(const cWeightedEnchantm
|
|||||||
// Pick a random enchantment:
|
// Pick a random enchantment:
|
||||||
cNoise Noise(a_Seed);
|
cNoise Noise(a_Seed);
|
||||||
int RandomNumber = Noise.IntNoise1DInt(AllWeights) / 7 % AllWeights;
|
int RandomNumber = Noise.IntNoise1DInt(AllWeights) / 7 % AllWeights;
|
||||||
for (const auto Enchantment : a_Enchantments)
|
for (const auto & Enchantment : a_Enchantments)
|
||||||
{
|
{
|
||||||
RandomNumber -= Enchantment.m_Weight;
|
RandomNumber -= Enchantment.m_Weight;
|
||||||
if (RandomNumber <= 0)
|
if (RandomNumber <= 0)
|
||||||
|
@ -724,7 +724,7 @@ void cProtocol180::SendMapData(const cMap & a_Map, int a_DataStartX, int a_DataS
|
|||||||
Pkt.WriteBEUInt8(static_cast<UInt8>(a_Map.GetScale()));
|
Pkt.WriteBEUInt8(static_cast<UInt8>(a_Map.GetScale()));
|
||||||
|
|
||||||
Pkt.WriteVarInt32(static_cast<UInt32>(a_Map.GetDecorators().size()));
|
Pkt.WriteVarInt32(static_cast<UInt32>(a_Map.GetDecorators().size()));
|
||||||
for (const auto Decorator : a_Map.GetDecorators())
|
for (const auto & Decorator : a_Map.GetDecorators())
|
||||||
{
|
{
|
||||||
Pkt.WriteBEUInt8(static_cast<Byte>((static_cast<Int32>(Decorator.GetType()) << 4) | (Decorator.GetRot() & 0xF)));
|
Pkt.WriteBEUInt8(static_cast<Byte>((static_cast<Int32>(Decorator.GetType()) << 4) | (Decorator.GetRot() & 0xF)));
|
||||||
Pkt.WriteBEUInt8(static_cast<UInt8>(Decorator.GetPixelX()));
|
Pkt.WriteBEUInt8(static_cast<UInt8>(Decorator.GetPixelX()));
|
||||||
|
Loading…
Reference in New Issue
Block a user