Skip to content

Commit

Permalink
Add usage examples
Browse files Browse the repository at this point in the history
- Added build examples
- Updated minor version to 0.12.0
- Added environment explanation on README file

Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries committed Jan 26, 2018
1 parent 649c9a2 commit ba84bce
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bincrafters/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.11.0'
__version__ = '0.12.0'
2 changes: 1 addition & 1 deletion bincrafters/build_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
9 changes: 9 additions & 0 deletions examples/build_header_only.py
Original file line number Diff line number Diff line change
@@ -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()
11 changes: 11 additions & 0 deletions examples/build_shared_library.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit ba84bce

Please sign in to comment.