From ba84bce47c814cb14f349ce5663e25cf219da753 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 26 Jan 2018 09:43:36 -0200 Subject: [PATCH] Add usage examples - Added build examples - Updated minor version to 0.12.0 - Added environment explanation on README file Signed-off-by: Uilian Ries --- README.md | 22 +++++++++++++++++++++- bincrafters/__init__.py | 2 +- bincrafters/build_shared.py | 2 +- examples/build_header_only.py | 9 +++++++++ examples/build_shared_library.py | 11 +++++++++++ 5 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 examples/build_header_only.py create mode 100644 examples/build_shared_library.py diff --git a/README.md b/README.md index f2ad4a9..d4edfd3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # Bincrafters Package Tools -## A modular toolset for Conan package tools +## A modular toolset for [Conan package tools](https://github.com/conan-io/conan-package-tools) This project contains files used by Conan Package Tools for all kinds of bincrafters builds. @@ -24,6 +24,26 @@ Or if you want to download our pip package pip install bincrafters-package-tools +#### HOW TO USE +We listed two common [examples](examples): +* How to [build shared library](examples/build_shared_library.py) +* Hot to [build header only](examples/build_header_only.py) + + +#### ENVIRONMENT +All variables supported by Conan package tools, are treated by Bincrafters package tools as well. +To solve the upload, some variables are customized by default: + +**CONAN_UPLOAD**: https://api.bintray.com/conan/bincrafters/public-conan +**CONAN_REFERENCE**: Fields **name** and **version** from conanfile.py +**CONAN_USERNAME**: Get from CI env vars. Otherwise, use **bincrafters** +**CONAN_VERSION**: Get from CI env vars. +**CONAN_VERSION**: Field **version** from conanfile.py +**CONAN_UPLOAD_ONLY_WHEN_STABLE**: True for default template. False for Boost builds. +**CONAN_STABLE_BRANCH_PATTERN**: stable/* + +**BINTRAY_REPOSITORY**: Bintray repository name. This variable replaces "public-conan" for **CONAN_UPLOAD**. + ##### Testing and Development To install extra packages required to test diff --git a/bincrafters/__init__.py b/bincrafters/__init__.py index f323a57..2c7bffb 100644 --- a/bincrafters/__init__.py +++ b/bincrafters/__init__.py @@ -1 +1 @@ -__version__ = '0.11.0' +__version__ = '0.12.0' diff --git a/bincrafters/build_shared.py b/bincrafters/build_shared.py index 12ac9b8..5ea59a7 100644 --- a/bincrafters/build_shared.py +++ b/bincrafters/build_shared.py @@ -105,7 +105,7 @@ def get_conan_remotes(username): # require other packages from the bincrafters repo. bincrafters_user = "bincrafters" if username != bincrafters_user: - remotes.append(get_user_repository(bincrafters_user, "public-conan")) + remotes.append(get_conan_upload(bincrafters_user)) return remotes diff --git a/examples/build_header_only.py b/examples/build_header_only.py new file mode 100644 index 0000000..74dfa91 --- /dev/null +++ b/examples/build_header_only.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from bincrafters import build_template_header_only + + +if __name__ == "__main__": + builder = build_template_header_only.get_builder() + builder.run() diff --git a/examples/build_shared_library.py b/examples/build_shared_library.py new file mode 100644 index 0000000..7d6a760 --- /dev/null +++ b/examples/build_shared_library.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from bincrafters import build_template_default + + +if __name__ == "__main__": + # Set True when the target is NOT pure C project + pure_c = False + builder = build_template_default.get_builder(pure_c=pure_c) + builder.run()