This repository has been archived by the owner on Sep 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
502 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,72 +2,75 @@ dist: bionic | |
language: cpp | ||
compiler: gcc | ||
sudo: required | ||
compiler: | ||
- gcc | ||
os: | ||
- linux | ||
addons: | ||
apt: | ||
packages: | ||
|
||
matrix: | ||
include: | ||
# works on Precise and Trusty | ||
- os: linux | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-7 | ||
- graphviz | ||
- doxygen | ||
- libgtest-dev | ||
- sqlite3 libsqlite3-dev | ||
- libboost-test-dev | ||
- qt5-default | ||
# cache: | ||
# directories: | ||
# - $HOME/boost_1_67_0/boost | ||
# - $HOME/boost_1_67_0/stage/lib | ||
env: | ||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" | ||
- BUILD_DIR=build | ||
- PROJECT_NAME=AppChat | ||
|
||
before_install: | ||
- eval "${MATRIX_EVAL}" | ||
|
||
before_script: | ||
- if [ $TRAVIS_OS_NAME == linux ]; then sudo ./scripts/install_env.sh; fi | ||
#gtest | ||
- sudo apt-get install libgtest-dev -y | ||
- sudo chmod 777 /usr/src/gtest | ||
- cd /usr/src/gtest | ||
- cmake . | ||
- make | ||
- sudo cp *.a /usr/lib/ | ||
- cd "${TRAVIS_BUILD_DIR}" | ||
# end gtest | ||
|
||
script: | ||
- mkdir ${TRAVIS_BUILD_DIR}/build | ||
- cd ${TRAVIS_BUILD_DIR}/build | ||
- mkdir ${BUILD_DIR} | ||
- cd ${BUILD_DIR} | ||
- cmake .. | ||
- cmake --build . | ||
- cmake --build . --target test | ||
- cd ${TRAVIS_BUILD_DIR}/build/bin | ||
- tar -cf AppChat-0.7.$TRAVIS_BUILD_NUMBER-Linux.tar server client | ||
#- cmake --build . --target package | ||
- cmake --build . --target package | ||
|
||
after_success: | ||
# Generate the docs only if master, and the TRAVIS_BUILD_DOCS is not zero | ||
- >- | ||
- cd ${TRAVIS_BUILD_DIR}/${BUILD_DIR}/bin | ||
- tar -cf AppChat-0.7.$TRAVIS_BUILD_NUMBER-Linux.tar server client | ||
- >- | ||
if [[ "$TRAVIS_BRANCH" = "master" && -n "$TRAVIS_BUILD_DOCS" ]] ; then | ||
cd $TRAVIS_BUILD_DIR | ||
echo 'Generating Doxygen code documentation...' | ||
# Redirect both stderr and stdout to the log file AND the console. | ||
doxygen doc/Doxyfile 2>&1 | tee doxygen.log | ||
fi | ||
deploy: | ||
- provider: script | ||
skip_cleanup: true | ||
script: | ||
- curl -T ${TRAVIS_BUILD_DIR}/build/bin/AppChat-0.7.$TRAVIS_BUILD_NUMBER-Linux.tar -uk-morozov:$BINTRAY_API_KEY https://api.bintray.com/content/k-morozov/AppChat/Download/0.7.$TRAVIS_BUILD_NUMBER/AppChat-0.7.$TRAVIS_BUILD_NUMBER-Linux.tar | ||
on: | ||
branch: master | ||
if [[ "$TRAVIS_BRANCH" = "master" ]] ; then | ||
curl -T ${TRAVIS_BUILD_DIR}/build/bin/AppChat-0.7.$TRAVIS_BUILD_NUMBER-Linux.tar -uk-morozov:$BINTRAY_API_KEY https://api.bintray.com/content/k-morozov/AppChat/Download/0.7.$TRAVIS_BUILD_NUMBER/AppChat-0.7.$TRAVIS_BUILD_NUMBER-Linux.tar | ||
curl -T ${TRAVIS_BUILD_DIR}/${BUILD_DIR}/${PROJECT_NAME}-0.0.$TRAVIS_BUILD_NUMBER-Linux.deb -uk-morozov:$BINTRAY_API_KEY "https://api.bintray.com/content/k-morozov/AppChat/Install-Linux/0.7.$TRAVIS_BUILD_NUMBER/${PROJECT_NAME}-0.0.$TRAVIS_BUILD_NUMBER-Linux.deb;deb_distribution=bionic;deb_component=main;deb_architecture=amd64;publish=1" | ||
fi | ||
- provider: pages | ||
skip-cleanup: true | ||
github-token: $GITHUB_API_KEY | ||
keep-history: true | ||
local-dir: docs/html | ||
on: | ||
branch: master | ||
deploy: | ||
# - provider: pages | ||
# skip-cleanup: true | ||
# github-token: $GITHUB_API_KEY | ||
# keep-history: true | ||
# local-dir: docs/html | ||
# on: | ||
# branch: master | ||
|
||
before_deploy: | ||
- git config --local user.name "k-morozov" | ||
- git config --local user.email "[email protected]" | ||
#- export TRAVIS_TAG=${TRAVIS_TAG:-$(date +'%d%m')-$TRAVIS_BUILD_NUMBER-Linux} | ||
- git tag 0.7.$TRAVIS_BUILD_NUMBER-Linux | ||
deploy: | ||
- provider: releases | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,57 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(AppChat) | ||
|
||
if (DEFINED ENV{TRAVIS_BUILD_NUMBER}) | ||
project(AppChat VERSION 0.0.$ENV{TRAVIS_BUILD_NUMBER}) | ||
else () | ||
project(AppChat VERSION 0.0.1) | ||
endif () | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set (Boost_USE_STATIC_LIBS ON) | ||
set (Boost_USE_MULTITHREADED ON) | ||
|
||
#**************************************************************************************************** | ||
set(SRC src) | ||
set(LIB lib) | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
set(Boost_USE_STATIC_LIBS ON) | ||
set(Boost_USE_MULTITHREADED ON) | ||
set(Boost_USE_STATIC_RUNTIME OFF) | ||
|
||
set(PROTOCOL_LIB_NAME protocol_lib) | ||
set(LOGGER_LIB_NAME logger_lib) | ||
set(STORAGE_LIB_NAME sqlite_db) | ||
set(BACKTRACE_LIB_NAME backtrace) | ||
set(TRACEDEXCEPTION_LIB_NAME tracedexception_lib) | ||
set(PROTOCOL_LIB_NAME protocol_lib) | ||
set(LOGGER_LIB_NAME logger_lib) | ||
set(STORAGE_LIB_NAME sqlite_db) | ||
|
||
#**************************************************************************************************** | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
#**************************************************************************************************** | ||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/lib) | ||
|
||
find_package(Threads REQUIRED) | ||
find_package(Boost REQUIRED COMPONENTS system date_time unit_test_framework REQUIRED) | ||
|
||
include_directories( | ||
${Boost_INCLUDE_DIR} | ||
${CMAKE_SOURCE_DIR}/lib/protocol | ||
${CMAKE_SOURCE_DIR}/lib/log | ||
${CMAKE_SOURCE_DIR}/lib/storage | ||
${CMAKE_SOURCE_DIR}/src/server | ||
${CMAKE_SOURCE_DIR}/src/client | ||
) | ||
|
||
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/protocol) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/log) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/storage) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/src/server) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/src/client) | ||
|
||
enable_testing() | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/src/tests) | ||
|
||
set(CPACK_GENERATOR DEB) | ||
|
||
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") | ||
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") | ||
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") | ||
|
||
add_subdirectory(${SRC}/server) | ||
add_subdirectory(${SRC}/client) | ||
add_subdirectory(${LIB}/protocol) | ||
add_subdirectory(${LIB}/log) | ||
add_subdirectory(${LIB}/storage) | ||
add_subdirectory(${LIB}/libbacktrace) | ||
add_subdirectory(${LIB}/traced_exception) | ||
add_subdirectory(${SRC}/tests) | ||
set(CPACK_PACKAGE_CONTACT [email protected]) | ||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
|
||
include(CPack) | ||
|
||
#**************************************************************************************************** | ||
find_package(Doxygen) | ||
if (DOXYGEN_FOUND) | ||
set(DOXYFILE ${CMAKE_SOURCE_DIR}/Doxyfile) | ||
|
@@ -40,4 +61,3 @@ if (DOXYGEN_FOUND) | |
COMMENT "Generating API documentation with Doxygen") | ||
unset(DOXYFILE) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(Logger) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
# use if you have log4cplus | ||
# find_library(LOGGER_CPLUS log4cplus) | ||
|
||
add_subdirectory(log4cplus/) | ||
set(LOGGER_SRC | ||
logger.h | ||
logger.cpp | ||
) | ||
|
||
# set(LOGGER_LIB_NAME logger_lib) | ||
#**************************************************************************************************** | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") | ||
add_library(${LOGGER_LIB_NAME} SHARED STATIC | ||
${LOGGER_SRC}) | ||
|
||
add_library(${LOGGER_LIB_NAME} ${LOGGER_SRC}) | ||
target_include_directories(${LOGGER_LIB_NAME} PUBLIC .) | ||
set_target_properties(${LOGGER_LIB_NAME} PROPERTIES | ||
CMAKE_CXX_STANDARD 17 | ||
CMAKE_CXX_STANDARD_REQUIRED ON | ||
) | ||
|
||
add_subdirectory(log4cplus/) | ||
target_link_libraries(${LOGGER_LIB_NAME} log4cplus) | ||
|
||
# use if you have log4cplus | ||
# target_link_libraries(${LOGGER_LIB_NAME} ${LOGGER_CPLUS}) | ||
install(TARGETS ${LOGGER_LIB_NAME} DESTINATION /usr/local/bin) | ||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/logger.h DESTINATION /usr/local/include/appchat/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(Storage) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(Boost_USE_STATIC_LIBS ON) | ||
set(Boost_USE_MULTITHREADED ON) | ||
|
||
set(Storage_dir storage) | ||
|
||
#**************************************************************************************************** | ||
set(STORAGE_SRC | ||
database.h | ||
database.cpp | ||
) | ||
|
||
#**************************************************************************************************** | ||
add_library(${STORAGE_LIB_NAME} SHARED STATIC | ||
${STORAGE_SRC}) | ||
|
||
add_library(${STORAGE_LIB_NAME} ${STORAGE_SRC}) | ||
target_include_directories(${STORAGE_LIB_NAME} PUBLIC .) | ||
set_target_properties(${STORAGE_LIB_NAME} PROPERTIES | ||
CMAKE_CXX_STANDARD 17 | ||
CMAKE_CXX_STANDARD_REQUIRED ON | ||
) | ||
|
||
#**************************************************************************************************** | ||
find_library(SQLITE3_LIBRARY NAMES sqlite3) | ||
find_package(Boost REQUIRED) | ||
target_link_libraries (${STORAGE_LIB_NAME} ${PROTOCOL_LIB_NAME} ${LOGGER_LIB_NAME} ${SQLITE3_LIBRARY} ${Boost_LIBRARIES}) | ||
|
||
install(TARGETS ${STORAGE_LIB_NAME} DESTINATION /usr/local/bin) | ||
install(TARGETS ${STORAGE_LIB_NAME} DESTINATION lib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.