Permalink
Browse files

RTags CI/CD setup

  • Loading branch information...
cslux committed Oct 13, 2018
1 parent 48d7187 commit e4072bc62f80048176117d16883bd551d1bdf7db
Showing with 166 additions and 222 deletions.
  1. +5 −6 .dir-locals.el
  2. +36 −29 .travis.yml
  3. +71 −66 CMakeLists.txt
  4. +5 −36 README.org
  5. +37 −11 scripts/bump-version.sh
  6. +4 −4 scripts/gen-man-pages.sh
  7. +7 −69 scripts/rtags-release.sh
  8. +1 −1 scripts/travis.sh
View
@@ -3,13 +3,12 @@
((nil
(indent-tabs-mode))
(yaml-mode
(yaml-indent-offset . 2))
(c++-mode
(c-basic-offset . 4)
(indent-tabs-mode))
(c-basic-offset . 4))
(cmake-mode
(cmake-tab-width . 4)
(indent-tabs-mode))
(cmake-tab-width . 4))
(python-mode
(python-indent-offset . 4)
(tab-width . 4)
(indent-tabs-mode)))
(tab-width . 4)))
View
@@ -1,36 +1,43 @@
#
# Available repositories are listed here:
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
#
language: cpp
sudo: required
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
- python3-pip
- libcppunit-dev
git:
depth: 3
matrix:
include:
- os: linux
compiler: g++
dist: trusty
env: T=g++-linux COMPILER_VERSION=-4.9
- os: osx
compiler: clang
env: T=clang-osx
branches:
only:
- master
- develop
only:
- master
- develop
- /^v[0-9]+\.[0-9]+$/
script: ./scripts/travis.sh
jobs:
include:
- os: linux
compiler: g++
dist: trusty
env: T=g++-linux COMPILER_VERSION=-4.9
script: ./scripts/travis.sh
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
- python3-pip
- libcppunit-dev
- os: osx
script: ./scripts/travis.sh
compiler: clang
env: T=clang-osx
- stage: Release
before_deploy: ./scripts/rtags-release.sh
script: true
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: DOlyG6rhNwvBt+AfQPbOR6gjqvYQYU8rEiFB7cjOY+ghDMw8ijcd3akORusrFqhkCbDLxK2/J6VbNLZCErv/mAUOvt+FPm9DsSbrulKRAeS5l1YQoUfokAE5AFaRSHGlshilYrDvDjljpyRLyZJZheQjSTeUbZYJQEEJQpTQhOQ=
file:
- build/rtags-${TRAVIS_TAG#v*}.tar.bz2
- build/rtags-${TRAVIS_TAG#v*}.tar.gz
on:
tags: true
View
@@ -6,55 +6,6 @@ set(RTAGS_VERSION_DATABASE 126)
set(RTAGS_VERSION_SOURCES_FILE 14)
set(RTAGS_VERSION ${RTAGS_VERSION_MAJOR}.${RTAGS_VERSION_MINOR}.${RTAGS_VERSION_DATABASE})
set(RCT_WITH_TESTS ${BUILD_TESTING})
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
if (APPLE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g")
else ()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ggdb")
endif ()
if (ASAN)
string(REPLACE "," ";" ASANS ${ASAN})
foreach (SANITIZE ${ASANS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${SANITIZE}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${SANITIZE}")
endforeach ()
endif ()
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_COMPILER_IS_CLANGCXX TRUE)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
include(FeatureSummary)
add_subdirectory(src)
add_custom_target(man
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen-man-pages.sh" "${PROJECT_BINARY_DIR}/bin"
DEPENDS man/man7/rdm.7 man/man7/rc.7)
add_dependencies(man rdm rc)
if (EXISTS "rules.ninja")
add_custom_target(release COMMAND ${CMAKE_COMMAND} -GNinja -DCMAKE_BUILD_TYPE=Release . WORKING_DIRECTORY .)
add_custom_target(debug COMMAND ${CMAKE_COMMAND} -GNinja -DCMAKE_BUILD_TYPE=Debug . WORKING_DIRECTORY .)
else()
add_custom_target(release COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release . WORKING_DIRECTORY .)
add_custom_target(debug COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug . WORKING_DIRECTORY .)
endif()
# Create uninstall script and target
configure_file("${CMAKE_MODULE_PATH}/Uninstall.cmake.in" "${CMAKE_BINARY_DIR}/Uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/Uninstall.cmake")
if (RTAGS_ENABLE_DEV_OPTIONS)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "RTAGS")
set(CPACK_PACKAGE_VENDOR "RTags")
@@ -76,31 +27,85 @@ if (RTAGS_ENABLE_DEV_OPTIONS)
"~$"
"\\\\.gitignore$"
"\\\\.gitmodules$"
"^${PROJECT_SOURCE_DIR}/.git/"
"\\\\.git/"
"\\\\.travis.yml$"
"\\\\.github/"
"^${PROJECT_SOURCE_DIR}/.dir-locals.el"
"^${PROJECT_SOURCE_DIR}/build/"
)
include(CPack)
endif ()
else ()
include(CTest)
set(RCT_WITH_TESTS ${BUILD_TESTING})
if (BUILD_TESTING)
find_package(Perl QUIET)
if(PERL_FOUND)
add_test(NAME SBRootTest COMMAND perl "${CMAKE_SOURCE_DIR}/tests/sbroot/sbroot_test.pl")
set_property(TEST SBRootTest PROPERTY ENVIRONMENT "RTAGS_BINARY_DIR=${CMAKE_BINARY_DIR}/bin")
else()
message(WARNING "Perl not found! Excluding sbroot test from tests.")
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
if (APPLE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g")
else ()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ggdb")
endif ()
if (ASAN)
string(REPLACE "," ";" ASANS ${ASAN})
foreach (SANITIZE ${ASANS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${SANITIZE}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${SANITIZE}")
endforeach ()
endif ()
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_COMPILER_IS_CLANGCXX TRUE)
endif()
find_program(NOSETEST NAMES nosetests nosetests-2.7 PATHS "$ENV{HOME}/.local/bin")
if (NOSETEST)
add_test(NAME nosetests COMMAND ${NOSETEST} -w ${CMAKE_SOURCE_DIR}/tests/automated --no-byte-compile -v)
set_property(TEST nosetests PROPERTY ENVIRONMENT "RTAGS_BINARY_DIR=${CMAKE_BINARY_DIR}/bin")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
include(FeatureSummary)
add_subdirectory(src)
add_custom_target(man
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/scripts/gen-man-pages.sh" "${PROJECT_BINARY_DIR}/bin"
DEPENDS man/man7/rdm.7 man/man7/rc.7)
add_dependencies(man rdm rc)
if (EXISTS "rules.ninja")
add_custom_target(release COMMAND ${CMAKE_COMMAND} -GNinja -DCMAKE_BUILD_TYPE=Release . WORKING_DIRECTORY .)
add_custom_target(debug COMMAND ${CMAKE_COMMAND} -GNinja -DCMAKE_BUILD_TYPE=Debug . WORKING_DIRECTORY .)
else()
message(WARNING "Nosetests executable not found! Excluding automated_tests from tests.")
add_custom_target(release COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release . WORKING_DIRECTORY .)
add_custom_target(debug COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug . WORKING_DIRECTORY .)
endif()
# Create uninstall script and target
configure_file("${CMAKE_MODULE_PATH}/Uninstall.cmake.in" "${CMAKE_BINARY_DIR}/Uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/Uninstall.cmake")
include(CTest)
if (BUILD_TESTING)
find_package(Perl QUIET)
if(PERL_FOUND)
add_test(NAME SBRootTest COMMAND perl "${CMAKE_SOURCE_DIR}/tests/sbroot/sbroot_test.pl")
set_property(TEST SBRootTest PROPERTY ENVIRONMENT "RTAGS_BINARY_DIR=${CMAKE_BINARY_DIR}/bin")
else()
message(WARNING "Perl not found! Excluding sbroot test from tests.")
endif()
find_program(NOSETEST NAMES nosetests nosetests-2.7 PATHS "$ENV{HOME}/.local/bin")
if (NOSETEST)
add_test(NAME nosetests COMMAND ${NOSETEST} -w ${CMAKE_SOURCE_DIR}/tests/automated --no-byte-compile -v)
set_property(TEST nosetests PROPERTY ENVIRONMENT "RTAGS_BINARY_DIR=${CMAKE_BINARY_DIR}/bin")
else()
message(WARNING "Nosetests executable not found! Excluding automated_tests from tests.")
endif ()
endif ()
endif ()
feature_summary(INCLUDE_QUIET_PACKAGES WHAT ALL)
feature_summary(INCLUDE_QUIET_PACKAGES WHAT ALL)
endif ()
View
@@ -189,13 +189,11 @@ sudo port install clang-3.5
git clone --recursive https://github.com/Andersbakken/rtags.git
#+END_SRC
You can also download the sources from here:
RTags releases are available for download under the [[https://github.com/Andersbakken/rtags/releases][releases]] page.
https://andersbakken.github.io/rtags-releases/rtags-2.20.tar.bz2
or
https://andersbakken.github.io/rtags-releases/rtags-2.20.tar.gz
The *Source code (zip)* and *Source code (tar.gz)* contain just the bare
bone RTags source code. You need to download the *rtags-VERSION.tar.bz2* or
*rtags-VERSION.tar.gz* archive, to be able to build RTags.
- Building RTags
@@ -1216,36 +1214,7 @@ other formats etc), just drop us a note.
#+begin_src sh
make all test # Build the binaries first
#+end_src
* Disclaimer
RTags is still under development and is not the most stable piece of software
you'll ever find. We're constantly working to improve on it.
* Release notes
We won't go back and add release notes for previous versions but we'll
try to do it from now.
2.19:
- Seemingly improved performance for completions due to better
handling of unsaved files. Apparently stdin and processes in emacs
are not our friends. Tempfiles on the other hand seem to be
significantly faster.
- Make skipped ranges work again.
- Add a new feature, rtags-find-dead-functions (Issue #1152)
- Various contributions that improve code completion
- Fix an issue when jumping to macro definition from a macro
expansion.
- Fix issue #1214. Socket file doesn't need to be resolved.
- Various other fixes, code cleanup and infrastructure work.
2.20
- Diagnostics from completions can be enabled with
--completion-diagnostics. It seems quite fast but may have
bugs. We'll keep working on it.
- A nasty bug with our file system watcher and inotify would cause us
to stop getting modifications from compile_commands.json. This has
been an absolute thorn in RTags' side for years. I'm extremely
pleased to finally have found this bug. This very severely
impacted my personal rtags experience and likely has for lots of
other people as well.
- Fix a weird edge-case bug when running rdm with --no-realpath and
re-running without this switch (and vice-verse)
View
@@ -1,26 +1,52 @@
#!/bin/bash
#!/bin/bash -e
SCRIPT="$(readlink -f ${BASH_SOURCE[0]})"
DIR="$(dirname $SCRIPT)"
# echo "$SCRIPT $DIR"
MAJOR=`echo $1 | awk -F. '{print $1}'`
MINOR=`echo $1 | awk -F. '{print $2}'`
MAJOR=$(echo $1 | awk -F. '{print $1}')
MINOR=$(echo $1 | awk -F. '{print $2}')
if ! echo "$1" | grep -q "^[0-9]\+\.[0-9]\+$"; then
echo "Bad argument: \"$1\""
echo "Usage bump-version.sh 3.22"
exit 1
fi
SED=sed
[ -n "`which gsed`" ] && SED=gsed
JOBS=$(getconf _NPROCESSORS_ONLN)
if [ "$(uname)" == "Darwin" ]; then
SED=$(which gsed)
else
SED=$(which sed)
fi
if [ ! -x "$SED" ]; then
echo "You need sed installed (and on Mac it needs to be gsed) to run ${BASH_SOURCE[0]}"
exit 1
fi
cd $DIR/..
$SED -i"" \
-e "s,^set(RTAGS_VERSION_MAJOR [0-9]\+),set(RTAGS_VERSION_MAJOR $MAJOR)," \
-e "s,^set(RTAGS_VERSION_MINOR [0-9]\+),set(RTAGS_VERSION_MINOR $MINOR)," \
CMakeLists.txt
$SED -i"" \
-e "s,^(defconst rtags-package-version \"[0-9]\+\.[0-9]\+\"),(defconst rtags-package-version \"${MAJOR}.${MINOR}\")," \
-e "s,^;; Version: [0-9]\+\.[0-9]\+,;; Version: ${MAJOR}.${MINOR}," \
src/rtags.el
$SED -i"" -e "s,^set(RTAGS_VERSION_MAJOR [0-9]\+),set(RTAGS_VERSION_MAJOR $MAJOR)," -e "s,^set(RTAGS_VERSION_MINOR [0-9]\+),set(RTAGS_VERSION_MINOR $MINOR)," "$DIR/../CMakeLists.txt"
$SED -i"" -e "s,^(defconst rtags-package-version \"[0-9]\+\.[0-9]\+\"),(defconst rtags-package-version \"${MAJOR}.${MINOR}\")," "$DIR/../src/rtags.el"
$SED -i"" -e "s,https://andersbakken\.github\.io/rtags-releases/rtags-[0-9]\+\.[0-9]\+\.tar\.,https://andersbakken.github.io/rtags-releases/rtags-$MAJOR.$MINOR.tar.,g" "$DIR/../README.org"
echo "Generating manpages"
if [ ! -d build ]; then
mkdir build
fi
cd build
cmake ..
make man -j$JOBS
cd ..
git commit -m "Bump version to ${MAJOR}.${MINOR}" $DIR/../README.org $DIR/../CMakeLists.txt $DIR/../src/rtags.el
git commit -m "Bump version to ${MAJOR}.${MINOR}" \
CMakeLists.txt \
src/rtags.el \
man
git tag "v${MAJOR}.${MINOR}"
git push --tags
View
@@ -26,13 +26,13 @@ if [ $# -lt 1 ]; then
exit 1
fi
SED=sed
if [ $(uname) == "Darwin" ]; then
SED=`which gsed`
SED=$(which sed)
if [ "$(uname)" == "Darwin" ]; then
SED=$(which gsed)
fi
if [ ! -x "$SED" ]; then
echo "You need sed installed (and on Mac it needs to be gsed) to run this script"
echo "You need sed installed (and on Mac it needs to be gsed) to run ${BASH_SOURCE[0]}"
exit 1
fi
Oops, something went wrong.

0 comments on commit e4072bc

Please sign in to comment.