Skip to content

Commit

Permalink
Release 0.1.11.1-alpha: Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
krzys-h committed May 10, 2018
2 parents b5cc768 + 7aaac44 commit af306c4
Show file tree
Hide file tree
Showing 629 changed files with 3,765 additions and 1,223 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ set(COLOBOT_VERSION_MINOR 1)
set(COLOBOT_VERSION_REVISION 11)

# Used on official releases
set(COLOBOT_VERSION_RELEASE_CODENAME "-alpha")
#set(COLOBOT_VERSION_RELEASE_CODENAME "-alpha")
# Used on unreleased, development builds
#set(COLOBOT_VERSION_UNRELEASED "+alpha")
set(COLOBOT_VERSION_UNRELEASED "+alpha")

# Append git characteristics to version
if(DEFINED COLOBOT_VERSION_UNRELEASED)
Expand Down Expand Up @@ -132,8 +132,13 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")

message(STATUS "Detected GCC version 4.7+")

set(NORMAL_CXX_FLAGS "-std=gnu++11 -Wall -Werror -Wold-style-cast -pedantic-errors")
set(NORMAL_CXX_FLAGS "-std=gnu++11 -Wall -Werror -Wold-style-cast -pedantic-errors -Wmissing-declarations")
set(NORMAL_CXX_FLAGS "${NORMAL_CXX_FLAGS} -Wno-error=deprecated-declarations") # updated version of physfs is not available on some platforms so we keep using deprecated functions, see #958

if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set(NORMAL_CXX_FLAGS "${NORMAL_CXX_FLAGS} -Wsuggest-override")
endif()

set(RELEASE_CXX_FLAGS "-O2")
set(DEBUG_CXX_FLAGS "-g -O0")
set(TEST_CXX_FLAGS "-pthread")
Expand All @@ -145,7 +150,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")

message(STATUS "Detected Clang version 3.1+")

set(NORMAL_CXX_FLAGS "-std=c++11 -Wall -Werror -Wold-style-cast -pedantic-errors")
set(NORMAL_CXX_FLAGS "-std=c++11 -Wall -Werror -Wold-style-cast -pedantic-errors -Wmissing-prototypes")
set(NORMAL_CXX_FLAGS "${NORMAL_CXX_FLAGS} -Wno-error=deprecated-declarations") # updated version of physfs is not available on some platforms so we keep using deprecated functions, see #958
set(RELEASE_CXX_FLAGS "-O2")
set(DEBUG_CXX_FLAGS "-g -O0")
Expand Down
302 changes: 243 additions & 59 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,71 +1,255 @@
#!/usr/bin/env groovy
if (env.BRANCH_NAME.startsWith('PR-')) {
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactNumToKeepStr: '1']]])
} else {
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '30', artifactNumToKeepStr: '20']]])
}

if (env.CHANGE_TARGET == 'master') {
error("This pull request targets the wrong branch. Please reopen the pull request targetting the dev branch.")
}

node('master') {
stage('Pull changes') {
checkout scm
pipeline {
agent { label 'colobot-build' }
options {
buildDiscarder(logRotator(artifactDaysToKeepStr: '30', artifactNumToKeepStr: '20'))
}

stage('Build Windows') {
sh 'mkdir -p build/windows'
dir('build/windows') {
sh '''
cmake \
-DCMAKE_INSTALL_PREFIX=/install \
-DCMAKE_TOOLCHAIN_FILE=/opt/mxe/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DTOOLS=1 -DTESTS=0 ../..
make
rm -rf install
DESTDIR=. make install
'''
stages {
stage('Check pull request target') {
when { changeRequest() }
steps {
script {
if (env.CHANGE_TARGET == 'master') {
throw "This pull request targets the wrong branch. Please reopen the pull request targetting the dev branch."
}
}
}
}
sh 'rm -f windows-debug.zip'
zip zipFile: 'windows-debug.zip', archive: true, dir: 'build/windows/install'
}

stage('Build Linux') {
sh 'mkdir -p build/linux'
dir('build/linux') {
sh '''
cmake \
-DCMAKE_INSTALL_PREFIX=/install -DCOLOBOT_INSTALL_BIN_DIR=/install -DCOLOBOT_INSTALL_LIB_DIR=/install -DCOLOBOT_INSTALL_DATA_DIR=/install/data -DCOLOBOT_INSTALL_I18N_DIR=/install/lang -DCMAKE_SKIP_INSTALL_RPATH=ON \
-DBOOST_STATIC=ON -DGLEW_STATIC=ON -DGLEW_LIBRARY=/usr/lib64/libGLEW.a \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DTOOLS=1 -DTESTS=1 -DDESKTOP=0 ../..
make
rm -rf install
DESTDIR=. make install
patchelf --set-rpath '.' install/colobot
'''
stage('Build') {
parallel {
stage('Build Windows') {
steps {
sh 'mkdir -p build/windows'
dir('build/windows') {
sh '''
cmake \
-DCMAKE_INSTALL_PREFIX=/install \
-DCMAKE_TOOLCHAIN_FILE=/opt/mxe/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DTOOLS=1 -DTESTS=0 ../..
make
rm -rf install
DESTDIR=. make install
'''
}
}
post {
success {
sh 'rm -f windows-debug.zip'
zip zipFile: 'windows-debug.zip', archive: true, dir: 'build/windows/install'
}
}
}

stage('Build Linux') {
steps {
sh 'mkdir -p build/linux'
dir('build/linux') {
sh '''
cmake \
-DCMAKE_INSTALL_PREFIX=/install -DCOLOBOT_INSTALL_BIN_DIR=/install -DCOLOBOT_INSTALL_LIB_DIR=/install -DCOLOBOT_INSTALL_DATA_DIR=/install/data -DCOLOBOT_INSTALL_I18N_DIR=/install/lang -DCMAKE_SKIP_INSTALL_RPATH=ON \
-DBOOST_STATIC=ON -DGLEW_STATIC=ON -DGLEW_LIBRARY=/usr/lib64/libGLEW.a \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DTOOLS=1 -DTESTS=1 -DDESKTOP=0 ../..
make
rm -rf install
DESTDIR=. make install
patchelf --set-rpath '.' install/colobot
'''
}
}
post {
success {
sh 'rm -f linux-debug.zip'
zip zipFile: 'linux-debug.zip', archive: true, dir: 'build/linux/install'
}
}
}
}
}
sh 'rm -f linux-debug.zip'
zip zipFile: 'linux-debug.zip', archive: true, dir: 'build/linux/install'
}

stage('Doxygen') {
dir('build/linux') {
sh 'make doc'
stage('Generate docs') {
steps {
dir('build/linux') {
sh 'make doc'
}
}
post {
success {
publishHTML([reportName: 'Doxygen', reportDir: 'build/linux/doc/html', reportFiles: 'index.html', reportTitles: '', allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false])
}
}
}
publishHTML target: [$class: 'HtmlPublisherTarget', reportName: 'Doxygen', reportDir: 'build/linux/doc/html', reportFiles: 'index.html']
}

stage('Run tests') {
dir('build/linux') {
sh './colobot_ut --gtest_output=xml:gtestresults.xml || true'
stage('Run tests') {
steps {
dir('build/linux') {
sh './colobot_ut --gtest_output=xml:gtestresults.xml || true'
}
step([$class: 'XUnitBuilder', testTimeMargin: '3000', thresholdMode: 1, thresholds: [[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '0'], [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']], tools: [[$class: 'GoogleTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: 'build/linux/gtestresults.xml', skipNoTestFiles: false, stopProcessingIfError: true]]])
}
// TODO: Maybe run Windows tests using wine as well?
}
step([$class: 'XUnitBuilder', testTimeMargin: '3000', thresholdMode: 1, thresholds: [[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '0'], [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']], tools: [[$class: 'GoogleTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: 'build/linux/gtestresults.xml', skipNoTestFiles: false, stopProcessingIfError: true]]])
}

// Clean workspace after building pull requests
// to save disk space on the Jenkins host
if (env.BRANCH_NAME.startsWith('PR-')) {
cleanWs()
stage('Run colobot-lint') {
environment {
CC = '/usr/lib/llvm-3.6/bin/clang'
CXX = '/usr/lib/llvm-3.6/bin/clang++'
CLANG_PREFIX = '/usr/lib/llvm-3.6'
}
steps {
copyArtifacts filter: 'build/colobot-lint,build/html_report.tar.gz,Tools/count_errors.py', fingerprintArtifacts: true, projectName: 'colobot/colobot-lint/master', selector: lastSuccessful(), target: 'colobot-lint'
sh 'chmod +x colobot-lint/Tools/count_errors.py' // TODO: ???
sh 'mkdir -p build/lint'
dir('build/lint') {
// The cd is required here because /var/lib/jenkins is a symlink and colobot-lint breaks otherwise...
sh 'cd $WORKSPACE/build/lint; cmake -DCOLOBOT_LINT_BUILD=1 -DTESTS=1 -DTOOLS=1 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 $WORKSPACE'
sh '''#!/bin/bash
set -e +x
# Run colobot-lint
COLOBOT_DIR="$WORKSPACE"
COLOBOT_BUILD_DIR="$WORKSPACE/build/lint"
COLOBOT_LINT_BUILD_DIR="$WORKSPACE/colobot-lint/build"
COLOBOT_LINT_REPORT_FILE="$WORKSPACE/build/lint/colobot_lint_report.xml"
# CLANG_PREFIX="/usr/lib/llvm-3.6" # Set in top-level environment block
cd "$COLOBOT_LINT_BUILD_DIR"
chmod +x ./colobot-lint
# Workaround for Clang not finding system headers
rm -rf bin/
mkdir -p bin
mv ./colobot-lint ./bin/
rm -f ./lib
ln -s ${CLANG_PREFIX}/lib ./lib
echo "Running colobot-lint"
find "$WORKSPACE" \\( -wholename "$COLOBOT_DIR/src/*.cpp" \
-or -wholename "$COLOBOT_DIR/test/unit/*.cpp" \
-or -wholename "$COLOBOT_BUILD_DIR/fake_header_sources/src/*.cpp" \
-or -wholename "$COLOBOT_BUILD_DIR/fake_header_sources/test/unit/*.cpp" \\) \
-exec ./bin/colobot-lint \
-verbose \
-output-format xml \
-output-file "$COLOBOT_LINT_REPORT_FILE" \
-p "$COLOBOT_BUILD_DIR" \
-project-local-include-path "$COLOBOT_DIR/src" -project-local-include-path "$COLOBOT_BUILD_DIR/src" \
-license-template-file "$COLOBOT_DIR/LICENSE-HEADER.txt" \
{} +
'''
sh '''#!/bin/bash
set -e +x
# Generate HTML report
COLOBOT_LINT_BUILD_DIR="$WORKSPACE/colobot-lint/build"
COLBOT_LINT_REPORT_FILE="$WORKSPACE/build/lint/colobot_lint_report.xml"
HTML_REPORT_DIR="$WORKSPACE/build/lint/html_report"
echo "Generating HTML report"
cd "$COLOBOT_LINT_BUILD_DIR"
rm -rf HtmlReport/
tar -zxf html_report.tar.gz
HtmlReport/generate.py --xml-report "$COLBOT_LINT_REPORT_FILE" --output-dir "$HTML_REPORT_DIR"
'''
script {
retcode = sh script: '''#!/bin/bash
set -e +x
# Update stable/unstable build status
ret=0
COLOBOT_LINT_REPORT_FILE="$WORKSPACE/build/lint/colobot_lint_report.xml"
COLOBOT_LINT_DIR="$WORKSPACE/colobot-lint"
OVERALL_STABLE_RULES=(
"class naming"
"code block placement"
"compile error"
# "compile warning"
# "enum naming"
# "function naming"
"header file not self-contained"
# "implicit bool cast"
# "include style"
# "inconsistent declaration parameter name"
"license header"
# "naked delete"
# "naked new"
# "old style function"
"old-style null pointer"
# "possible forward declaration"
"undefined function"
# "uninitialized field"
# "uninitialized local variable"
# "unused forward declaration"
# "variable naming"
"whitespace"
)
echo "Checking rule stability (overall)"
for ((i = 0; i < ${#OVERALL_STABLE_RULES[@]}; i++)); do
rule="${OVERALL_STABLE_RULES[$i]}"
count="$("$COLOBOT_LINT_DIR/Tools/count_errors.py" --rule-filter="$rule" --xml-report-file "$COLOBOT_LINT_REPORT_FILE")"
if [ "$count" != "0" ]; then
echo "UNSTABLE RULE: $rule ($count occurences)"
ret=1
fi
done
STABLE_RULES_WITHOUT_CBOT=(
"class naming"
"code block placement"
"compile error"
"compile warning"
# "enum naming"
# "function naming"
"header file not self-contained"
# "implicit bool cast"
"include style"
"inconsistent declaration parameter name"
"license header"
"naked delete"
"naked new"
# "old style function"
"old-style null pointer"
# "possible forward declaration"
"undefined function"
"uninitialized field"
# "uninitialized local variable"
"unused forward declaration"
# "variable naming"
"whitespace"
)
echo "Checking rule stability (without CBOT)"
for ((i = 0; i < ${#STABLE_RULES_WITHOUT_CBOT[@]}; i++)); do
rule="${STABLE_RULES_WITHOUT_CBOT[$i]}"
count="$("$COLOBOT_LINT_DIR/Tools/count_errors.py" --rule-filter="$rule" --file-filter="-.*CBot.*" --xml-report-file "$COLOBOT_LINT_REPORT_FILE")"
if [ "$count" != "0" ]; then
echo "UNSTABLE RULE: $rule (without CBOT, $count occurences)"
ret=1
fi
done
exit $ret
''', returnStatus: true
if (retcode != 0) {
currentBuild.result = 'UNSTABLE'
}
}
}

// TODO: cppcheck publisher STILL doesn't have pipeline support
// There is an open pull request though, merged but no release yet... https://github.com/jenkinsci/cppcheck-plugin/pull/36

publishHTML([reportName: 'Colobot-lint HTML report', reportDir: 'build/lint/html_report', reportFiles: 'index.html', reportTitles: '', allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true])
}
}
}
}
2 changes: 1 addition & 1 deletion LICENSE-HEADER.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Colobot: Gold Edition source code
* Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
* Copyright (C) 2001-2018, Daniel Roux, EPSITEC SA & TerranovaTeam
* http://epsitec.ch; http://colobot.info; http://github.com/colobot
*
* This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion data
Submodule data updated 47 files
+32 −0 help/bots/E/botbc.txt
+32 −0 help/bots/E/botbj.txt
+32 −0 help/bots/E/botbr.txt
+32 −0 help/bots/E/botbs.txt
+153 −6 help/bots/po/bots.pot
+153 −6 help/bots/po/de.po
+153 −6 help/bots/po/fr.po
+153 −6 help/bots/po/pl.po
+153 −6 help/bots/po/ru.po
+5 −0 help/cbot/E/category.txt
+19 −9 help/cbot/po/cbot.pot
+19 −9 help/cbot/po/de.po
+19 −9 help/cbot/po/fr.po
+19 −9 help/cbot/po/pl.po
+42 −26 help/cbot/po/ru.po
+5 −3 help/generic/E/command.txt
+13 −15 help/generic/po/de.po
+13 −15 help/generic/po/fr.po
+13 −11 help/generic/po/generic.pot
+11 −7 help/generic/po/pl.po
+13 −15 help/generic/po/ru.po
+ icons/botbc.png
+ icons/botbj.png
+ icons/botbr.png
+ icons/botbs.png
+482 −0 models-new/neutron.txt
+ models/neutron.mod
+ textures-src/effect00/effect00-final_pattern.xcf
+ textures-src/effect01/effect01-final_pattern.xcf
+ textures-src/effect02/effect02-final_pattern.xcf
+ textures-src/effect03/effect03-final_pattern.xcf
+ textures-src/interface/button1/button1-final_pattern.xcf
+ textures-src/interface/button2/button2-final_pattern.xcf
+ textures-src/interface/button3/button3-new_pattern_wip.xcf
+29 −2 textures-src/interface/button4/button4-01-src_vector.svg
+29 −2 textures-src/interface/button4/button4-02-src_vector.svg
+29 −2 textures-src/interface/button4/button4-03-src_vector.svg
+29 −2 textures-src/interface/button4/button4-04-src_vector.svg
+155 −0 textures-src/interface/button4/button4-05-src_vector.svg
+108 −0 textures-src/interface/button4/button4-06-src_vector.svg
+110 −0 textures-src/interface/button4/button4-07-src_vector.svg
+102 −0 textures-src/interface/button4/button4-08-src_vector.svg
+ textures-src/interface/button4/button4-final_pattern.xcf
+ textures-src/interface/generico/generico-final_pattern.xcf
+ textures-src/interface/intro3/intro3-final_pattern.xcf
+ textures-src/interface/mouse/mouse-final_pattern.xcf
+ textures/interface/button4.png
4 changes: 4 additions & 0 deletions po/colobot.pot
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ msgstr ""
msgid "The battle has ended"
msgstr ""

#, c-format
msgid "Time: %s"
msgstr ""

#, c-format
msgid "%s: %d pts"
msgstr ""
Expand Down
Loading

0 comments on commit af306c4

Please sign in to comment.