aboutsummaryrefslogtreecommitdiff
path: root/brep
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-04-28 16:46:06 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-28 16:46:06 +0300
commit0de08dc04a93585d5279a71ea3fd6dd59cbbead8 (patch)
treec8178ccdda3e06b04d0d51d2699261a6b22fecd4 /brep
parent241afb3b9982d9c6d836b6dbbcef10418d80299c (diff)
Switch to version module
Diffstat (limited to 'brep')
-rw-r--r--brep/.gitignore2
-rw-r--r--brep/buildfile9
-rw-r--r--brep/utility2
-rw-r--r--brep/version52
-rw-r--r--brep/version.in52
5 files changed, 62 insertions, 55 deletions
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 <brep/version>
+
#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 <butl/version> // LIBBUTL_VERSION
-#include <bpkg/version> // LIBBPKG_VERSION
-#include <bbot/version> // 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 <butl/version>
+
+$libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$
+
+#include <bpkg/version>
+
+$libbpkg.check(LIBBPKG_VERSION, LIBBPKG_SNAPSHOT)$
+
+#include <bbot/version>
+
+$libbbot.check(LIBBBOT_VERSION, LIBBBOT_SNAPSHOT)$
+
+#endif // BREP_VERSION