|
|
@@ -53,8 +53,8 @@ task :cmake do
|
|
|
script = 'cmake_generic'
|
|
|
platform = 'native'
|
|
|
build_options = ''
|
|
|
- # TODO: Need to find a way to automatically populate the array with all the Urho3D supported build options, at the moment it only contains those being used in CI
|
|
|
- ['URHO3D_64BIT', 'URHO3D_LIB_TYPE', 'URHO3D_ANGELSCRIPT', 'URHO3D_LUAJIT', 'URHO3D_LUAJIT_AMALG', 'URHO3D_STATIC_RUNTIME', 'URHO3D_PCH', 'URHO3D_LINT', 'URHO3D_BINDINGS', 'URHO3D_OPENGL', 'URHO3D_D3D11', 'URHO3D_TESTING', 'URHO3D_TEST_TIMEOUT', 'URHO3D_UPDATE_SOURCE_TREE', 'URHO3D_SAMPLES', 'URHO3D_TOOLS', 'URHO3D_DEPLOYMENT_TARGET', 'URHO3D_USE_LIB64_RPM', 'CMAKE_BUILD_TYPE', 'CMAKE_OSX_DEPLOYMENT_TARGET', 'IOS', 'IPHONEOS_DEPLOYMENT_TARGET', 'TVOS', 'APPLETVOS_DEPLOYMENT_TARGET', 'WIN32', 'MINGW', 'DIRECTX_INC_SEARCH_PATHS', 'DIRECTX_LIB_SEARCH_PATHS', 'ANDROID', 'ANDROID_ABI', 'ANDROID_NATIVE_API_LEVEL', 'ANDROID_TOOLCHAIN_NAME', 'RPI', 'RPI_ABI', 'ARM', 'ARM_ABI_FLAGS', 'WEB', 'EMSCRIPTEN_SHARE_DATA', 'EMSCRIPTEN_WASM', 'EMSCRIPTEN_EMRUN_BROWSER', 'EMSCRIPTEN_AUTO_SHELL'].each { |var|
|
|
|
+ File.readlines('script/.build-options').each { |var|
|
|
|
+ var.chomp!
|
|
|
ARGV << "#{var}=\"#{ENV[var]}\"" if ENV[var] && !ARGV.find { |arg| /#{var}=/ =~ arg }
|
|
|
}
|
|
|
ARGV.each { |option|
|
|
|
@@ -342,6 +342,8 @@ task :ci do
|
|
|
# Show CMake version
|
|
|
system 'cmake --version' or abort 'Failed to find CMake'
|
|
|
puts; $stdout.flush
|
|
|
+ # Ensure '.build-options' and '.env-file' are up-to-date
|
|
|
+ system %Q(perl -ne 'undef $/; print $1 if /(Build Option.*?(?=\n\n))/s' Docs/GettingStarted.dox |tail -n +3 |cut -d'|' -f2 |tr -d [:blank:] >script/.build-options && cat script/.build-options <(perl -ne 'while (/(\w+)=\w+/g) {print "$1\n"}' .travis.yml) |sort |uniq |grep -v ^PATH$ >script/.env-file)
|
|
|
# Using out-of-source build tree when using Travis-CI; 'build_tree' environment variable is already set when on AppVeyor
|
|
|
ENV['build_tree'] = '../Build' unless ENV['APPVEYOR']
|
|
|
# Always use a same build configuration per build job to keep ccache's cache size small; default to RELEASE unless specifically defined
|
|
|
@@ -349,7 +351,7 @@ task :ci do
|
|
|
# Currently we don't have the infra to test run all the platforms; also skip when doing packaging build due to time constraint
|
|
|
ENV['URHO3D_TESTING'] = '1' if (((ENV['LINUX'] && !ENV['URHO3D_64BIT']) || (ENV['OSX'] && !ENV['IOS'] && !ENV['TVOS']) || ENV['APPVEYOR']) && !ENV['PACKAGE_UPLOAD']) || ENV['WEB']
|
|
|
# When not explicitly specified then use generic generator
|
|
|
- generator = ENV['XCODE'] ? 'xcode' : (ENV['APPVEYOR'] && !ENV['MINGW'] ? 'vs2017' : '')
|
|
|
+ generator = ENV['XCODE'] ? 'xcode' : (ENV['APPVEYOR'] ? (ENV['MINGW'] ? 'mingw' : 'vs2017') : '')
|
|
|
# LuaJIT on MinGW build is not possible on Travis-CI with Ubuntu 14.04 LTS still as its GCC cross-compiler does not have native exception handling
|
|
|
# LuaJIT on Web platform is not possible
|
|
|
jit = (ENV['WIN32'] && ENV['TRAVIS']) || ENV['WEB'] ? '' : 'JIT=1 URHO3D_LUAJIT_AMALG='
|
|
|
@@ -532,8 +534,7 @@ task :ci_site_update do
|
|
|
puts "Updating source tree...\n\n"
|
|
|
# Supply GIT credentials to push source tree changes to urho3d/Urho3D.git
|
|
|
system 'git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/$TRAVIS_REPO_SLUG.git'
|
|
|
- system %Q(perl -ne 'undef $/; print $1 if /(Build Option.*?(?=\n\n))/s' Docs/GettingStarted.dox |tail -n +3 |cut -d'|' -f2 |tr -d [:blank:] >.env-file)
|
|
|
- system "git add .env-file Source && git commit -qm 'Travis CI: source tree update at #{Time.now.utc}.' >/dev/null 2>&1" # Use extra quiet mode as there could be no changes at all
|
|
|
+ system "git add script Source && git commit -qm 'Travis CI: source tree update at #{Time.now.utc}.' >/dev/null 2>&1" # Use extra quiet mode as there could be no changes at all
|
|
|
if /2008-([0-9]{4}) the Urho3D project/.match(File.read('Rakefile'))[1].to_i != Time.now.year
|
|
|
# Automatically bump copyright when crossing a new year and give instruction to clear the cache if so since the cache is of no use anyway because of massive changes
|
|
|
system "git add #{bump_copyright_year.join ' '} && if git commit -qm 'Travis CI: bump copyright to #{Time.now.year}.\n[cache clear]'; then git push origin HEAD:#{ENV['TRAVIS_BRANCH']} -q >/dev/null 2>&1 && echo Bumped copyright - Happy New Year!; fi" or abort "Failed to push copyright update for #{ENV['TRAVIS_BRANCH']}"
|