aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-28 12:13:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-28 12:13:13 +0200
commit580f67e991f9ac7f53bd9430bb74b199209e065d (patch)
tree683da4894b0604d50f1ef330ecd825adca10d40d
parentf086522a901442599566b60271efb5a4c7691d55 (diff)
Switch to version module
-rw-r--r--.gitignore4
-rw-r--r--bpkg/.gitignore1
-rw-r--r--bpkg/buildfile9
-rw-r--r--bpkg/manifest1
-rw-r--r--bpkg/version37
-rw-r--r--bpkg/version.in44
-rw-r--r--build/bootstrap.build17
-rw-r--r--buildfile7
-rw-r--r--manifest8
-rw-r--r--version1
10 files changed, 65 insertions, 64 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/bpkg/.gitignore b/bpkg/.gitignore
new file mode 100644
index 0000000..088eda4
--- /dev/null
+++ b/bpkg/.gitignore
@@ -0,0 +1 @@
+version
diff --git a/bpkg/buildfile b/bpkg/buildfile
index 74ee29a..7def27f 100644
--- a/bpkg/buildfile
+++ b/bpkg/buildfile
@@ -10,13 +10,16 @@ lib{bpkg}: \
{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{bpkg}: bin.lib.version = @-$version
+if $version.pre_release
+ lib{bpkg}: bin.lib.version = @"-$version.project_id"
else
- lib{bpkg}: bin.lib.version = @-$abi_major.$abi_minor
+ lib{bpkg}: bin.lib.version = @"-$version.major.$version.minor"
cxx.poptions =+ "-I$src_root"
obja{*}: cxx.poptions += -DLIBBPKG_STATIC_BUILD
diff --git a/bpkg/manifest b/bpkg/manifest
index f638592..d6caabf 100644
--- a/bpkg/manifest
+++ b/bpkg/manifest
@@ -18,6 +18,7 @@
#include <butl/manifest-forward>
#include <bpkg/export>
+#include <bpkg/version>
namespace bpkg
{
diff --git a/bpkg/version b/bpkg/version
deleted file mode 100644
index acbf1f8..0000000
--- a/bpkg/version
+++ /dev/null
@@ -1,37 +0,0 @@
-// file : bpkg/version -*- C++ -*-
-// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-#ifndef LIBBPKG_VERSION // Note: using the version macro itself.
-
-#include <butl/version> // LIBBUTL_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 LIBBPKG_VERSION 49901
-#define LIBBPKG_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
-
-#endif // LIBBPKG_VERSION
diff --git a/bpkg/version.in b/bpkg/version.in
new file mode 100644
index 0000000..da8d84c
--- /dev/null
+++ b/bpkg/version.in
@@ -0,0 +1,44 @@
+// file : bpkg/version -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef LIBBPKG_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 LIBBPKG_VERSION $libbpkg.version.project_number$ULL
+#define LIBBPKG_VERSION_STR "$libbpkg.version.project$"
+#define LIBBPKG_VERSION_ID "$libbpkg.version.project_id$"
+
+#define LIBBPKG_VERSION_MAJOR $libbpkg.version.major$
+#define LIBBPKG_VERSION_MINOR $libbpkg.version.minor$
+#define LIBBPKG_VERSION_PATCH $libbpkg.version.patch$
+
+#define LIBBPKG_PRE_RELEASE $libbpkg.version.pre_release$
+
+#define LIBBPKG_SNAPSHOT $libbpkg.version.snapshot_sn$ULL
+#define LIBBPKG_SNAPSHOT_ID "$libbpkg.version.snapshot_id$"
+
+#include <butl/version>
+
+$libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$
+
+#endif // LIBBPKG_VERSION
diff --git a/build/bootstrap.build b/build/bootstrap.build
index c5fffee..cb7f8dc 100644
--- a/build/bootstrap.build
+++ b/build/bootstrap.build
@@ -4,22 +4,7 @@
project = libbpkg
-using build@0.4.0
-
-version = 0.5.0-a1
-
-abi_major = 0
-abi_minor = 5
-abi_patch = 0
-abi_prerelease = true
-
-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 4304108..d8b472e 100644
--- a/buildfile
+++ b/buildfile
@@ -2,9 +2,10 @@
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-d = bpkg/ tests/
-./: $d doc{INSTALL LICENSE NEWS README version} file{manifest}
-include $d
+./: bpkg/ 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.
#
diff --git a/manifest b/manifest
index e50559f..801eaab 100644
--- a/manifest
+++ b/manifest
@@ -1,6 +1,6 @@
: 1
name: libbpkg
-version: 0.5.0-a1
+version: 0.5.0-b.0.z
summary: build2 package manager library
license: MIT
tags: build2, bpkg, package, manager
@@ -10,6 +10,6 @@ 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: libbutl == 0.5.0-a1
+depends: * build2 >= 0.5.0-
+depends: * bpkg >= 0.5.0-
+depends: libbutl [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