aboutsummaryrefslogtreecommitdiff
path: root/bbot
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-04-28 15:43:54 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-28 15:43:54 +0300
commitc2cf5867b7c80fa0a24ddf1a509f726739771b43 (patch)
tree12c5db96a451db4cce5c327eb113402968a00dcc /bbot
parent7d02874cf4c7c0ced29750905b96c02ff383e3d0 (diff)
Switch to version module
Diffstat (limited to 'bbot')
-rw-r--r--bbot/.gitignore1
-rw-r--r--bbot/build-config1
-rw-r--r--bbot/buildfile9
-rw-r--r--bbot/manifest1
-rw-r--r--bbot/version42
-rw-r--r--bbot/version.in48
6 files changed, 57 insertions, 45 deletions
diff --git a/bbot/.gitignore b/bbot/.gitignore
new file mode 100644
index 0000000..088eda4
--- /dev/null
+++ b/bbot/.gitignore
@@ -0,0 +1 @@
+version
diff --git a/bbot/build-config b/bbot/build-config
index 0f92eb8..d7a07d9 100644
--- a/bbot/build-config
+++ b/bbot/build-config
@@ -15,6 +15,7 @@
#include <butl/target-triplet>
#include <bbot/export>
+#include <bbot/version>
namespace bbot
{
diff --git a/bbot/buildfile b/bbot/buildfile
index 27bde1a..0a53207 100644
--- a/bbot/buildfile
+++ b/bbot/buildfile
@@ -11,13 +11,16 @@ lib{bbot}: \
{hxx }{ version } \
$int_libs
+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{bbot}: bin.lib.version = @-$version
+if $version.pre_release
+ lib{bbot}: bin.lib.version = @"-$version.project_id"
else
- lib{bbot}: bin.lib.version = @-$abi_major.$abi_minor
+ lib{bbot}: bin.lib.version = @"-$version.major.$version.minor"
cxx.poptions =+ "-I$src_root"
obja{*}: cxx.poptions += -DLIBBBOT_STATIC_BUILD
diff --git a/bbot/manifest b/bbot/manifest
index b2fefdd..115d9b6 100644
--- a/bbot/manifest
+++ b/bbot/manifest
@@ -16,6 +16,7 @@
#include <bpkg/manifest> // version, repository_location
#include <bbot/export>
+#include <bbot/version>
namespace bbot
{
diff --git a/bbot/version b/bbot/version
deleted file mode 100644
index d996d8b..0000000
--- a/bbot/version
+++ /dev/null
@@ -1,42 +0,0 @@
-// file : bbot/version -*- C++ -*-
-// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-#ifndef LIBBBOT_VERSION // Note: using the version macro itself.
-
-#include <butl/version> // LIBBUTL_VERSION
-#include <bpkg/version> // 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 LIBBBOT_VERSION 49901
-#define LIBBBOT_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
-
-#endif // LIBBBOT_VERSION
diff --git a/bbot/version.in b/bbot/version.in
new file mode 100644
index 0000000..41c4ce6
--- /dev/null
+++ b/bbot/version.in
@@ -0,0 +1,48 @@
+// file : bbot/version.in -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef LIBBBOT_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 LIBBBOT_VERSION $libbbot.version.project_number$ULL
+#define LIBBBOT_VERSION_STR "$libbbot.version.project$"
+#define LIBBBOT_VERSION_ID "$libbbot.version.project_id$"
+
+#define LIBBBOT_VERSION_MAJOR $libbbot.version.major$
+#define LIBBBOT_VERSION_MINOR $libbbot.version.minor$
+#define LIBBBOT_VERSION_PATCH $libbbot.version.patch$
+
+#define LIBBBOT_PRE_RELEASE $libbbot.version.pre_release$
+
+#define LIBBBOT_SNAPSHOT $libbbot.version.snapshot_sn$ULL
+#define LIBBBOT_SNAPSHOT_ID "$libbbot.version.snapshot_id$"
+
+#include <butl/version>
+
+$libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$
+
+#include <bpkg/version>
+
+$libbpkg.check(LIBBPKG_VERSION, LIBBPKG_SNAPSHOT)$
+
+#endif // LIBBBOT_VERSION