Coder Social home page Coder Social logo

mxklb / cuteproject Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 4.0 17.78 MB

C++ qmake/qt5 subdirs example/template project - using libs, apps, automated tests & deployments

License: MIT License

QMake 33.58% C++ 14.64% Makefile 1.28% Shell 50.51%
qmake subdir qt cross-platform ci catch test-coverage test-driven-development deployment cplusplus coverage devops

cuteproject's Introduction

Cute Project

C++/Qt5 cross platform qmake subdirs example for desktop apps.

Implemented as one app/executable linked to multiple libs (modules).

Build Status codecov build status coverage report Build status GitHub license

This is a C++/Qt5 example with automated unit test execution (catch). Tests are implemented in executables (subdirs) which are executed during compilation automatically, compilation fails a test fails. This is the ideal precondition for test driven development. When using gcc, local lcov test coverage report generation is supported. Semantic versioning combined with continuous artifact deployment is build on top while using free continuous integration services (travis, gitlab & appvoyer) for open source development.

This project contains examples for:

  • automated test execution with qmake (local)
  • test coverage report creation with lcov (local)
  • semantic versioning using git tags (local & CI)
  • cross platform packaging (deb, AppImage, dmg & exe)
  • cross platform CI builds (linux, macOS & windows)
  • continuous artifacts & release deployment (CI/CD)

Download latest development version here:

Note: This program does nothing famous. It just pops up a C++/Qt5 desktop UI which shall work cross platform. It's meant to be an example for a DevOps-driven desktop UI development. That's its only use case.

Build Dependencies

To successfully build on debian based OS:

sudo apt-get install qt5-default qt5-qmake gdb

To successfully build on macOS:

brew update
brew install qt5
export PATH=$(brew --prefix)/opt/qt5/bin:$PATH

To successfully build on windows (install Qt & MSVC):

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
set PATH=%PATH%;C:\Qt\5.9\msvc2015\bin;C:\Qt\Tools\QtCreator\bin;

Note: Shall also work with other Qt or MSVC versions ..

Build Instructions

qmake
make

Note: On windows use jom instead of make

Versioning

The cuteproject app uses semantic versioning.

Git tags on the master branch are used to mark specific versions. Git tags must have the form 1.2.3 (not prefixed with v) and github automatically creates releases. To automate artifacts versioning pkgs/version.sh utilizes git describe --long to create semantic version numbers. To set the apps executable version information properly, the version information from git is additionally generated by qmake within app/gitversion.pri (refer to everythingfrontend).

Before tagging a new version the debian pkgs/deb/app/changelog has to be updated manually!

Note: Libraries & tests are not versioned separately!

Packaging

This project contains scripts for automated packaging. All scripts are tested under linux besides the macOS.sh script - it's implemented for Mac OS X only. All of these scripts can be called locally to produce the following build artifacts:

  • pkgs/debian.sh creates a debian package
  • pkgs/appimage.sh creates an .AppImage
  • pkgs/macOS.sh creates a .dmg image

Windows packaging is actually only implemented within .appvoyer.yml!

Note: Refer to the CI configurations to check detailed packaging information & dependencies.

CI/CD Configuration

Development and testing is mainly focused on linux. Windows and Mac OS X are additionally used to verify builds and to make deployments. There are three different CI platforms configured for this purpose (gitlab, travis & appvoyer). The project always builds on linux, windows and Mac OS X. Artifacts for these systems are continuously deployed.

The following build systems are triggered continuously:

Gitlab (git push triggered + weekly) :: Artifact = [.deb & .AppImage]

  • Ubuntu:devel (build & test)
  • Ubuntu:rolling (build & test)
  • Ubuntu:latest (build, test & deploy, ++lcov)
  • Ubuntu:trusty (build, test & deploy)
  • Ubuntu:xenial (build, test & deploy)

Travis (git push triggered) :: Artifact = Apple Disk Image [.dmg]

  • Ubuntu:trusty (gcc -> build & test, ++codecov)
  • Ubuntu:trusty (clang -> build & test, ++codecov)
  • Mac OS X (gcc -> build, test & deploy)
  • Mac OS X (clang -> build, test & deploy)

AppVoyer (git push triggered) :: Artifact = Windows Executable [.exe]

  • Windows x64 (Visual Studio -> build & deploy)
  • Windows x64 (MinGW -> failing!)

Note: Refer to the configuration files for more detailed information.

Development

Development takes place on github while the repository is mirrored to gitlab for deployments ..

Pull requests are welcome - for contribution checkout issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.