- let's start with an executable, a portable UUID generator - the way you would normally start a new build2 project is with bdep-new command bdep new -t exe -l c++ genuuid t genuuid/ - CARGO WAY: "BUILD SYSTEM-LESS" - let's setup our build infrastructure cd genuuid bdep init -C @gcc cc config.cxx=g++ bdep init -C @clang cc config.cxx=clang++ bdep init -C @mingw cc config.cxx=x86_64-w64-mingw32-g++ l ../ bdep config list - default config b t hello/hello bdep update -a - ready to start hacking on it t - need to explain & change source, buildfile b genuuid/genuuid b test - adjust testscript bdep test -a - ready to commit & publish our changes - let's talk about versioning - with continuous versioning all these releases, pre-releases, and snapshots are assigned unique, properly ordered versions - in case of snapshots, automatically, from the version control system bdep status git add . git commit -m "Initial genuuid implementation" bdep status # new available b # auto-sync (no big deal now, will see why it is later) git remote add origin git@github.com:boris-kolpackov/genuuid.git git push -u bdep ci # On Windows! # > git clone https://github.com/boris-kolpackov/genuuid.git > cd genuuid > bdep init -C @msvc cc config.cxx=cl.exe > b > genuuid\genuuid.exe > b test ------------------------------------------------------------------------------- - critical path, must be frictionless & painless cd .. bdep new -t lib -l c++ libstud-uuid l t libstud-uuid cd libstud-uuid bdep init -A ../genuuid-gcc @gcc bdep init -A ../genuuid-clang @clang bdep init -A ../genuuid-mingw @mingw bdep test -a rm -r libstud-uuid && cp -r ~/1/libstud-uuid/* ./ t bdep test -a git add . git commit -m "Initial libstud-uuid implementation" - already created new repo on github git remote add origin git@github.com:libstud/libstud-uuid.git git push -u bdep ci - while waiting let's start convert our genuuid to use the library - maybe will solve our Linux build issue cd ../genuuid edit genuuid/genuuid.cxx edit genuuid/buildfile # KILL lib linking!!! nano manifest # NO CONSTRAINT (will talk later) nano repositories.manifest # (u) register b bdep test -a -r # "Deep Testing" git commit -a -m "Use libstud-uuid library" # ^Use git push bdep ci (verify Linux fix - do Windows in the meantime) - switch to Windows pull and build, discuss build system auto-sync > git pull > b ------------------------------------------------------------------------------ - How do we find libraries? In fact, we should have checked if there already a UUID generation library before implementing it ourselves in our first project. Maybe this whole talk would have been unnecessary. So where do we look? - search for hello library - see license - see # deps - see build status - the two complement each other - reasonable strategy for package developer is to publish releases - package consumers can then decide which one or both to use - so let's make a release of uuid library, publish it to cppget and then adjust genuuid to use that repository cd ../libstud-uuid edit manifest # the single source of version, propagated to other places git commit -a -m "Release version 1.0.0" #^ Release git tag -a v1.0.0 -m "Tag version 1.0.0" #^ Tag git push --follow-tags #^ Follow bdep publish - check queue - let's add cppget repository to our genuuid project cd ../genuuid edit repositories.manifest # leave git repo (complement; source of unreleased) - let's also add a version constraint to our dependency edit manifest bdep test git commit -a -m "Depend on libstud-uuid ^1.0.0" #^ Depend git push ------------------------------------------------------------------------------