SlideShare ist ein Scribd-Unternehmen logo
1 von 53
Downloaden Sie, um offline zu lesen
SECCOM 2017
Conan.io C/C++ Package Manager
Uilian Ries @uilianries
Link desta apresentação
https://goo.gl/6XprTk
Uilian Ries
@uilianries
https://uilianries.github.io
● Análise de sistemas - UNISINOS;
● Desenvolvedor C++ na Khomp;
● Entusiasta Open Source.
QUEM SOU EU
KHOMP na SECCOM 2017
● Palestra empresarial no Hall
● 5 de Outubro (hoje)
● Às 14h10
KHOMP - Posições em aberto
● http://khomp.com/trabalhe-conosco
● Desenvolvedor C++
● Desenvolvedor Web
ERA APENAS UM CÓDIGO …
Exemplo utilizando Boost Regex
para validar e-mail
/* VALIDAR SE A ENTRADA É UM ENDEREÇO DE E-MAIL */
// main.cpp
#include <iostream>
#include <boost/regex.hpp>
int main(int argc, char** argv){
if (argc != 2) return 1;
boost::regex expr{"b[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}b"}
;
std::cout << std::boolalpha << boost::regex_match(argv[1], expr) << 'n';
return 0;
}
# CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(regex-example CXX)
find_package(Boost 1.64.0 COMPONENTS regex)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(regex main.cpp)
target_link_libraries(regex ${Boost_LIBRARIES})
uilian@local $ mkdir build && cd build && cmake ..
-- Could NOT find Boost
main.cpp:5:27: fatal error: boost/regex.hpp: No such file or
directory
#include <boost/regex.hpp>
^
compilation terminated.
Problema
Resolver
dependência
externa!
1) Baixar fontes
2) Construir
3) Instalar
~2 HORAS!
CppCon 2017 - Learning and Teaching Modern C++,
Bjarne Stroustrup
https://youtu.be/fX2W3nNjJIo?t=41m44s
Conan.io
O bárbaro chegou
para o resgate!
Conan.io
Features
● FOSS;
● Licença MIT;
● Estilo GIT, distribuído;
● Empacotamento de fontes e artefatos;
● Geradores MSVC, CMake, qmake, ...
Conan.io no Github
https://github.com/conan-io/conan
$ sudo pip install conan
$ conan new profile default --detect
It seems to be the first time you run conan
Auto detecting your dev setup to initialize conan.conf
Found gcc 6.3
Default conan.conf settings
os=Linux
arch=x86_64
compiler=gcc
compiler.version=6.3
build_type=Release
*** You can change them in ~/.conan/conan.conf ***
*** Or override with -s compiler='other' -s ...s***
Instalação
Utilizando pip
Exemplo
Boost Regex
# conanfile.txt
[requires]
Boost/1.64.0@bincrafters/stable
[generators]
cmake
Exemplo
Boost Regex
# CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(regex-example CXX)
include(${CMAKE_BINARY_DIR}/conanbuild
info.cmake)
conan_basic_setup()
add_executable(regex main.cpp)
target_link_libraries(regex ${CONAN_LIBS})
$ tree
.
├── CMakeLists.txt
├── conanfile.txt
└── main.cpp
0 directories, 3 files
Exemplo
Boost Regex
$ conan remote add bincrafters 
https://api.bintray.com/conan/bincrafters/p
ublic-conan
$ mkdir build && cd build
$ conan install ..
$ cmake .. && cmake --build .
$ bin/regex foo@mail.com
true
$ bin/regex foo#mail#com
false
Exemplo
Boost Regex
Dúvidas?
Conan
Numa casca
de noz
● Nomeação de pacotes
● Setup do sistema
● Distribuição de artefatos
● Cache local
Pacote
Estrutura do
nome
Estrutura do pacote:
name/version@user/channel
Exemplo:
Poco/1.7.5@lasote/stable
Poco/1.7.5@lasote/testing
Poco/1.7.5@lasote/ci
Poco/1.7.9@pocoproject/stable
Setup
Criação do
profile
Valores pré-definidos
+
Configuração do host
=
Profile Padrão
$uname
Linux
$ uname -m
X86_64
$ g++ --version
g++ 6.3.0 20170519
Setup
host
os: [Windows, Linux, Macos, Android, iOS]
arch: [x86, x86_64, armv6, armv7, armv7hf, armv8]
compiler:
gcc:
version: ["4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "5.1", "5.2", "5.3"]
libcxx: [libstdc++, libstdc++11]
Visual Studio:
runtime: [MD, MT, MTd, MDd]
version: ["8", "9", "10", "11", "12", "14"]
clang:
version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8"]
libcxx: [libstdc++, libstdc++11, libc++]
apple-clang:
version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3"]
libcxx: [libstdc++, libc++]
build_type: [None, Debug, Release]
● Valores
pré-definidos
$ conan profile show default
Configuration for profile default:
[settings]
arch: x86_64
build_type: Release
compiler: gcc
compiler.libcxx: libstdc++
compiler.version: 6.3
os: Linux
[options]
[build_requires]
[env]
[scopes]
dev=True
Setup
Profile padrão
conanfile.txt
Conan cache
conan.khomp.corp
Distribuição descentralizada
localhost
bintray.com/conan
$ conan install
1) Consulta cache local
2) Consulta servidor local
3) Consulta Bintray
Conan.io no Bintray
https://bintray.com/conan/
$ conan search  Boost/1.64.0@bincrafters/stable
Existing packages for recipe
Boost/1.64.0@bincrafters/stable:
Package_ID:
2bf7892a6dc21cad89e2c743f5ea0b1372817683
[options]
shared: True
use_icu: False
[settings]
arch: x86_64
build_type: Release
compiler: gcc
compiler.libcxx: libstdc++
compiler.version: 6.3
os: Linux
[requires]
...
Cache
Local
Boost Regex
Cache Local - 1 receita, N pacotes
localhost
conanfile.txt
amd64
Boost/1.64.0@bincrafters/stable
configN
i386
$ conan search
Lista todos pacotes na cache
Indentificação do pacote
Boost/1.64.0@bincrafters/stable
Package_ID: b2a2dd150fed04abc97d11c09f340db88855c686
[options]
shared: True
[settings]
arch: x86_64
build_type: Release
compiler: gcc
compiler.libcxx: libstdc++
compiler.version: 6.3
os: Linux
[requires]
Boost.Core/1.64.0@bincrafters/stable:5ab84d6acfe1f23
Dúvidas?
Hands-on
Como criar uma
receita do zero
Pacote Hello World!
● Todos devem participar
● Criar receita Conan para construir o projeto
● Deverá ser criado um biblioteca com apenas uma função:
○ void helloWord();
$ conan new --bare hello/0.1.0
$ tree
.
└── conanfile.py
0 directories, 1 files
Hands-on
Como criar uma
receita do zero
# conanfile.py
from conans import ConanFile, tools
class HelloConan(ConanFile):
name = "hello"
version = "0.1.0"
settings = "os", "arch", "compiler", "build_type"
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
Hands-on
Criando uma
receita do zero
# hello.h
#pragma once
void helloWorld();
# hello.cpp
#include "hello.h"
#include <iostream>
void helloWorld() {
std::cout << "Hello World!n";
}
Hands-on
Como criar uma
receita do zero
# CMakeLists.txt
project(Hello CXX)
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_BINARY_DIR}/conanbuil
dinfo.cmake)
conan_basic_setup()
add_library(hello hello.cpp)
Hands-on
Como criar uma
receita do zero
from conans import ConanFile, CMake, tools
class HelloConan(ConanFile):
name = "hello"
version = "0.1.0"
settings = "os", "arch", "compiler", "build_type"
exports_sources = “*”
generators = “cmake”
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
self.copy(pattern="*.h", dst=”include”, src=”.”)
self.copy(pattern="*", dst=”lib”, src=”lib”)
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
Hands-on
Como criar uma
receita do zero
$ conan new --sources hello/0.1.0
$ tree
.
├── conanfile.py
└── src
├── CMakeLists.txt
├── hello.cpp
└── hello.h
1 directory, 4 files
Hands-on
Como criar uma
receita do zero
$ conan create uilian/testing
● Exportar os fontes
● Gerar cmakebuildinfo
● Executar CMake (configure,build)
● Empacotar artefatos (headers,libs)
Hands-on
Criando uma
receita do zero
Hands-on
Como testar o
pacote
Pacote Hello World!
● Todos devem participar
● Criar diretório com nome test_package
● Criar aplicação que consome a biblioteca hello
● Criar receita Conan para construir o teste
$ mkdir test_package
$ cd test_package
Hands-on
Como testar o
pacote
# main.cpp
#include "hello.h"
int main() {
helloWorld();
return 0;
}
Hands-on
Como testar o
pacote
# CMakeLists.txt
project(PackageTest CXX)
cmake_minimum_required(VERSION 2.8)
include(${CMAKE_BINARY_DIR}/conanbuil
dinfo.cmake)
conan_basic_setup()
add_executable(hello main.cpp)
target_link_libraries(hello ${CONAN_LIBS})
Hands-on
Como testar o
pacote
from conans import Conanfile, CMake, tools
Import os
class HelloTestConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = “cmake”
def build(self):
cmake = CMake(self)
cmake.configure(build_dirs=”./”)
cmake.build()
def imports(self):
self.copy(pattern="*.so", dst=”bin”, src=”lib”)
def test(self):
with tools.chdir(“bin”):
self.run(“.%shello” % os.sep)
Hands-on
Como testar o
pacote
$ conan new --sources --test hello/0.1.0
$ tree .
.
├── conanfile.py
├── src
│ ├── CMakeLists.txt
│ ├── hello.cpp
│ └── hello.h
└── test_package
├── CMakeLists.txt
├── conanfile.py
└── example.cpp
2 directories, 7 files
Hands-on
Como testar o
pacote
$ conan create uilian/testing
● Exportar os fontes
● Gerar cmakebuildinfo
● Executar CMake (configure,build)
● Empacotar artefatos (headers,libs)
● Executar testes
Hands-on
Como testar o
pacote
$ conan info hello/0.1.0@uilian/testing
$ conan search hello/0.1.0@uilian/testing
Hands-on
Como testar o
pacote
REFERÊNCIAS
Conan.io
Github Conan.io
Programming C++ With The 4 Cs
CppCon 2016 Conan.io
CppCast Conan.io
SECCOM 2017
Conan.io C/C++ Package Manager
Uilian Ries
@uilianries
https://uilianries.github.io/
SECCOM 2017 - Conan.io o gerente de pacote para C e C++

Weitere ähnliche Inhalte

Was ist angesagt?

Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0bcoca
 
Buildout: How to maintain big app stacks without losing your mind
Buildout: How to maintain big app stacks without losing your mindBuildout: How to maintain big app stacks without losing your mind
Buildout: How to maintain big app stacks without losing your mindDylan Jay
 
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time webAnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time webclkao
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with TerraformMario IC
 
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...mCloud
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerOrtus Solutions, Corp
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)dantleech
 
Docker deploy
Docker deployDocker deploy
Docker deployEric Ahn
 
Ninja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for BeginnersNinja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for BeginnersChang W. Doh
 
Ops for everyone - John Britton
Ops for everyone - John BrittonOps for everyone - John Britton
Ops for everyone - John BrittonDevopsdays
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to AnsibleDan Vaida
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersBen Hall
 
Ansible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / QuickstartAnsible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / QuickstartHenry Stamerjohann
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karbanansiblebrno
 

Was ist angesagt? (19)

Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Buildout: How to maintain big app stacks without losing your mind
Buildout: How to maintain big app stacks without losing your mindBuildout: How to maintain big app stacks without losing your mind
Buildout: How to maintain big app stacks without losing your mind
 
How to ride a whale
How to ride a whaleHow to ride a whale
How to ride a whale
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time webAnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with Terraform
 
Ansible
AnsibleAnsible
Ansible
 
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 
Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)Exploring Async PHP (SF Live Berlin 2019)
Exploring Async PHP (SF Live Berlin 2019)
 
Docker deploy
Docker deployDocker deploy
Docker deploy
 
Ninja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for BeginnersNinja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for Beginners
 
Ops for everyone - John Britton
Ops for everyone - John BrittonOps for everyone - John Britton
Ops for everyone - John Britton
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
 
Lessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containersLessons from running potentially malicious code inside containers
Lessons from running potentially malicious code inside containers
 
Ansible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / QuickstartAnsible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / Quickstart
 
ansible why ?
ansible why ?ansible why ?
ansible why ?
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karban
 

Ähnlich wie SECCOM 2017 - Conan.io o gerente de pacote para C e C++

Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Conan a C/C++ Package Manager
Conan a C/C++ Package ManagerConan a C/C++ Package Manager
Conan a C/C++ Package ManagerUilian Ries
 
Conan.io - The C/C++ package manager for Developers
Conan.io - The C/C++ package manager for DevelopersConan.io - The C/C++ package manager for Developers
Conan.io - The C/C++ package manager for DevelopersUilian Ries
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)LumoSpark
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Asher Martin
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat Pôle Systematic Paris-Region
 
How to automate all your SEO projects
How to automate all your SEO projectsHow to automate all your SEO projects
How to automate all your SEO projectsVincent Terrasi
 
John Britton of GitHub on Ops for Everyone at DevCon Summit 2013 #MobileDevNB...
John Britton of GitHub on Ops for Everyone at DevCon Summit 2013 #MobileDevNB...John Britton of GitHub on Ops for Everyone at DevCon Summit 2013 #MobileDevNB...
John Britton of GitHub on Ops for Everyone at DevCon Summit 2013 #MobileDevNB...DEVCON
 
JavaScript in 2015
JavaScript in 2015JavaScript in 2015
JavaScript in 2015Igor Laborie
 
Hello elixir (and otp)
Hello elixir (and otp)Hello elixir (and otp)
Hello elixir (and otp)Abel Muíño
 
Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Halil Kaya
 
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP LibrariesDevelopment Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP LibrariesPantheon
 
Container (Docker) Orchestration Tools
Container (Docker) Orchestration ToolsContainer (Docker) Orchestration Tools
Container (Docker) Orchestration ToolsDhilipsiva DS
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...Jérôme Petazzoni
 
Build Systems with autoconf, automake and libtool [updated]
Build Systems with autoconf, automake and libtool [updated]Build Systems with autoconf, automake and libtool [updated]
Build Systems with autoconf, automake and libtool [updated]Benny Siegert
 
An Introduction to CMake
An Introduction to CMakeAn Introduction to CMake
An Introduction to CMakeICS
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
Continuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsContinuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsFrancesco Bruni
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 

Ähnlich wie SECCOM 2017 - Conan.io o gerente de pacote para C e C++ (20)

Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Conan a C/C++ Package Manager
Conan a C/C++ Package ManagerConan a C/C++ Package Manager
Conan a C/C++ Package Manager
 
Conan.io - The C/C++ package manager for Developers
Conan.io - The C/C++ package manager for DevelopersConan.io - The C/C++ package manager for Developers
Conan.io - The C/C++ package manager for Developers
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
 
How to automate all your SEO projects
How to automate all your SEO projectsHow to automate all your SEO projects
How to automate all your SEO projects
 
John Britton of GitHub on Ops for Everyone at DevCon Summit 2013 #MobileDevNB...
John Britton of GitHub on Ops for Everyone at DevCon Summit 2013 #MobileDevNB...John Britton of GitHub on Ops for Everyone at DevCon Summit 2013 #MobileDevNB...
John Britton of GitHub on Ops for Everyone at DevCon Summit 2013 #MobileDevNB...
 
JavaScript in 2015
JavaScript in 2015JavaScript in 2015
JavaScript in 2015
 
Hello elixir (and otp)
Hello elixir (and otp)Hello elixir (and otp)
Hello elixir (and otp)
 
Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36
 
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP LibrariesDevelopment Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
 
Container (Docker) Orchestration Tools
Container (Docker) Orchestration ToolsContainer (Docker) Orchestration Tools
Container (Docker) Orchestration Tools
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
Build Systems with autoconf, automake and libtool [updated]
Build Systems with autoconf, automake and libtool [updated]Build Systems with autoconf, automake and libtool [updated]
Build Systems with autoconf, automake and libtool [updated]
 
An Introduction to CMake
An Introduction to CMakeAn Introduction to CMake
An Introduction to CMake
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Continuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsContinuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and Jenkins
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 

Mehr von Uilian Ries

Gitlab - Creating C++ applications with Gitlab CI
Gitlab - Creating C++ applications with Gitlab CIGitlab - Creating C++ applications with Gitlab CI
Gitlab - Creating C++ applications with Gitlab CIUilian Ries
 
Meetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.ioMeetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.ioUilian Ries
 
Poco Bibliotecas C++
Poco Bibliotecas C++Poco Bibliotecas C++
Poco Bibliotecas C++Uilian Ries
 
Software Development Tools for C/C++
Software Development Tools for C/C++Software Development Tools for C/C++
Software Development Tools for C/C++Uilian Ries
 
Testes Unitários com GTest e Catch
Testes Unitários com GTest e CatchTestes Unitários com GTest e Catch
Testes Unitários com GTest e CatchUilian Ries
 
Elements of C++11
Elements of C++11Elements of C++11
Elements of C++11Uilian Ries
 
Unisinos - Proposta TCC 2015
Unisinos - Proposta TCC 2015Unisinos - Proposta TCC 2015
Unisinos - Proposta TCC 2015Uilian Ries
 

Mehr von Uilian Ries (9)

Gitlab - Creating C++ applications with Gitlab CI
Gitlab - Creating C++ applications with Gitlab CIGitlab - Creating C++ applications with Gitlab CI
Gitlab - Creating C++ applications with Gitlab CI
 
Git Workflow
Git WorkflowGit Workflow
Git Workflow
 
BDD em Ação
BDD em AçãoBDD em Ação
BDD em Ação
 
Meetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.ioMeetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.io
 
Poco Bibliotecas C++
Poco Bibliotecas C++Poco Bibliotecas C++
Poco Bibliotecas C++
 
Software Development Tools for C/C++
Software Development Tools for C/C++Software Development Tools for C/C++
Software Development Tools for C/C++
 
Testes Unitários com GTest e Catch
Testes Unitários com GTest e CatchTestes Unitários com GTest e Catch
Testes Unitários com GTest e Catch
 
Elements of C++11
Elements of C++11Elements of C++11
Elements of C++11
 
Unisinos - Proposta TCC 2015
Unisinos - Proposta TCC 2015Unisinos - Proposta TCC 2015
Unisinos - Proposta TCC 2015
 

Kürzlich hochgeladen

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Kürzlich hochgeladen (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

SECCOM 2017 - Conan.io o gerente de pacote para C e C++

  • 1. SECCOM 2017 Conan.io C/C++ Package Manager Uilian Ries @uilianries
  • 3. Uilian Ries @uilianries https://uilianries.github.io ● Análise de sistemas - UNISINOS; ● Desenvolvedor C++ na Khomp; ● Entusiasta Open Source. QUEM SOU EU
  • 4. KHOMP na SECCOM 2017 ● Palestra empresarial no Hall ● 5 de Outubro (hoje) ● Às 14h10
  • 5. KHOMP - Posições em aberto ● http://khomp.com/trabalhe-conosco ● Desenvolvedor C++ ● Desenvolvedor Web
  • 6. ERA APENAS UM CÓDIGO … Exemplo utilizando Boost Regex para validar e-mail
  • 7. /* VALIDAR SE A ENTRADA É UM ENDEREÇO DE E-MAIL */ // main.cpp #include <iostream> #include <boost/regex.hpp> int main(int argc, char** argv){ if (argc != 2) return 1; boost::regex expr{"b[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}b"} ; std::cout << std::boolalpha << boost::regex_match(argv[1], expr) << 'n'; return 0; }
  • 8. # CMakeLists.txt cmake_minimum_required(VERSION 2.8) project(regex-example CXX) find_package(Boost 1.64.0 COMPONENTS regex) include_directories(${Boost_INCLUDE_DIRS}) add_executable(regex main.cpp) target_link_libraries(regex ${Boost_LIBRARIES})
  • 9. uilian@local $ mkdir build && cd build && cmake .. -- Could NOT find Boost main.cpp:5:27: fatal error: boost/regex.hpp: No such file or directory #include <boost/regex.hpp> ^ compilation terminated.
  • 11. CppCon 2017 - Learning and Teaching Modern C++, Bjarne Stroustrup https://youtu.be/fX2W3nNjJIo?t=41m44s
  • 13. Conan.io Features ● FOSS; ● Licença MIT; ● Estilo GIT, distribuído; ● Empacotamento de fontes e artefatos; ● Geradores MSVC, CMake, qmake, ...
  • 15. $ sudo pip install conan $ conan new profile default --detect It seems to be the first time you run conan Auto detecting your dev setup to initialize conan.conf Found gcc 6.3 Default conan.conf settings os=Linux arch=x86_64 compiler=gcc compiler.version=6.3 build_type=Release *** You can change them in ~/.conan/conan.conf *** *** Or override with -s compiler='other' -s ...s*** Instalação Utilizando pip
  • 17. Exemplo Boost Regex # CMakeLists.txt cmake_minimum_required(VERSION 2.8) project(regex-example CXX) include(${CMAKE_BINARY_DIR}/conanbuild info.cmake) conan_basic_setup() add_executable(regex main.cpp) target_link_libraries(regex ${CONAN_LIBS})
  • 18. $ tree . ├── CMakeLists.txt ├── conanfile.txt └── main.cpp 0 directories, 3 files Exemplo Boost Regex
  • 19. $ conan remote add bincrafters https://api.bintray.com/conan/bincrafters/p ublic-conan $ mkdir build && cd build $ conan install .. $ cmake .. && cmake --build . $ bin/regex foo@mail.com true $ bin/regex foo#mail#com false Exemplo Boost Regex
  • 21. Conan Numa casca de noz ● Nomeação de pacotes ● Setup do sistema ● Distribuição de artefatos ● Cache local
  • 22. Pacote Estrutura do nome Estrutura do pacote: name/version@user/channel Exemplo: Poco/1.7.5@lasote/stable Poco/1.7.5@lasote/testing Poco/1.7.5@lasote/ci Poco/1.7.9@pocoproject/stable
  • 24. $uname Linux $ uname -m X86_64 $ g++ --version g++ 6.3.0 20170519 Setup host
  • 25. os: [Windows, Linux, Macos, Android, iOS] arch: [x86, x86_64, armv6, armv7, armv7hf, armv8] compiler: gcc: version: ["4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "5.1", "5.2", "5.3"] libcxx: [libstdc++, libstdc++11] Visual Studio: runtime: [MD, MT, MTd, MDd] version: ["8", "9", "10", "11", "12", "14"] clang: version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8"] libcxx: [libstdc++, libstdc++11, libc++] apple-clang: version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3"] libcxx: [libstdc++, libc++] build_type: [None, Debug, Release] ● Valores pré-definidos
  • 26. $ conan profile show default Configuration for profile default: [settings] arch: x86_64 build_type: Release compiler: gcc compiler.libcxx: libstdc++ compiler.version: 6.3 os: Linux [options] [build_requires] [env] [scopes] dev=True Setup Profile padrão
  • 27. conanfile.txt Conan cache conan.khomp.corp Distribuição descentralizada localhost bintray.com/conan $ conan install 1) Consulta cache local 2) Consulta servidor local 3) Consulta Bintray
  • 29. $ conan search Boost/1.64.0@bincrafters/stable Existing packages for recipe Boost/1.64.0@bincrafters/stable: Package_ID: 2bf7892a6dc21cad89e2c743f5ea0b1372817683 [options] shared: True use_icu: False [settings] arch: x86_64 build_type: Release compiler: gcc compiler.libcxx: libstdc++ compiler.version: 6.3 os: Linux [requires] ... Cache Local Boost Regex
  • 30. Cache Local - 1 receita, N pacotes localhost conanfile.txt amd64 Boost/1.64.0@bincrafters/stable configN i386 $ conan search Lista todos pacotes na cache
  • 31. Indentificação do pacote Boost/1.64.0@bincrafters/stable Package_ID: b2a2dd150fed04abc97d11c09f340db88855c686 [options] shared: True [settings] arch: x86_64 build_type: Release compiler: gcc compiler.libcxx: libstdc++ compiler.version: 6.3 os: Linux [requires] Boost.Core/1.64.0@bincrafters/stable:5ab84d6acfe1f23
  • 34. Pacote Hello World! ● Todos devem participar ● Criar receita Conan para construir o projeto ● Deverá ser criado um biblioteca com apenas uma função: ○ void helloWord();
  • 35. $ conan new --bare hello/0.1.0 $ tree . └── conanfile.py 0 directories, 1 files Hands-on Como criar uma receita do zero
  • 36. # conanfile.py from conans import ConanFile, tools class HelloConan(ConanFile): name = "hello" version = "0.1.0" settings = "os", "arch", "compiler", "build_type" def package_info(self): self.cpp_info.libs = tools.collect_libs(self) Hands-on Criando uma receita do zero
  • 37. # hello.h #pragma once void helloWorld(); # hello.cpp #include "hello.h" #include <iostream> void helloWorld() { std::cout << "Hello World!n"; } Hands-on Como criar uma receita do zero
  • 38. # CMakeLists.txt project(Hello CXX) cmake_minimum_required(VERSION 2.8) include(${CMAKE_BINARY_DIR}/conanbuil dinfo.cmake) conan_basic_setup() add_library(hello hello.cpp) Hands-on Como criar uma receita do zero
  • 39. from conans import ConanFile, CMake, tools class HelloConan(ConanFile): name = "hello" version = "0.1.0" settings = "os", "arch", "compiler", "build_type" exports_sources = “*” generators = “cmake” def build(self): cmake = CMake(self) cmake.configure() cmake.build() def package(self): self.copy(pattern="*.h", dst=”include”, src=”.”) self.copy(pattern="*", dst=”lib”, src=”lib”) def package_info(self): self.cpp_info.libs = tools.collect_libs(self) Hands-on Como criar uma receita do zero
  • 40. $ conan new --sources hello/0.1.0 $ tree . ├── conanfile.py └── src ├── CMakeLists.txt ├── hello.cpp └── hello.h 1 directory, 4 files Hands-on Como criar uma receita do zero
  • 41. $ conan create uilian/testing ● Exportar os fontes ● Gerar cmakebuildinfo ● Executar CMake (configure,build) ● Empacotar artefatos (headers,libs) Hands-on Criando uma receita do zero
  • 43. Pacote Hello World! ● Todos devem participar ● Criar diretório com nome test_package ● Criar aplicação que consome a biblioteca hello ● Criar receita Conan para construir o teste
  • 44. $ mkdir test_package $ cd test_package Hands-on Como testar o pacote
  • 45. # main.cpp #include "hello.h" int main() { helloWorld(); return 0; } Hands-on Como testar o pacote
  • 46. # CMakeLists.txt project(PackageTest CXX) cmake_minimum_required(VERSION 2.8) include(${CMAKE_BINARY_DIR}/conanbuil dinfo.cmake) conan_basic_setup() add_executable(hello main.cpp) target_link_libraries(hello ${CONAN_LIBS}) Hands-on Como testar o pacote
  • 47. from conans import Conanfile, CMake, tools Import os class HelloTestConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = “cmake” def build(self): cmake = CMake(self) cmake.configure(build_dirs=”./”) cmake.build() def imports(self): self.copy(pattern="*.so", dst=”bin”, src=”lib”) def test(self): with tools.chdir(“bin”): self.run(“.%shello” % os.sep) Hands-on Como testar o pacote
  • 48. $ conan new --sources --test hello/0.1.0 $ tree . . ├── conanfile.py ├── src │ ├── CMakeLists.txt │ ├── hello.cpp │ └── hello.h └── test_package ├── CMakeLists.txt ├── conanfile.py └── example.cpp 2 directories, 7 files Hands-on Como testar o pacote
  • 49. $ conan create uilian/testing ● Exportar os fontes ● Gerar cmakebuildinfo ● Executar CMake (configure,build) ● Empacotar artefatos (headers,libs) ● Executar testes Hands-on Como testar o pacote
  • 50. $ conan info hello/0.1.0@uilian/testing $ conan search hello/0.1.0@uilian/testing Hands-on Como testar o pacote
  • 51. REFERÊNCIAS Conan.io Github Conan.io Programming C++ With The 4 Cs CppCon 2016 Conan.io CppCast Conan.io
  • 52. SECCOM 2017 Conan.io C/C++ Package Manager Uilian Ries @uilianries https://uilianries.github.io/