Conan is a package manager for C/C++. In this repository, we demonstrate the use of Conan.
With the docker-compose.yaml
we spawn the following containers:
artifactory
: An Artifactory instance, in which we create aconan-test
repository.producer
: A container containing conan, in which we'll produce packagesconsumer
: Same container, in which we'll consume the packages.
- Run the
setup-artifactory.sh
script. This will run the compose file plus some required setup. - Browse to the Artifactory web page. Change the password to
YoavKlein3
and create a repo namedconan-test
. - Run the
init.sh
to setup our repo as a remote in both producer and consumer containers.
We want to demonstrate the following features:
- Consume binary package
- Produce a binary package and consume it.
- Produce a package recipe with sources bundled, and then consume and build it in the consumer.
- Produce a package recipe (with
source()
method), and then consume and build it in the consumer.
For this, we use the use_poco_example
. In this example, we consume the Poco library.
For this, we use the produce/mymath
- in which we produce a binary package and upload it to Artifactory.
Then, we use the consume/use-mymath
in the consumer to consume the package from Artifactory.
For this, we also use the produce/mymath
library. In this case, we don't build a binary package, only export
the package recipe and upload it. Then, we use consume/use-mymath
in the same way, just passing the --build
flag to conan install
to build the library from sources.
For this, we'll use the produce/hello-package
example. In this example, we use the hello
demo repo.
We export the recipe, and upload it to Artifactory. Then, we consume the package with conan install .. --build
to build the recipe. This case is different from the previous, since in this case we pull the sources from git,
the sources are not present in the package in Artifactory.