Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ private Closure runTests(String nodeName) {
+ "export PYENV_ROOT=${pyenvdir} && " \
+ "export PATH=\"${pyenvdir}/bin:\$PATH\" && " \
+ "pyenv local \$PY36 \$PY38 \$PY39 && " \
+ "python -m pip install tox tox-venv requests && " \
+ "python .ci/last_conan_version.py && " \
+ "python -m pip install tox && " \
+ "python -m tox --verbose\""
sh(script: command)
}
}
else if (nodeName=='Macos') {
def localDir = '/Users/jenkins'
withEnv(['PY36=3.6.12', 'PY38=3.8.6', 'PY39=3.9.0',
withEnv(['PY36=3.6.13', 'PY38=3.8.6', 'PY39=3.9.0',
"PYENV_ROOT=${localDir}/.pyenv",
"PATH+EXTRA=${localDir}/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"]) {
def pythonLocation = "${localDir}/.pyenv/versions/\$PY36/bin/python"
def launchCommand = "pyenv local \$PY36 \$PY38 \$PY39 && " \
+ "${pythonLocation} .ci/last_conan_version.py && ${pythonLocation} -m tox --verbose"
+ "${pythonLocation} -m pip install tox && " \
+ "${pythonLocation} -m tox --verbose"
sh(script: launchCommand)
}
}
else if (nodeName=='Windows') {
withEnv(['CMAKE_GENERATOR=Visual Studio 15 2017 Win64']) {
def pythonLocation = "C:/Python36/python.exe"
def launchCommand = "${pythonLocation} .ci/last_conan_version.py && tox -vv"
def launchCommand = "tox -vv"
bat(script: launchCommand)
}
}
Expand Down
26 changes: 9 additions & 17 deletions .ci/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,16 @@ def get_examples_to_skip(current_version):
skip = []
# Given the Conan version, some examples are skipped
required_conan = {
version.parse("1.29.0"): [
'./libraries/dear-imgui/basic', # solved bug for system packages and components
],
}
# version.parse("1.29.0"): [
# './libraries/dear-imgui/basic', # solved bug for system packages and components
# ],
}
for v, examples in required_conan.items():
if current_version < v:
skip.extend(examples)

# Some binaries are not available # TODO: All the examples should have binaries available
if platform.system() == "Windows": # Folly is not availble!! and appveyor_image() == "Visual Studio 2019":
skip.extend(['./libraries/folly/basic', ])
skip.extend(['./features/makefiles', ])
skip.extend(['./features/emscripten', ]) # FIXME: building for windows fails
# waf does not support Visual Studio 2019 for 2.0.19
if os.environ["CMAKE_GENERATOR"] == "Visual Studio 2019":
skip.extend(['./features/integrate_build_system', ])
if platform.system() == "Darwin":
skip.extend(['./features/multi_config', ]) # FIXME: it fails randomly, need to investigate
if platform.system() != "Windows":
skip.extend(['./features/visual_studio'])

return [os.path.normpath(it) for it in skip]

Expand All @@ -75,7 +67,7 @@ def get_build_list():

builds = []
script = "build.bat" if platform.system() == "Windows" else "build.sh"
skip_folders = [os.path.normpath(it) for it in ['./.ci', './.git', './.tox', 'examples_venv', '.pyenv']]
skip_folders = [os.path.normpath(it) for it in ['./.ci', './.git', './.tox', '.local', 'examples_venv', '.pyenv', 'venv']]
for root, dirs, files in os.walk('.'):
root = os.path.normpath(root)
if root in skip_folders:
Expand Down Expand Up @@ -132,7 +124,8 @@ def ensure_cache_preserved():

git = Git(folder=cache_directory)
with open(os.path.join(cache_directory, '.gitignore'), 'w') as gitignore:
gitignore.write(".conan/data/")
gitignore.write(".conan2/p/\n")
gitignore.write("*.sqlite3\n")
git.run("init .")
git.run("add .")

Expand Down Expand Up @@ -181,7 +174,6 @@ def run_scripts(scripts):
with chdir(os.path.dirname(script)):
print_build(script)
build_script = [sys.executable, abspath] if abspath.endswith(".py") else abspath
run("conan config install {} --type=file".format(os.path.join(base_dir, "conf", "settings.yml"))) # for emscripten, needs clang 14
with ensure_python_environment_preserved():
with ensure_cache_preserved():
result = subprocess.call(build_script, env=env)
Expand Down
87 changes: 6 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,17 @@ Several Conan examples to complement the documentation and blog.

## Examples

### [Getting started with Conan](libraries/poco/md5)
### [Creating packages with Visual Studio](features/visual_studio/creating_packages)

Example how to use Conan to consume binaries.
How to create packages with Visual Studio.

Documentation: https://docs.conan.io/en/latest/getting_started.html
Documentation: https://docs.conan.io/en/latest/integrations/visual_studio/creating_packages.html

### [Package development flow](features/package_development_flow)
### [Reusing packages with Visual Studio](features/visual_studio/chat)

Example how to use Conan commands to develop a package recipe.
How to use existing packages directly from Visual Studio.

Documentation: https://docs.conan.io/en/latest/developing_packages/package_dev_flow.html

### [Workspace](features/workspace)

Example how to use Conan Workspaces.

Documentation: https://docs.conan.io/en/latest/developing_packages/workspaces.html

### [Editable Packages](features/editable)

Example how to use Conan Editable Packages.

Documentation: https://docs.conan.io/en/latest/developing_packages/editable_packages.html

### [Serializing your data with Protobuf](libraries/protobuf/serialization)

Demonstrate how to use Protobuf to serialize data between C++ and Python.

Blog Post: https://blog.conan.io/2019/03/06/Serializing-your-data-with-Protobuf.html

### [Using Facebook Folly with Conan](libraries/folly/basic)

Demonstrate how to use Folly to validate an URI using Futures, FBString, Executors, and Format.

Blog Post: https://blog.conan.io/2018/12/03/Using-Facebook-Folly-with-Conan.html

### [An introduction to Dear ImGui and how to use with Conan](libraries/dear-imgui/basic)

Demonstrate how to use Dear ImGui with Conan to add a GUI to an OpenGL3 application.

### [Exporting targets with CMake and reuse with find_package()](features/cmake/find_package/exported_targets_multiconfig)

Use CMake to declare, export and install the targets of some libraries and using Conan to reuse them with
``find_package`` and the multi-configuration project.

### [Using the cmake_find_package_multi generator](features/cmake/find_package/find_cmake_multi_generator_targets)

Demonstrate how to use the ``cmake_find_package_multi`` generator to integrate seamlessly CMake with Conan
using ``find_package`` in a multi-configuration project.


### [Multi-configuration package (N configs -> 1 package)](features/multi_config)

Example on how to create multi-configuration debug/release packages covering the N configs -> 1 package use case:

- Remove the ``build_type`` from settings.
- Have a CMake script that differentiate debug and release artifacts (``set_target_properties(hello PROPERTIES DEBUG_POSTFIX _d)``).
- Have a ``build()`` that builds both configs.
- Have a ``package_info()`` method that accounts for both configs ``self.cpp_info.debug.libs``, etc.

Documentation: https://docs.conan.io/en/latest/creating_packages/package_approaches.html#n-configs-1-package


### Lockfiles

#### [Using lockfiles in CI to rebuild a whole project](features/lockfiles/ci)

When a package in a dependency graph is modified and a new version or revision is created, it
is sometimes desired to test if that new version works well within a larger product or project,
that is, when that package is part of a larger dependency graph. The packages that depend on
the modified one might need to be rebuilt, but if something else changed, it is impossible to
achieve reproducible builds.

Using lockfiles can enforce the same upstream dependencies, to ensure reproducible builds and to re-build and test such scenarios.

Documentation: https://docs.conan.io/en/latest/versioning/lockfiles.html#how-to-use-lockfiles-in-ci

### [Integrate a build system in Conan](features/integrate_build_system)

Shows how to integrate a build-system in Conan using an *installer*, a *build-helper* and a *custom generator*.

### [Deployment](features/deployment)

Shows how to use conan ``json`` generator with custom script to automate the creation of deployable artifact ([makeself.io](https://makeself.io))

Documentation: https://docs.conan.io/en/laters/integrations/deployment.html
Documentation: https://docs.conan.io/en/latest/integrations/visual_studio/creating_packages.html#reusing-packages

## How can I reproduce the build steps?

Expand Down
128 changes: 0 additions & 128 deletions conf/settings.yml

This file was deleted.

4 changes: 4 additions & 0 deletions features/visual_studio/creating_packages/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off

conan create . demo/testing
conan create . demo/testing -s compiler=msvc -s compiler.version=19.16 -s compiler.runtime=static -s compiler.cppstd=17
Loading