From b1fea88e77d2da1290d5cf3c12fcf0bc0d7935d8 Mon Sep 17 00:00:00 2001 From: Lawrence Millar-Madigan Date: Fri, 19 Apr 2019 12:04:25 +1000 Subject: [PATCH 1/6] Add conanfile and test consumer package --- conanfile.py | 19 +++++++++++++++++++ test_package/CMakeLists.txt | 10 ++++++++++ test_package/conanfile.py | 18 ++++++++++++++++++ test_package/example.cpp | 7 +++++++ 4 files changed, 54 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/example.cpp diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..e401cc4 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,19 @@ +from conans import ConanFile + + +class ScopeguardConan(ConanFile): + name = "scope_guard" + version = "0.2.3" + license = "The Unlicense" + author = "Ricardo Abreu ricardo.abreu@canonical.com" + url = "https://github.com/Lawrencemm/scope_guard" + description = ( + "A modern C++ scope guard that is easy to use but hard to misuse. " + "https://ricab.github.io/scope_guard/" + ) + topics = ("scope guard", "RAII", "resource management") + exports_sources = "scope_guard.hpp" + no_copy_source = True + + def package(self): + self.copy("*scope_guard.hpp", dst="include") diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt new file mode 100644 index 0000000..b812380 --- /dev/null +++ b/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) +project(PackageTest CXX) + +set(CMAKE_CXX_STANDARD 17) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/test_package/conanfile.py b/test_package/conanfile.py new file mode 100644 index 0000000..f272329 --- /dev/null +++ b/test_package/conanfile.py @@ -0,0 +1,18 @@ +import os + +from conans import ConanFile, CMake, tools + + +class ScopeguardTestConan(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): + os.chdir("bin") + self.run(".%sexample" % os.sep) diff --git a/test_package/example.cpp b/test_package/example.cpp new file mode 100644 index 0000000..2f83c5d --- /dev/null +++ b/test_package/example.cpp @@ -0,0 +1,7 @@ +#include + +#include + +int main() { + auto guard = sg::make_scope_guard([]() noexcept { return; }); +} From 495956b4e9107821fc4066fb907a3cfc4d4fda56 Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Wed, 1 May 2019 18:18:10 +0100 Subject: [PATCH 2/6] Bump to a dev version in conan --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index e401cc4..4e0be9b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -3,7 +3,7 @@ class ScopeguardConan(ConanFile): name = "scope_guard" - version = "0.2.3" + version = "0.2.4-dev.1" license = "The Unlicense" author = "Ricardo Abreu ricardo.abreu@canonical.com" url = "https://github.com/Lawrencemm/scope_guard" From 78588d7b0ecf420f175b4f2315794b454b8aa213 Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Wed, 1 May 2019 18:18:34 +0100 Subject: [PATCH 3/6] Use private email address in conan --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 4e0be9b..8352642 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,7 +5,7 @@ class ScopeguardConan(ConanFile): name = "scope_guard" version = "0.2.4-dev.1" license = "The Unlicense" - author = "Ricardo Abreu ricardo.abreu@canonical.com" + author = "Ricardo Abreu ricab@ricabhome.org" url = "https://github.com/Lawrencemm/scope_guard" description = ( "A modern C++ scope guard that is easy to use but hard to misuse. " From 3d8dbcea94d858e88ff4571c97bf00faa0d6970a Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Wed, 1 May 2019 18:19:18 +0100 Subject: [PATCH 4/6] Fix urls in conan --- conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index 8352642..0dd6fc8 100644 --- a/conanfile.py +++ b/conanfile.py @@ -6,8 +6,8 @@ class ScopeguardConan(ConanFile): version = "0.2.4-dev.1" license = "The Unlicense" author = "Ricardo Abreu ricab@ricabhome.org" - url = "https://github.com/Lawrencemm/scope_guard" - description = ( + url = "https://github.com/ricab/scope_guard" + homepage = "https://ricab.github.io/scope_guard/" "A modern C++ scope guard that is easy to use but hard to misuse. " "https://ricab.github.io/scope_guard/" ) From 5b3b0144f05c12dd1fad2209c2af88b92ad2bcb9 Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Wed, 1 May 2019 18:19:34 +0100 Subject: [PATCH 5/6] Update description and topics in conan --- conanfile.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/conanfile.py b/conanfile.py index 0dd6fc8..ebe69fe 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,10 +8,9 @@ class ScopeguardConan(ConanFile): author = "Ricardo Abreu ricab@ricabhome.org" url = "https://github.com/ricab/scope_guard" homepage = "https://ricab.github.io/scope_guard/" - "A modern C++ scope guard that is easy to use but hard to misuse. " - "https://ricab.github.io/scope_guard/" - ) - topics = ("scope guard", "RAII", "resource management") + description = "A modern C++ scope guard that is easy to use but hard to misuse." + topics = ("scope guard", "RAII", "resource management", "idioms", + "header-only", "single-file") exports_sources = "scope_guard.hpp" no_copy_source = True From efe5708695ea800634b27c7cc83a96eee1726195 Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Wed, 1 May 2019 18:26:10 +0100 Subject: [PATCH 6/6] Remove apparent stray star char from conan recipe --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index ebe69fe..6556785 100644 --- a/conanfile.py +++ b/conanfile.py @@ -15,4 +15,4 @@ class ScopeguardConan(ConanFile): no_copy_source = True def package(self): - self.copy("*scope_guard.hpp", dst="include") + self.copy("scope_guard.hpp", dst="include")