From 67ab77401f4b1c4580b7ce54a783843e31a55ebb Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 28 Apr 2017 16:20:35 +0300 Subject: Switch to version module --- .gitignore | 4 ++ bpkg/.gitignore | 1 + bpkg/bpkg-version | 81 --------------------- bpkg/bpkg.cxx | 1 - bpkg/buildfile | 5 +- bpkg/fetch.cxx | 1 - bpkg/satisfaction.cxx | 1 - bpkg/utility | 1 + bpkg/version-impl.in | 87 +++++++++++++++++++++++ build/bootstrap.build | 11 +-- buildfile | 6 +- manifest | 10 +-- tests/common/libhello-1.0.0/build/bootstrap.build | 17 +---- version | 1 - 14 files changed, 108 insertions(+), 119 deletions(-) delete mode 100644 bpkg/bpkg-version create mode 100644 bpkg/version-impl.in delete mode 100644 version diff --git a/.gitignore b/.gitignore index 01994ef..784f613 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,7 @@ *.exe *.exe.dlls/ *.exe.manifest + +# Generated version. +# +version diff --git a/bpkg/.gitignore b/bpkg/.gitignore index 782196c..dde5e32 100644 --- a/bpkg/.gitignore +++ b/bpkg/.gitignore @@ -5,3 +5,4 @@ bpkg *-odb.?xx repository-signing repository-signing.cxx +version-impl diff --git a/bpkg/bpkg-version b/bpkg/bpkg-version deleted file mode 100644 index 05a93c1..0000000 --- a/bpkg/bpkg-version +++ /dev/null @@ -1,81 +0,0 @@ -// file : bpkg/bpkg-version -*- C++ -*- -// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#ifndef BPKG_VERSION // Note: using the version macro itself. - -#include // LIBBUTL_VERSION -#include // LIBBPKG_VERSION - -// Version format is AABBCCDD where -// -// AA - major version number -// BB - minor version number -// CC - bugfix version number -// DD - alpha / beta (DD + 50) version number -// -// When DD is not 00, 1 is subtracted from AABBCC. For example: -// -// Version AABBCCDD -// 2.0.0 02000000 -// 2.1.0 02010000 -// 2.1.1 02010100 -// 2.2.0-a1 02019901 -// 3.0.0-b2 02999952 -// -#define BPKG_VERSION 49901 -#define BPKG_VERSION_STR "0.5.0-a1" - -// Generally, we expect minor versions to be source code backwards- -// compatible, thought we might have a minimum version requirement. -// -// Note: does not apply during early development. -// -#if LIBBUTL_VERSION != 49901 -# error incompatible libbutl version -#endif - -#if LIBBPKG_VERSION != 49901 -# error incompatible libbpkg version -#endif - -// User agent. -// -#if defined(_WIN32) -# if defined(__MINGW32__) -# define BPKG_OS "MinGW" -# else -# define BPKG_OS "Windows" -# endif -#elif defined(__linux) -# define BPKG_OS "GNU/Linux" -#elif defined(__APPLE__) -# define BPKG_OS "MacOS" -#elif defined(__CYGWIN__) -# define BPKG_OS "Cygwin" -#elif defined(__FreeBSD__) -# define BPKG_OS "FreeBSD" -#elif defined(__OpenBSD__) -# define BPKG_OS "OpenBSD" -#elif defined(__NetBSD__) -# define BPKG_OS "NetBSD" -#elif defined(__sun) -# define BPKG_OS "Solaris" -#elif defined(__hpux) -# define BPKG_OS "HP-UX" -#elif defined(_AIX) -# define BPKG_OS "AIX" -#elif defined(__unix) -# define BPKG_OS "Unix" -#elif defined(__posix) -# define BPKG_OS "Posix" -#else -# define BPKG_OS "Other" -#endif - -#define BPKG_USER_AGENT \ - "bpkg/" BPKG_VERSION_STR " (" BPKG_OS "; +https://build2.org)" \ - " libbpkg/" LIBBPKG_VERSION_STR \ - " libbutl/" LIBBUTL_VERSION_STR - -#endif // BPKG_VERSION diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx index 57375a4..e78e732 100644 --- a/bpkg/bpkg.cxx +++ b/bpkg/bpkg.cxx @@ -16,7 +16,6 @@ #include #include -#include // Commands. // diff --git a/bpkg/buildfile b/bpkg/buildfile index 6ce401d..1ed635b 100644 --- a/bpkg/buildfile +++ b/bpkg/buildfile @@ -10,7 +10,6 @@ import libs += libodb-sqlite%lib{odb-sqlite} exe{bpkg}: \ {hxx cxx}{ archive } \ {hxx cxx}{ auth } \ -{hxx }{ bpkg-version } \ { cxx}{ bpkg } {hxx ixx cxx}{ bpkg-options } \ {hxx cxx}{ cfg-create } {hxx ixx cxx}{ cfg-create-options } \ {hxx cxx}{ checksum } \ @@ -51,9 +50,13 @@ exe{bpkg}: \ {hxx }{ types } \ {hxx cxx}{ types-parsers } \ {hxx cxx}{ utility } \ +{hxx }{ version-impl } \ {hxx }{ wrapper-traits } \ $libs +hxx{version-impl}: in{version-impl} $src_root/file{manifest} +hxx{version-impl}: dist = true + # Disable "unknown pragma" warnings. # if ($cxx.id == "msvc") diff --git a/bpkg/fetch.cxx b/bpkg/fetch.cxx index c650958..6fe851e 100644 --- a/bpkg/fetch.cxx +++ b/bpkg/fetch.cxx @@ -13,7 +13,6 @@ #include #include -#include using namespace std; using namespace butl; diff --git a/bpkg/satisfaction.cxx b/bpkg/satisfaction.cxx index 6958328..bf033e9 100644 --- a/bpkg/satisfaction.cxx +++ b/bpkg/satisfaction.cxx @@ -10,7 +10,6 @@ #include #include #include -#include using namespace std; using namespace butl; diff --git a/bpkg/utility b/bpkg/utility index b562d04..6f4c3ca 100644 --- a/bpkg/utility +++ b/bpkg/utility @@ -18,6 +18,7 @@ #include #include +#include namespace bpkg { diff --git a/bpkg/version-impl.in b/bpkg/version-impl.in new file mode 100644 index 0000000..053c129 --- /dev/null +++ b/bpkg/version-impl.in @@ -0,0 +1,87 @@ +// file : bpkg/version-impl.in -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef BPKG_VERSION // Note: using the version macro itself. + +// Note: using build2 standard versioning scheme. The numeric version format +// is AAABBBCCCDDDE where: +// +// AAA - major version number +// BBB - minor version number +// CCC - bugfix version number +// DDD - alpha / beta (DDD + 500) version number +// E - final (0) / snapshot (1) +// +// When DDDE is not 0, 1 is subtracted from AAABBBCCC. For example: +// +// Version AAABBBCCCDDDE +// +// 0.1.0 0000010000000 +// 0.1.2 0000010010000 +// 1.2.3 0010020030000 +// 2.2.0-a.1 0020019990010 +// 3.0.0-b.2 0029999995020 +// 2.2.0-a.1.z 0020019990011 +// +#define BPKG_VERSION $bpkg.version.project_number$ULL +#define BPKG_VERSION_STR "$bpkg.version.project$" +#define BPKG_VERSION_ID "$bpkg.version.project_id$" + +#define BPKG_VERSION_MAJOR $bpkg.version.major$ +#define BPKG_VERSION_MINOR $bpkg.version.minor$ +#define BPKG_VERSION_PATCH $bpkg.version.patch$ + +#define BPKG_PRE_RELEASE $bpkg.version.pre_release$ + +#define BPKG_SNAPSHOT $bpkg.version.snapshot_sn$ULL +#define BPKG_SNAPSHOT_ID "$bpkg.version.snapshot_id$" + +#include + +$libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$ + +#include + +$libbpkg.check(LIBBPKG_VERSION, LIBBPKG_SNAPSHOT)$ + +// User agent. +// +#if defined(_WIN32) +# if defined(__MINGW32__) +# define BPKG_OS "MinGW" +# else +# define BPKG_OS "Windows" +# endif +#elif defined(__linux) +# define BPKG_OS "GNU/Linux" +#elif defined(__APPLE__) +# define BPKG_OS "MacOS" +#elif defined(__CYGWIN__) +# define BPKG_OS "Cygwin" +#elif defined(__FreeBSD__) +# define BPKG_OS "FreeBSD" +#elif defined(__OpenBSD__) +# define BPKG_OS "OpenBSD" +#elif defined(__NetBSD__) +# define BPKG_OS "NetBSD" +#elif defined(__sun) +# define BPKG_OS "Solaris" +#elif defined(__hpux) +# define BPKG_OS "HP-UX" +#elif defined(_AIX) +# define BPKG_OS "AIX" +#elif defined(__unix) +# define BPKG_OS "Unix" +#elif defined(__posix) +# define BPKG_OS "Posix" +#else +# define BPKG_OS "Other" +#endif + +#define BPKG_USER_AGENT \ + "bpkg/" BPKG_VERSION_STR " (" BPKG_OS "; +https://build2.org)" \ + " libbpkg/" LIBBPKG_VERSION_STR \ + " libbutl/" LIBBUTL_VERSION_STR + +#endif // BPKG_VERSION diff --git a/build/bootstrap.build b/build/bootstrap.build index cc27662..944d0f5 100644 --- a/build/bootstrap.build +++ b/build/bootstrap.build @@ -4,16 +4,7 @@ project = bpkg -using build@0.4.0 - -version = 0.5.0-a1 -revision = 0 - -dist.package = $project-$version - -if ($revision != 0) - dist.package += +$revision - +using version using config using dist using test diff --git a/buildfile b/buildfile index 7040dce..4e6ddd9 100644 --- a/buildfile +++ b/buildfile @@ -2,8 +2,10 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -d = bpkg/ tests/ doc/ -./: $d doc{INSTALL LICENSE NEWS README version} file{manifest} +./: bpkg/ tests/ doc/ doc{INSTALL LICENSE NEWS README version} file{manifest} + +doc{version}: file{manifest} # Generated by the version module. +doc{version}: dist = true # Don't install tests or the INSTALL file. # diff --git a/manifest b/manifest index df8a96c..db2d5b8 100644 --- a/manifest +++ b/manifest @@ -1,6 +1,6 @@ : 1 name: bpkg -version: 0.5.0-a1 +version: 0.5.0-b.0.z summary: build2 package manager license: MIT tags: build2, c++, package, manager @@ -10,11 +10,11 @@ url: https://build2.org email: users@build2.org build-email: builds@build2.org requires: c++14 -depends: * build2 >= 0.4.0 -depends: * bpkg >= 0.4.0 +depends: * build2 >= 0.5.0- +depends: * bpkg >= 0.5.0- # @@ Should probably become conditional dependency. requires: ? cli ; Only required if changing .cli files. -depends: libbutl == 0.5.0-a1 -depends: libbpkg == 0.5.0-a1 +depends: libbutl [0.5.0-b.0.1 0.5.0-b.1) +depends: libbpkg [0.5.0-b.0.1 0.5.0-b.1) depends: libodb [2.5.0-a10 2.6.0-); 2.5.X depends: libodb-sqlite [2.5.0-a10 2.6.0-); 2.5.X diff --git a/tests/common/libhello-1.0.0/build/bootstrap.build b/tests/common/libhello-1.0.0/build/bootstrap.build index 8d8db2b..1ff153d 100644 --- a/tests/common/libhello-1.0.0/build/bootstrap.build +++ b/tests/common/libhello-1.0.0/build/bootstrap.build @@ -1,21 +1,6 @@ project = libhello -using build@0.4.0-a1 - -version = 1.0.0 - -abi_major = 1 -abi_minor = 0 -abi_patch = 0 -abi_prerelease = false - -revision = 0 - -dist.package = $project-$version - -if ($revision != 0) - dist.package += +$revision - +using version using config using dist using test diff --git a/version b/version deleted file mode 100644 index d1f4eb1..0000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -0.5.0-a1 -- cgit v1.1