From f0720ba756234a7286955925bed5a7d687c09759 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sat, 27 Jul 2019 18:53:03 +0200 Subject: [PATCH 01/19] initial implementation of conan recipe --- conanfile.py | 43 +++++++++++++++++++++++++++++++++++ test_package/CMakeLists.txt | 11 +++++++++ test_package/conanfile.py | 19 ++++++++++++++++ test_package/test_package.cpp | 27 ++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 conanfile.py create mode 100644 test_package/CMakeLists.txt create mode 100644 test_package/conanfile.py create mode 100644 test_package/test_package.cpp diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..29a52b6 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from conans import ConanFile, tools, CMake +import os + + +class NameofConan(ConanFile): + name = 'nameof' + version = '0.9.0' + description = 'Header-only C++17 library provides nameof macros and functions to obtain simple name of variable, type, function, macro, and enum.' + topics = ( + 'conan', + 'nameof', + 'introspection', + 'compile-time' + ) + url = 'https://github.com/Neargye/nameof' + author = 'Daniil Goncharov ' + license = 'MIT' + generators = 'cmake_find_package' + exports_sources = ['example/*','include/*','test/*','CMakeLists.txt','LICENSE'] + exports = ['LICENSE.md'] + _build_subfolder = 'build_subfolder' + build_requires = 'Catch2/2.9.1@catchorg/stable' + + def configure_cmake(self, build_tests_and_examples): + cmake = CMake(self) + if self.develop: + self.output.info("Develop mode on, building with tests and examples") + cmake.definitions['NAMEOF_OPT_BUILD_TESTS'] = build_tests_and_examples + cmake.definitions['NAMEOF_OPT_BUILD_EXAMPLES'] = build_tests_and_examples + cmake.configure(build_folder=self._build_subfolder) + return cmake + + def build(self): + cmake = self.configure_cmake(build_tests_and_examples = True) + cmake.build() + cmake.test() + + def package(self): + cmake = self.configure_cmake(build_tests_and_examples = False) + cmake.install() diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt new file mode 100644 index 0000000..a3911f2 --- /dev/null +++ b/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package CXX) + +set(CMAKE_VERBOSE_MAKEFILE TRUE) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package ${CONAN_LIBS}) +set_target_properties(test_package PROPERTIES CXX_STANDARD 17) diff --git a/test_package/conanfile.py b/test_package/conanfile.py new file mode 100644 index 0000000..4736904 --- /dev/null +++ b/test_package/conanfile.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/test_package/test_package.cpp b/test_package/test_package.cpp new file mode 100644 index 0000000..0dfd7af --- /dev/null +++ b/test_package/test_package.cpp @@ -0,0 +1,27 @@ +#include + +#include +#include +#include + +struct SomeStruct {}; +enum class Color { RED = -12, GREEN = 7, BLUE = 15 }; + +SomeStruct structvar; +int main() { + // Compile-time. + constexpr auto name = NAMEOF(structvar); + static_assert("structvar" == name); + + // Nameof. + using std::literals::string_view_literals::operator""sv; + + std::string_view res1 = NAMEOF(structvar); + std::string_view res2 = NAMEOF(::structvar); + + std::cout << res1 << '\n' << res2 << '\n'; + + bool success = res1 == "structvar"sv + && res2 == "structvar"sv; + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} From 5a1e58bbdfd2e6188962a65c61106ee86741ebbb Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sat, 27 Jul 2019 18:58:55 +0200 Subject: [PATCH 02/19] rework CI scripts, integrate conan auto upload --- .travis.yml | 219 +++++++++++++++------------------------------ .travis/install.sh | 25 ++++++ .travis/run.sh | 13 +++ appveyor.yml | 29 ++++++ build.py | 9 ++ 5 files changed, 149 insertions(+), 146 deletions(-) create mode 100644 .travis/install.sh create mode 100644 .travis/run.sh create mode 100644 appveyor.yml create mode 100644 build.py diff --git a/.travis.yml b/.travis.yml index f47f7f8..6cd96be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,162 +1,89 @@ -os: linux # Use linux unless specified otherwise. -dist: xenial -sudo: required +env: + global: + - CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/development" + - CONAN_BUILD_POLICY: "missing" + - CONAN_USERNAME: "steakhal" + - CONAN_DOCKER_32_IMAGES: 1 + - CONAN_CHANNEL: "testing" + #- CONAN_UPLOAD_DEPENDENCIES="all" + - CONAN_STABLE_BRANCH_PATTERN: "release/*" + - CONAN_UPLOAD_ONLY_WHEN_STABLE: 1 -language: cpp +linux: &linux + os: linux + dist: xenial + sudo: required + language: python + python: "3.6" + services: + - docker -git: - depth: 1 +osx: &osx + os: osx + language: generic matrix: - include: - - os: linux - compiler: g++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - env: - - CXX_COMPILER=g++-7 CC_COMPILER=gcc-7 + include: + - <<: *linux + env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49 - - os: linux - compiler: g++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-8 - env: - - CXX_COMPILER=g++-8 CC_COMPILER=gcc-8 + - <<: *linux + env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5 - - os: linux - compiler: g++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-9 - env: - - CXX_COMPILER=g++-9 CC_COMPILER=gcc-9 + - <<: *linux + env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6 - - os: linux - compiler: clang++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-5.0 - packages: - - clang-5.0 - env: - - CXX_COMPILER=clang++-5.0 CC_COMPILER=clang-5.0 + - <<: *linux + env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=conanio/gcc7 - - os: linux - compiler: clang++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-6.0 - packages: - - clang-6.0 - env: - - CXX_COMPILER=clang++-6.0 CC_COMPILER=clang-6.0 + - <<: *linux + env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/gcc8 - - os: linux - compiler: clang++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-7 - packages: - - clang-7 - env: - - CXX_COMPILER=clang++-7 CC_COMPILER=clang-7 + - <<: *linux + env: CONAN_GCC_VERSIONS=9 CONAN_DOCKER_IMAGE=conanio/gcc9 - - os: linux - compiler: clang++ - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-xenial-8 - packages: - - clang-8 - env: - - CXX_COMPILER=clang++-8 CC_COMPILER=clang-8 + - <<: *linux + env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39 - - os: osx - compiler: clang++ - osx_image: xcode9.4 - env: - - CXX_COMPILER=clang++ CC_COMPILER=clang + - <<: *linux + env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40 - - os: osx - compiler: clang++ - osx_image: xcode10.2 - env: - - CXX_COMPILER=clang++ CC_COMPILER=clang + - <<: *linux + env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=conanio/clang50 + + - <<: *linux + env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=conanio/clang60 + + - <<: *linux + env: CONAN_CLANG_VERSIONS=7.0 CONAN_DOCKER_IMAGE=conanio/clang7 + + - <<: *linux + env: CONAN_CLANG_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/clang8 + + - <<: *osx + osx_image: xcode7.3 + env: CONAN_APPLE_CLANG_VERSIONS=7.3 + + - <<: *osx + osx_image: xcode8.3 + env: CONAN_APPLE_CLANG_VERSIONS=8.1 + + - <<: *osx + osx_image: xcode9.2 + env: CONAN_APPLE_CLANG_VERSIONS=9.0 + + - <<: *osx + osx_image: xcode9.4 + env: CONAN_APPLE_CLANG_VERSIONS=9.1 + + - <<: *osx + osx_image: xcode10.1 + env: CONAN_APPLE_CLANG_VERSIONS=10.0 install: - - export CC=${CC_COMPILER} - - export CXX=${CXX_COMPILER} - - JOBS=2 # Travis machines have 2 cores. - - | - # getting Catch2 library - git clone https://github.com/catchorg/Catch2.git - cd Catch2 - git checkout v2.9.1 - mkdir build - cd build - pwd - cmake -DCATCH_BUILD_TESTING=OFF -DCATCH_INSTALL_DOCS=OFF -DCATCH_INSTALL_HELPERS=OFF -DCMAKE_INSTALL_PREFIX=../installed .. - cmake --build . --target install --config Release - cd ../.. - - # If linux and clang install the right version of libc++. - if [[ "${TRAVIS_OS_NAME}" == "linux" && "${CXX%%+*}" == "clang" && -n "$(ls -A ${LLVM_INSTALL})" ]]; then - LLVM_INSTALL=${DEPS_DIR}/llvm/install - if [[ "${CXX}" == "clang++-3.5" ]]; then LLVM_VERSION="3.5.2"; - elif [[ "${CXX}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2"; - elif [[ "${CXX}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.1"; - elif [[ "${CXX}" == "clang++-3.8" ]]; then LLVM_VERSION="3.8.1"; - elif [[ "${CXX}" == "clang++-3.9" ]]; then LLVM_VERSION="3.9.1"; - elif [[ "${CXX}" == "clang++-4.0" ]]; then LLVM_VERSION="4.0.1"; - elif [[ "${CXX}" == "clang++-5.0" ]]; then LLVM_VERSION="5.0.2"; - elif [[ "${CXX}" == "clang++-6.0" ]]; then LLVM_VERSION="6.0.1"; - elif [[ "${CXX}" == "clang++-7" ]]; then LLVM_VERSION="7.0.1"; - elif [[ "${CXX}" == "clang++-8" ]]; then LLVM_VERSION="8.0.0"; - fi - LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz" - LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz" - LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz" - mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi - travis_retry wget -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm - travis_retry wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx - travis_retry wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi - (cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL}) - (cd llvm/build/projects/libcxx && sudo make install -j${JOBS}) - (cd llvm/build/projects/libcxxabi && sudo make install -j${JOBS}) - export CXXFLAGS="-isystem ${LLVM_INSTALL}/include/c++/v1" - export LDFLAGS="-L ${LLVM_INSTALL}/lib -l c++ -l c++abi" - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_INSTALL}/lib" - fi - -before_script: - - rm -rf build - - mkdir -p build - - cd build - - pwd - - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=../Catch2/installed .. + - chmod +x .travis/install.sh + - ./.travis/install.sh script: - - cmake --build . -- -j${JOBS} - - ctest --output-on-failure -j${JOBS} - -notifications: - email: false + - chmod +x .travis/run.sh + - ./.travis/run.sh diff --git a/.travis/install.sh b/.travis/install.sh new file mode 100644 index 0000000..9da0265 --- /dev/null +++ b/.travis/install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e +set -x + +if [[ "$(uname -s)" == 'Darwin' ]]; then + brew update || brew update + brew outdated pyenv || brew upgrade pyenv + brew install pyenv-virtualenv + brew install cmake || true + + if which pyenv > /dev/null; then + eval "$(pyenv init -)" + fi + + pyenv install 2.7.10 + pyenv virtualenv 2.7.10 conan + pyenv rehash + pyenv activate conan +fi + +pip install conan --upgrade +pip install conan_package_tools + +conan user diff --git a/.travis/run.sh b/.travis/run.sh new file mode 100644 index 0000000..0a3488e --- /dev/null +++ b/.travis/run.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e +set -x + +if [[ "$(uname -s)" == 'Darwin' ]]; then + if which pyenv > /dev/null; then + eval "$(pyenv init -)" + fi + pyenv activate conan +fi + +python build.py diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..f1c3dfd --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,29 @@ +build: false + +environment: + PYTHON: "C:\\Python37" + + matrix: + - MINGW_CONFIGURATIONS: '4.9@x86_64@seh@posix, 5@x86_64@seh@posix, 6@x86_64@seh@posix, 7@x86_64@seh@posix' + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Release + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Debug + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Release + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Debug + + +install: + - set PATH=%PATH%;%PYTHON%/Scripts/ + - pip.exe install conan --upgrade + - pip.exe install conan_package_tools + - conan user # It creates the conan data directory + +test_script: + - python build.py diff --git a/build.py b/build.py new file mode 100644 index 0000000..b27cf1e --- /dev/null +++ b/build.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from cpt.packager import ConanMultiPackager + +if __name__ == "__main__": + builder = ConanMultiPackager() + builder.add_common_builds() + builder.run() From 3ae26b54302a4700083576b02c091d70449ffe2f Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 12:15:50 +0200 Subject: [PATCH 03/19] refine conan requirements and packaging --- conanfile.py | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/conanfile.py b/conanfile.py index 29a52b6..17aab81 100644 --- a/conanfile.py +++ b/conanfile.py @@ -22,22 +22,39 @@ class NameofConan(ConanFile): exports_sources = ['example/*','include/*','test/*','CMakeLists.txt','LICENSE'] exports = ['LICENSE.md'] _build_subfolder = 'build_subfolder' - build_requires = 'Catch2/2.9.1@catchorg/stable' + settings = ('os', 'compiler', 'build_type', 'arch') + options = { + 'build_tests': [True, False], + 'build_examples': [True, False], + } + default_options = { + 'build_tests': False, + 'build_examples': False, + } - def configure_cmake(self, build_tests_and_examples): + def requirements(self): + if self.options.build_tests: + self.requires('Catch2/2.9.1@catchorg/stable') + + def config_options(self): + needs_build = self.options.build_tests or self.options.build_examples + if not needs_build: + # remove all build settings since it is a header-only library + self.options.remove(['os', 'compiler', 'build_type', 'arch']) + + def configure_cmake(self): cmake = CMake(self) - if self.develop: - self.output.info("Develop mode on, building with tests and examples") - cmake.definitions['NAMEOF_OPT_BUILD_TESTS'] = build_tests_and_examples - cmake.definitions['NAMEOF_OPT_BUILD_EXAMPLES'] = build_tests_and_examples + cmake.definitions['NAMEOF_OPT_BUILD_TESTS'] = self.options.build_tests + cmake.definitions['NAMEOF_OPT_BUILD_EXAMPLES'] = self.options.build_examples cmake.configure(build_folder=self._build_subfolder) return cmake def build(self): - cmake = self.configure_cmake(build_tests_and_examples = True) + cmake = self.configure_cmake() cmake.build() - cmake.test() + if self.options.build_tests: + cmake.test() def package(self): - cmake = self.configure_cmake(build_tests_and_examples = False) + cmake = self.configure_cmake() cmake.install() From 1aea83279cbe40b17b01679edc90e10fde791fbc Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 12:18:16 +0200 Subject: [PATCH 04/19] update appveyor script --- .appveyor.yml | 65 ++++++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 42 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 0d5b46c..f1c3dfd 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,48 +1,29 @@ -version: "{branch} #{build}" - -shallow_clone: true - -image: - - Visual Studio 2017 - -platform: - - Win32 - - x64 - -configuration: - - Debug - - Release - -build: - parallel: true +build: false environment: - matrix: - - GENERATOR: "Visual Studio 15 2017" + PYTHON: "C:\\Python37" + + matrix: + - MINGW_CONFIGURATIONS: '4.9@x86_64@seh@posix, 5@x86_64@seh@posix, 6@x86_64@seh@posix, 7@x86_64@seh@posix' + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Release + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Debug + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Release + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Debug + install: - # getting Catch2 library - # redirect stderr to fix appveyor handling stderr - - ps: $env:GIT_REDIRECT_STDERR = '2>&1' - - ps: git clone https://github.com/catchorg/Catch2.git - - ps: cd Catch2 - - ps: git checkout v2.9.1 - - ps: mkdir build - - ps: cd build - - ps: pwd - - ps: cmake -DCATCH_BUILD_TESTING=OFF -DCATCH_INSTALL_DOCS=OFF -DCATCH_INSTALL_HELPERS=OFF -DCMAKE_INSTALL_PREFIX="$PWD/../installed" .. - - ps: cmake --build . --target install --config Release - - ps: cd ../.. - -before_build: - - if exist build RMDIR /S /Q build - - if not exist build mkdir build - - cd build - - pwd - - cmake -G "%GENERATOR%" -A %PLATFORM% -DCMAKE_INSTALL_PREFIX="C:/projects/nameof/Catch2/installed" .. - -build_script: - - cmake --build . --config %CONFIGURATION% + - set PATH=%PATH%;%PYTHON%/Scripts/ + - pip.exe install conan --upgrade + - pip.exe install conan_package_tools + - conan user # It creates the conan data directory test_script: - - ctest --output-on-failure -C %CONFIGURATION% + - python build.py From 9c5ae69b36cf5b8be37969911126ee0c829f4d96 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 12:29:34 +0200 Subject: [PATCH 05/19] update ci scripts --- .appveyor.yml | 2 +- {.travis => .ci}/install.sh | 13 ++++++------- {.travis => .ci}/run.sh | 5 ++--- .travis.yml | 24 ++++++++++++------------ build.py | 7 ++++--- 5 files changed, 25 insertions(+), 26 deletions(-) rename {.travis => .ci}/install.sh (61%) rename {.travis => .ci}/run.sh (85%) diff --git a/.appveyor.yml b/.appveyor.yml index f1c3dfd..85b4596 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -22,7 +22,7 @@ environment: install: - set PATH=%PATH%;%PYTHON%/Scripts/ - pip.exe install conan --upgrade - - pip.exe install conan_package_tools + - pip.exe install conan_package_tools bincrafters_package_tools - conan user # It creates the conan data directory test_script: diff --git a/.travis/install.sh b/.ci/install.sh similarity index 61% rename from .travis/install.sh rename to .ci/install.sh index 9da0265..762b4b5 100644 --- a/.travis/install.sh +++ b/.ci/install.sh @@ -1,25 +1,24 @@ -#!/bin/bash +#!/usr/bin/env bash -set -e -set -x +set -ex if [[ "$(uname -s)" == 'Darwin' ]]; then brew update || brew update brew outdated pyenv || brew upgrade pyenv brew install pyenv-virtualenv - brew install cmake || true + brew install cmake || brew upgrade cmake || true if which pyenv > /dev/null; then eval "$(pyenv init -)" fi - pyenv install 2.7.10 - pyenv virtualenv 2.7.10 conan + pyenv install 3.7.1 + pyenv virtualenv 3.7.1 conan pyenv rehash pyenv activate conan fi pip install conan --upgrade -pip install conan_package_tools +pip install conan_package_tools bincrafters_package_tools conan user diff --git a/.travis/run.sh b/.ci/run.sh similarity index 85% rename from .travis/run.sh rename to .ci/run.sh index 0a3488e..3e39a35 100644 --- a/.travis/run.sh +++ b/.ci/run.sh @@ -1,7 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash -set -e -set -x +set -ex if [[ "$(uname -s)" == 'Darwin' ]]; then if which pyenv > /dev/null; then diff --git a/.travis.yml b/.travis.yml index 6cd96be..4941ec8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,14 +24,14 @@ osx: &osx matrix: include: - - <<: *linux - env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49 + # - <<: *linux + # env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49 - - <<: *linux - env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5 + # - <<: *linux + # env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5 - - <<: *linux - env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6 + # - <<: *linux + # env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6 - <<: *linux env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=conanio/gcc7 @@ -42,8 +42,8 @@ matrix: - <<: *linux env: CONAN_GCC_VERSIONS=9 CONAN_DOCKER_IMAGE=conanio/gcc9 - - <<: *linux - env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39 + # - <<: *linux + # env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39 - <<: *linux env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40 @@ -81,9 +81,9 @@ matrix: env: CONAN_APPLE_CLANG_VERSIONS=10.0 install: - - chmod +x .travis/install.sh - - ./.travis/install.sh + - chmod +x .ci/install.sh + - ./.ci/install.sh script: - - chmod +x .travis/run.sh - - ./.travis/run.sh + - chmod +x .ci/run.sh + - ./.ci/run.sh diff --git a/build.py b/build.py index b27cf1e..29ce67f 100644 --- a/build.py +++ b/build.py @@ -1,9 +1,10 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from cpt.packager import ConanMultiPackager +from bincrafters import build_template_header_only if __name__ == "__main__": - builder = ConanMultiPackager() - builder.add_common_builds() + builder = build_template_header_only.get_builder() + additional_options = { 'nameof:build_tests': True, 'nameof:build_examples': True } + builder.update_build_if(lambda build: True, new_options=additional_options) builder.run() From a362b570bba578f3e960ea2e34c68d70da12f375 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 12:56:51 +0200 Subject: [PATCH 06/19] fix appveyor again --- .appveyor.yml | 29 ----------------------------- appveyor.yml | 2 +- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 85b4596..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,29 +0,0 @@ -build: false - -environment: - PYTHON: "C:\\Python37" - - matrix: - - MINGW_CONFIGURATIONS: '4.9@x86_64@seh@posix, 5@x86_64@seh@posix, 6@x86_64@seh@posix, 7@x86_64@seh@posix' - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - CONAN_VISUAL_VERSIONS: 14 - CONAN_BUILD_TYPES: Release - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - CONAN_VISUAL_VERSIONS: 14 - CONAN_BUILD_TYPES: Debug - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - CONAN_VISUAL_VERSIONS: 15 - CONAN_BUILD_TYPES: Release - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - CONAN_VISUAL_VERSIONS: 15 - CONAN_BUILD_TYPES: Debug - - -install: - - set PATH=%PATH%;%PYTHON%/Scripts/ - - pip.exe install conan --upgrade - - pip.exe install conan_package_tools bincrafters_package_tools - - conan user # It creates the conan data directory - -test_script: - - python build.py diff --git a/appveyor.yml b/appveyor.yml index f1c3dfd..85b4596 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,7 +22,7 @@ environment: install: - set PATH=%PATH%;%PYTHON%/Scripts/ - pip.exe install conan --upgrade - - pip.exe install conan_package_tools + - pip.exe install conan_package_tools bincrafters_package_tools - conan user # It creates the conan data directory test_script: From 7276880fdfb3b800efc3defe434771d94fbb4ecb Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 14:43:07 +0200 Subject: [PATCH 07/19] fix non stdc++17 buildbots --- .travis.yml | 23 ----------------------- appveyor.yml | 18 +++++++++--------- conanfile.py | 34 +++++++++++++++++++++++++++++----- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4941ec8..f0b6512 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,15 +24,6 @@ osx: &osx matrix: include: - # - <<: *linux - # env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49 - - # - <<: *linux - # env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5 - - # - <<: *linux - # env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6 - - <<: *linux env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=conanio/gcc7 @@ -42,12 +33,6 @@ matrix: - <<: *linux env: CONAN_GCC_VERSIONS=9 CONAN_DOCKER_IMAGE=conanio/gcc9 - # - <<: *linux - # env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39 - - - <<: *linux - env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40 - - <<: *linux env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=conanio/clang50 @@ -60,14 +45,6 @@ matrix: - <<: *linux env: CONAN_CLANG_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/clang8 - - <<: *osx - osx_image: xcode7.3 - env: CONAN_APPLE_CLANG_VERSIONS=7.3 - - - <<: *osx - osx_image: xcode8.3 - env: CONAN_APPLE_CLANG_VERSIONS=8.1 - - <<: *osx osx_image: xcode9.2 env: CONAN_APPLE_CLANG_VERSIONS=9.0 diff --git a/appveyor.yml b/appveyor.yml index 85b4596..1144398 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,18 +4,18 @@ environment: PYTHON: "C:\\Python37" matrix: - - MINGW_CONFIGURATIONS: '4.9@x86_64@seh@posix, 5@x86_64@seh@posix, 6@x86_64@seh@posix, 7@x86_64@seh@posix' - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - CONAN_VISUAL_VERSIONS: 14 + - MINGW_CONFIGURATIONS: '7@x86_64@seh@posix, 7@x86@seh@posix, 8@x86_64@seh@posix, 8@x86@seh@posix' + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 CONAN_BUILD_TYPES: Release - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - CONAN_VISUAL_VERSIONS: 14 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 CONAN_BUILD_TYPES: Debug - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - CONAN_VISUAL_VERSIONS: 15 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + CONAN_VISUAL_VERSIONS: 16 CONAN_BUILD_TYPES: Release - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - CONAN_VISUAL_VERSIONS: 15 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + CONAN_VISUAL_VERSIONS: 16 CONAN_BUILD_TYPES: Debug diff --git a/conanfile.py b/conanfile.py index 17aab81..b86f289 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,9 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from conans import ConanFile, tools, CMake -import os - +from conans import ConanFile, CMake +from conans.model.version import Version +from conans.errors import ConanException class NameofConan(ConanFile): name = 'nameof' @@ -32,15 +32,39 @@ class NameofConan(ConanFile): 'build_examples': False, } + @property + def supports_string_view(self): + compiler = str(self.settings.compiler) + version = Version(str(self.settings.compiler.version)) + if compiler == 'Visual Studio' and version >= Version('15'): + return True + if compiler == 'gcc' and version >= Version('7'): + return True + if compiler == 'icc' and version >= Version('19'): + return True + if compiler == 'clang' and version >= Version('5'): + return True + if compiler == 'apple-clang' and version >= Version('9'): + return True + return False + def requirements(self): if self.options.build_tests: self.requires('Catch2/2.9.1@catchorg/stable') + def configure(self): + if not self.supports_string_view: + raise ConanException('The specified compiler must support C++17') + def config_options(self): needs_build = self.options.build_tests or self.options.build_examples + + # remove all build settings since it is a header-only library if not needs_build: - # remove all build settings since it is a header-only library - self.options.remove(['os', 'compiler', 'build_type', 'arch']) + del self.options.os + del self.options.compiler + del self.options.build_type + del self.options.arch def configure_cmake(self): cmake = CMake(self) From 1400b612c16ede885d53b4bade53f226d0fe5935 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 15:37:11 +0200 Subject: [PATCH 08/19] fix cross building --- conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index b86f289..0fb7c2f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from conans import ConanFile, CMake +from conans import ConanFile, tools, CMake from conans.model.version import Version from conans.errors import ConanException @@ -76,7 +76,7 @@ class NameofConan(ConanFile): def build(self): cmake = self.configure_cmake() cmake.build() - if self.options.build_tests: + if self.options.build_tests and not tools.cross_building(self.settings): cmake.test() def package(self): From c6c6112161d726a7673feacf69e6b6e4782c6e84 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 15:37:33 +0200 Subject: [PATCH 09/19] try ConanMultiPacker --- appveyor.yml | 9 +++++++++ build.py | 15 +++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 1144398..20a78c4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,6 +3,15 @@ build: false environment: PYTHON: "C:\\Python37" + CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/development" + CONAN_BUILD_POLICY: "missing" + CONAN_USERNAME: "steakhal" + CONAN_DOCKER_32_IMAGES: 1 + CONAN_CHANNEL: "testing" + # CONAN_UPLOAD_DEPENDENCIES="all" + CONAN_STABLE_BRANCH_PATTERN: "release/*" + CONAN_UPLOAD_ONLY_WHEN_STABLE: 1 + matrix: - MINGW_CONFIGURATIONS: '7@x86_64@seh@posix, 7@x86@seh@posix, 8@x86_64@seh@posix, 8@x86@seh@posix' - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 diff --git a/build.py b/build.py index 29ce67f..accf73a 100644 --- a/build.py +++ b/build.py @@ -1,10 +1,17 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from bincrafters import build_template_header_only +from cpt.packager import ConanMultiPackager if __name__ == "__main__": - builder = build_template_header_only.get_builder() - additional_options = { 'nameof:build_tests': True, 'nameof:build_examples': True } - builder.update_build_if(lambda build: True, new_options=additional_options) + builder = ConanMultiPackager() + builder.add_common_builds() + updated_builds = [] + for settings, options, env_vars, build_requires, reference in builder.items: + options['prometheus-cpp:mode'] = 'pull' + updated_builds.append([settings, options, env_vars, build_requires]) + options = options.copy() + options['prometheus-cpp:mode'] = 'push' + updated_builds.append([settings, options, env_vars, build_requires]) + builder.builds = updated_builds builder.run() From 4073167fa42fe1f636412f9827687384f8543aa1 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 16:31:59 +0200 Subject: [PATCH 10/19] fix mingw configurations --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 20a78c4..41c8b8d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,7 +13,7 @@ environment: CONAN_UPLOAD_ONLY_WHEN_STABLE: 1 matrix: - - MINGW_CONFIGURATIONS: '7@x86_64@seh@posix, 7@x86@seh@posix, 8@x86_64@seh@posix, 8@x86@seh@posix' + - MINGW_CONFIGURATIONS: '7@x86_64@seh@posix, 7@x86@dwarf2@posix, 8@x86_64@seh@posix, 8@x86@dwarf2@posix' - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 CONAN_VISUAL_VERSIONS: 15 CONAN_BUILD_TYPES: Release From 707bb945fdfb7fe32bb7f9e3a10f714fcee105e6 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 22:04:16 +0200 Subject: [PATCH 11/19] building header only libs tests and examples --- build.py | 12 ++++-------- conanfile.py | 25 ++++++++++++------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/build.py b/build.py index accf73a..621c725 100644 --- a/build.py +++ b/build.py @@ -4,14 +4,10 @@ from cpt.packager import ConanMultiPackager if __name__ == "__main__": + options = { 'nameof:build_tests': True, 'nameof:build_examples': True } + always_true = lambda build: True + builder = ConanMultiPackager() builder.add_common_builds() - updated_builds = [] - for settings, options, env_vars, build_requires, reference in builder.items: - options['prometheus-cpp:mode'] = 'pull' - updated_builds.append([settings, options, env_vars, build_requires]) - options = options.copy() - options['prometheus-cpp:mode'] = 'push' - updated_builds.append([settings, options, env_vars, build_requires]) - builder.builds = updated_builds + builder.update_build_if(always_true, new_options = options) builder.run() diff --git a/conanfile.py b/conanfile.py index 0fb7c2f..5c52c19 100644 --- a/conanfile.py +++ b/conanfile.py @@ -3,7 +3,7 @@ from conans import ConanFile, tools, CMake from conans.model.version import Version -from conans.errors import ConanException +from conans.errors import ConanInvalidConfiguration class NameofConan(ConanFile): name = 'nameof' @@ -12,6 +12,11 @@ class NameofConan(ConanFile): topics = ( 'conan', 'nameof', + 'cplusplus', + 'enum-to-string', + 'serialization', + 'reflection', + 'header-only', 'introspection', 'compile-time' ) @@ -22,6 +27,7 @@ class NameofConan(ConanFile): exports_sources = ['example/*','include/*','test/*','CMakeLists.txt','LICENSE'] exports = ['LICENSE.md'] _build_subfolder = 'build_subfolder' + build_requires = [] settings = ('os', 'compiler', 'build_type', 'arch') options = { 'build_tests': [True, False], @@ -50,21 +56,11 @@ class NameofConan(ConanFile): def requirements(self): if self.options.build_tests: - self.requires('Catch2/2.9.1@catchorg/stable') + self.build_requires.append('Catch2/2.9.1@catchorg/stable') def configure(self): if not self.supports_string_view: - raise ConanException('The specified compiler must support C++17') - - def config_options(self): - needs_build = self.options.build_tests or self.options.build_examples - - # remove all build settings since it is a header-only library - if not needs_build: - del self.options.os - del self.options.compiler - del self.options.build_type - del self.options.arch + raise ConanInvalidConfiguration('The specified compiler must support C++17') def configure_cmake(self): cmake = CMake(self) @@ -82,3 +78,6 @@ class NameofConan(ConanFile): def package(self): cmake = self.configure_cmake() cmake.install() + + def package_id(self): + self.info.header_only() From 231ea223c87d0eed57ec802506486c34ad1890f9 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 22:29:21 +0200 Subject: [PATCH 12/19] enable deploy to travis on new tag --- .travis.yml | 5 +---- appveyor.yml | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index f0b6512..f12752a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,8 @@ env: - CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/development" - CONAN_BUILD_POLICY: "missing" - CONAN_USERNAME: "steakhal" - - CONAN_DOCKER_32_IMAGES: 1 - CONAN_CHANNEL: "testing" - #- CONAN_UPLOAD_DEPENDENCIES="all" - - CONAN_STABLE_BRANCH_PATTERN: "release/*" - - CONAN_UPLOAD_ONLY_WHEN_STABLE: 1 + - CONAN_UPLOAD_ONLY_WHEN_TAG: 1 linux: &linux os: linux diff --git a/appveyor.yml b/appveyor.yml index 41c8b8d..e772f9a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,14 +3,11 @@ build: false environment: PYTHON: "C:\\Python37" - CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/development" + CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/development" CONAN_BUILD_POLICY: "missing" CONAN_USERNAME: "steakhal" - CONAN_DOCKER_32_IMAGES: 1 CONAN_CHANNEL: "testing" - # CONAN_UPLOAD_DEPENDENCIES="all" - CONAN_STABLE_BRANCH_PATTERN: "release/*" - CONAN_UPLOAD_ONLY_WHEN_STABLE: 1 + CONAN_UPLOAD_ONLY_WHEN_TAG: 1 matrix: - MINGW_CONFIGURATIONS: '7@x86_64@seh@posix, 7@x86@dwarf2@posix, 8@x86_64@seh@posix, 8@x86@dwarf2@posix' From d32e9ce4f77519cd11cb6ffeb33daec57cdd05f5 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 28 Jul 2019 22:59:58 +0200 Subject: [PATCH 13/19] set maintained as the target repository for deploy --- .travis.yml | 4 ++-- appveyor.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f12752a..708e374 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ env: global: - - CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/development" + - CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/maintained" - CONAN_BUILD_POLICY: "missing" - CONAN_USERNAME: "steakhal" - - CONAN_CHANNEL: "testing" + - CONAN_CHANNEL: "stable" - CONAN_UPLOAD_ONLY_WHEN_TAG: 1 linux: &linux diff --git a/appveyor.yml b/appveyor.yml index e772f9a..5b6eb87 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,10 +3,10 @@ build: false environment: PYTHON: "C:\\Python37" - CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/development" + CONAN_UPLOAD: "https://api.bintray.com/conan/steakhal/maintained" CONAN_BUILD_POLICY: "missing" CONAN_USERNAME: "steakhal" - CONAN_CHANNEL: "testing" + CONAN_CHANNEL: "stable" CONAN_UPLOAD_ONLY_WHEN_TAG: 1 matrix: From e4c754cb4306f7bfbf07d06865f132bc127013d3 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Mon, 29 Jul 2019 19:36:53 +0200 Subject: [PATCH 14/19] move build.py to .ci folder and hide appveyor.yml --- appveyor.yml => .appveyor.yml | 2 +- build.py => .ci/build.py | 0 .ci/run.sh | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename appveyor.yml => .appveyor.yml (97%) rename build.py => .ci/build.py (100%) diff --git a/appveyor.yml b/.appveyor.yml similarity index 97% rename from appveyor.yml rename to .appveyor.yml index 5b6eb87..bbba35b 100644 --- a/appveyor.yml +++ b/.appveyor.yml @@ -32,4 +32,4 @@ install: - conan user # It creates the conan data directory test_script: - - python build.py + - python .ci/build.py diff --git a/build.py b/.ci/build.py similarity index 100% rename from build.py rename to .ci/build.py diff --git a/.ci/run.sh b/.ci/run.sh index 3e39a35..9261961 100644 --- a/.ci/run.sh +++ b/.ci/run.sh @@ -9,4 +9,4 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then pyenv activate conan fi -python build.py +python .ci/build.py From b5a158d0d28e75123913b62dd1b9961b6574cc54 Mon Sep 17 00:00:00 2001 From: terik23 Date: Tue, 30 Jul 2019 23:44:28 +0500 Subject: [PATCH 15/19] disable travis email notifications --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 708e374..ae57c0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,3 +61,6 @@ install: script: - chmod +x .ci/run.sh - ./.ci/run.sh + +notifications: + email: false From 4c5b75e56e577f426ba8423318c8050e58f4a451 Mon Sep 17 00:00:00 2001 From: terik23 Date: Tue, 30 Jul 2019 23:44:48 +0500 Subject: [PATCH 16/19] formating test_package.cpp --- test_package/test_package.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test_package/test_package.cpp b/test_package/test_package.cpp index 0dfd7af..3e5f101 100644 --- a/test_package/test_package.cpp +++ b/test_package/test_package.cpp @@ -5,23 +5,23 @@ #include struct SomeStruct {}; -enum class Color { RED = -12, GREEN = 7, BLUE = 15 }; SomeStruct structvar; + int main() { // Compile-time. constexpr auto name = NAMEOF(structvar); static_assert("structvar" == name); // Nameof. - using std::literals::string_view_literals::operator""sv; - std::string_view res1 = NAMEOF(structvar); std::string_view res2 = NAMEOF(::structvar); - + std::cout << res1 << '\n' << res2 << '\n'; - - bool success = res1 == "structvar"sv - && res2 == "structvar"sv; + + using std::literals::string_view_literals::operator""sv; + + bool success = (res1 == "structvar"sv) && (res2 == "structvar"sv); + return success ? EXIT_SUCCESS : EXIT_FAILURE; } From ef791f7a8a9b3c7e8456259eb745811546a7d227 Mon Sep 17 00:00:00 2001 From: terik23 Date: Tue, 30 Jul 2019 23:45:36 +0500 Subject: [PATCH 17/19] returned appveyor version name --- .appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index bbba35b..f01b146 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,3 +1,5 @@ +version: "{branch} #{build}" + build: false environment: From 412e9a69d0ca78106261f6e7c7225b6d959f1387 Mon Sep 17 00:00:00 2001 From: terik23 Date: Tue, 30 Jul 2019 23:45:47 +0500 Subject: [PATCH 18/19] formating conanfile.py --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 5c52c19..224297f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -24,7 +24,7 @@ class NameofConan(ConanFile): author = 'Daniil Goncharov ' license = 'MIT' generators = 'cmake_find_package' - exports_sources = ['example/*','include/*','test/*','CMakeLists.txt','LICENSE'] + exports_sources = ['example/*', 'include/*', 'test/*', 'CMakeLists.txt', 'LICENSE'] exports = ['LICENSE.md'] _build_subfolder = 'build_subfolder' build_requires = [] From 341104fb62cf34af3576933bcc82fea7d9cdd1ed Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Tue, 30 Jul 2019 18:27:49 +0200 Subject: [PATCH 19/19] add xcode10.2 and xcode11 to travis matrix --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index ae57c0a..b746f19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,14 @@ matrix: osx_image: xcode10.1 env: CONAN_APPLE_CLANG_VERSIONS=10.0 + - <<: *osx + osx_image: xcode10.2 + env: CONAN_APPLE_CLANG_VERSIONS=10.0 + + - <<: *osx + osx_image: xcode11 + env: CONAN_APPLE_CLANG_VERSIONS=11.0 + install: - chmod +x .ci/install.sh - ./.ci/install.sh