aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-04-28 16:00:29 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-28 16:02:28 +0300
commit128f0648d0bbafcd805a8c87d33fddf596e72590 (patch)
treec08549eb7fd746c900e28a116ef55ce36ab1647e
parent41bdbc068a179ade1b2f76f506afa7dd0716aad5 (diff)
Switch to version module
-rw-r--r--.gitignore4
-rw-r--r--bbot/.gitignore1
-rw-r--r--bbot/buildfile3
-rw-r--r--bbot/version-impl81
-rw-r--r--bbot/version-impl.in87
-rw-r--r--build/bootstrap.build12
-rw-r--r--buildfile3
-rw-r--r--manifest10
-rw-r--r--version1
9 files changed, 104 insertions, 98 deletions
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/bbot/.gitignore b/bbot/.gitignore
index e31326e..59e9ffd 100644
--- a/bbot/.gitignore
+++ b/bbot/.gitignore
@@ -2,3 +2,4 @@
*-options.?xx
bbot-agent
bbot-worker
+version-impl
diff --git a/bbot/buildfile b/bbot/buildfile
index 467b53e..962d379 100644
--- a/bbot/buildfile
+++ b/bbot/buildfile
@@ -52,6 +52,9 @@ exe{bbot-worker}: \
{hxx }{ version-impl } \
$libs
+hxx{version-impl}: in{version-impl} $src_root/file{manifest}
+hxx{version-impl}: dist = true
+
# Generated options parser.
#
if $cli.configured
diff --git a/bbot/version-impl b/bbot/version-impl
deleted file mode 100644
index 8139bb4..0000000
--- a/bbot/version-impl
+++ /dev/null
@@ -1,81 +0,0 @@
-// file : bbot/version-impl -*- C++ -*-
-// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
-// license : TBC; see accompanying LICENSE file
-
-#ifndef BBOT_VERSION // Note: using the version macro itself.
-
-#include <butl/version> // LIBBUTL_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 BBOT_VERSION 49901
-#define BBOT_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 LIBBBOT_VERSION != 49901
-# error incompatible libbbot version
-#endif
-
-// User agent.
-//
-#if defined(_WIN32)
-# if defined(__MINGW32__)
-# define BBOT_OS "MinGW"
-# else
-# define BBOT_OS "Windows"
-# endif
-#elif defined(__linux)
-# define BBOT_OS "GNU/Linux"
-#elif defined(__APPLE__)
-# define BBOT_OS "MacOS"
-#elif defined(__CYGWIN__)
-# define BBOT_OS "Cygwin"
-#elif defined(__FreeBSD__)
-# define BBOT_OS "FreeBSD"
-#elif defined(__OpenBSD__)
-# define BBOT_OS "OpenBSD"
-#elif defined(__NetBSD__)
-# define BBOT_OS "NetBSD"
-#elif defined(__sun)
-# define BBOT_OS "Solaris"
-#elif defined(__hpux)
-# define BBOT_OS "HP-UX"
-#elif defined(_AIX)
-# define BBOT_OS "AIX"
-#elif defined(__unix)
-# define BBOT_OS "Unix"
-#elif defined(__posix)
-# define BBOT_OS "Posix"
-#else
-# define BBOT_OS "Other"
-#endif
-
-#define BBOT_USER_AGENT \
- "bbot/" BBOT_VERSION_STR " (" BBOT_OS "; +https://build2.org)" \
- " libbbot/" LIBBBOT_VERSION_STR \
- " libbutl/" LIBBUTL_VERSION_STR
-
-#endif // BBOT_VERSION
diff --git a/bbot/version-impl.in b/bbot/version-impl.in
new file mode 100644
index 0000000..baf6f4f
--- /dev/null
+++ b/bbot/version-impl.in
@@ -0,0 +1,87 @@
+// file : bbot/version-impl.in -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : TBC; see accompanying LICENSE file
+
+#ifndef BBOT_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 BBOT_VERSION $bbot.version.project_number$ULL
+#define BBOT_VERSION_STR "$bbot.version.project$"
+#define BBOT_VERSION_ID "$bbot.version.project_id$"
+
+#define BBOT_VERSION_MAJOR $bbot.version.major$
+#define BBOT_VERSION_MINOR $bbot.version.minor$
+#define BBOT_VERSION_PATCH $bbot.version.patch$
+
+#define BBOT_PRE_RELEASE $bbot.version.pre_release$
+
+#define BBOT_SNAPSHOT $bbot.version.snapshot_sn$ULL
+#define BBOT_SNAPSHOT_ID "$bbot.version.snapshot_id$"
+
+#include <butl/version>
+
+$libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$
+
+#include <bbot/version>
+
+$libbbot.check(LIBBBOT_VERSION, LIBBBOT_SNAPSHOT)$
+
+// User agent.
+//
+#if defined(_WIN32)
+# if defined(__MINGW32__)
+# define BBOT_OS "MinGW"
+# else
+# define BBOT_OS "Windows"
+# endif
+#elif defined(__linux)
+# define BBOT_OS "GNU/Linux"
+#elif defined(__APPLE__)
+# define BBOT_OS "MacOS"
+#elif defined(__CYGWIN__)
+# define BBOT_OS "Cygwin"
+#elif defined(__FreeBSD__)
+# define BBOT_OS "FreeBSD"
+#elif defined(__OpenBSD__)
+# define BBOT_OS "OpenBSD"
+#elif defined(__NetBSD__)
+# define BBOT_OS "NetBSD"
+#elif defined(__sun)
+# define BBOT_OS "Solaris"
+#elif defined(__hpux)
+# define BBOT_OS "HP-UX"
+#elif defined(_AIX)
+# define BBOT_OS "AIX"
+#elif defined(__unix)
+# define BBOT_OS "Unix"
+#elif defined(__posix)
+# define BBOT_OS "Posix"
+#else
+# define BBOT_OS "Other"
+#endif
+
+#define BBOT_USER_AGENT \
+ "bbot/" BBOT_VERSION_STR " (" BBOT_OS "; +https://build2.org)" \
+ " libbbot/" LIBBBOT_VERSION_STR \
+ " libbutl/" LIBBUTL_VERSION_STR
+
+#endif // BBOT_VERSION
diff --git a/build/bootstrap.build b/build/bootstrap.build
index fc1f91c..ed98bb5 100644
--- a/build/bootstrap.build
+++ b/build/bootstrap.build
@@ -4,18 +4,8 @@
project = bbot
-using build@0.4.0
-
-version = 0.5.0-a1
-revision = 0
-
+using version
using config
using dist
-
-dist.package = $project-$version
-
-if ($revision != 0)
- dist.package += +$revision
-
using test
using install
diff --git a/buildfile b/buildfile
index 53b4f37..3ff0861 100644
--- a/buildfile
+++ b/buildfile
@@ -4,6 +4,9 @@
./: bbot/ etc/ unit-tests/ 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.
#
dir{tests/}: install = false
diff --git a/manifest b/manifest
index a713618..4d3b60a 100644
--- a/manifest
+++ b/manifest
@@ -1,6 +1,6 @@
: 1
name: bbot
-version: 0.5.0-a1
+version: 0.5.0-b.0.z
summary: build2 build bot
license: TBC ; All rights reserved
tags: build2, c++, build, bot, server, ci, continuous, integration, testing
@@ -10,9 +10,9 @@ 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: libbbot == 0.5.0-a1
+depends: libbutl [0.5.0-b.0.1 0.5.0-b.1)
+depends: libbbot [0.5.0-b.0.1 0.5.0-b.1)
diff --git a/version b/version
deleted file mode 100644
index d1f4eb1..0000000
--- a/version
+++ /dev/null
@@ -1 +0,0 @@
-0.5.0-a1