From 0de08dc04a93585d5279a71ea3fd6dd59cbbead8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 28 Apr 2017 16:46:06 +0300 Subject: Switch to version module --- brep/.gitignore | 2 ++ brep/buildfile | 9 ++++++--- brep/utility | 2 ++ brep/version | 52 ---------------------------------------------------- brep/version.in | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 55 deletions(-) delete mode 100644 brep/version create mode 100644 brep/version.in (limited to 'brep') diff --git a/brep/.gitignore b/brep/.gitignore index 9852519..1e5e1f9 100644 --- a/brep/.gitignore +++ b/brep/.gitignore @@ -6,3 +6,5 @@ package-extra build-odb* build.sql + +version diff --git a/brep/buildfile b/brep/buildfile index aeb1848..2da0281 100644 --- a/brep/buildfile +++ b/brep/buildfile @@ -31,13 +31,16 @@ lib{brep}: \ $int_libs \ sql{build package package-extra} +hxx{version}: in{version} $src_root/file{manifest} +hxx{version}: dist = true + # For pre-releases use the complete version to make sure they cannot be used # in place of another pre-release or the final version. # -if $abi_prerelease - lib{brep}: bin.lib.version = @-$version +if $version.pre_release + lib{brep}: bin.lib.version = @"-$version.project_id" else - lib{brep}: bin.lib.version = @-$abi_major.$abi_minor + lib{brep}: bin.lib.version = @"-$version.major.$version.minor" lib{brep}: cxx.export.poptions = "-I$out_root" "-I$src_root" lib{brep}: cxx.export.libs = $int_libs diff --git a/brep/utility b/brep/utility index b359fc6..3c6f5a2 100644 --- a/brep/utility +++ b/brep/utility @@ -29,4 +29,6 @@ namespace brep using butl::reverse_iterate; } +#include + #endif // BREP_UTILITY diff --git a/brep/version b/brep/version deleted file mode 100644 index e1db981..0000000 --- a/brep/version +++ /dev/null @@ -1,52 +0,0 @@ -// file : brep/version -*- C++ -*- -// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#ifndef BREP_VERSION // Note: using the version macro itself. - -#include // LIBBUTL_VERSION -#include // LIBBPKG_VERSION -#include // LIBBBOT_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 BREP_VERSION 49901 -#define BREP_VERSION_STR "0.5.0-a1" - -// For now these are the same. -// -#define LIBBREP_VERSION BREP_VERSION -#define LIBBREP_VERSION_STR BREP_VERSION_STR - -// 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 - -#if LIBBBOT_VERSION != 49901 -# error incompatible libbbot version -#endif - -#endif // BREP_VERSION diff --git a/brep/version.in b/brep/version.in new file mode 100644 index 0000000..25a4b5a --- /dev/null +++ b/brep/version.in @@ -0,0 +1,52 @@ +// file : brep/version.in -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef BREP_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 BREP_VERSION $brep.version.project_number$ULL +#define BREP_VERSION_STR "$brep.version.project$" +#define BREP_VERSION_ID "$brep.version.project_id$" + +#define BREP_VERSION_MAJOR $brep.version.major$ +#define BREP_VERSION_MINOR $brep.version.minor$ +#define BREP_VERSION_PATCH $brep.version.patch$ + +#define BREP_PRE_RELEASE $brep.version.pre_release$ + +#define BREP_SNAPSHOT $brep.version.snapshot_sn$ULL +#define BREP_SNAPSHOT_ID "$brep.version.snapshot_id$" + +#include + +$libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$ + +#include + +$libbpkg.check(LIBBPKG_VERSION, LIBBPKG_SNAPSHOT)$ + +#include + +$libbbot.check(LIBBBOT_VERSION, LIBBBOT_SNAPSHOT)$ + +#endif // BREP_VERSION -- cgit v1.1