aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-28 12:30:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-28 12:30:32 +0200
commit009e96e5385aef0d34942999e8b67a551ef62957 (patch)
treeda35a8fa1e64ba210826d9b8903015dc0c0c732e
parent936512ff890ef322d9406d024dc9d1a42b039f2b (diff)
Switch to version module
-rw-r--r--.gitignore4
-rw-r--r--build/bootstrap.build11
-rw-r--r--build2/.gitignore1
-rw-r--r--build2/buildfile3
-rw-r--r--build2/version-impl37
-rw-r--r--build2/version-impl.in44
-rw-r--r--buildfile9
-rw-r--r--manifest8
-rw-r--r--version1
9 files changed, 63 insertions, 55 deletions
diff --git a/.gitignore b/.gitignore
index 14dbb9a..d7656b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,7 @@
*.exe.manifest
INSTALL
+
+# Generated version.
+#
+version
diff --git a/build/bootstrap.build b/build/bootstrap.build
index 688df96..26cbc0f 100644
--- a/build/bootstrap.build
+++ b/build/bootstrap.build
@@ -4,16 +4,7 @@
project = build2
-using build@0.4.0
-
-version = 0.5.0-a1
-revision = 0
-
-dist.package = $project-$version
-
-if ($revision != 0)
- dist.package += +$revision
-
+using version
using config
using test
using dist
diff --git a/build2/.gitignore b/build2/.gitignore
index 833a997..a82a338 100644
--- a/build2/.gitignore
+++ b/build2/.gitignore
@@ -2,3 +2,4 @@ b
b-boot
#*-options
#*-options.?xx
+version-impl
diff --git a/build2/buildfile b/build2/buildfile
index 23511b2..8f8d51c 100644
--- a/build2/buildfile
+++ b/build2/buildfile
@@ -107,6 +107,9 @@ exe{b}: {hxx ixx txx cxx}{** -b-options -dummy} \
liba{b} $libs
#\
+hxx{version-impl}: in{version-impl} $src_root/file{manifest}
+hxx{version-impl}: dist = true
+
# Fake utility library (without it code generation does not work).
#
liba{b}: {cxx}{ dummy }
diff --git a/build2/version-impl b/build2/version-impl
deleted file mode 100644
index b6c2a28..0000000
--- a/build2/version-impl
+++ /dev/null
@@ -1,37 +0,0 @@
-// file : build2/version-impl -*- C++ -*-
-// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-#ifndef BUILD2_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 BUILD2_VERSION 49901
-#define BUILD2_VERSION_STR "0.5.0-a.1"
-
-// 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 // BUILD2_VERSION
diff --git a/build2/version-impl.in b/build2/version-impl.in
new file mode 100644
index 0000000..a514240
--- /dev/null
+++ b/build2/version-impl.in
@@ -0,0 +1,44 @@
+// file : build2/version-impl.in -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BUILD2_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 BUILD2_VERSION $build2.version.project_number$ULL
+#define BUILD2_VERSION_STR "$build2.version.project$"
+#define BUILD2_VERSION_ID "$build2.version.project_id$"
+
+#define BUILD2_VERSION_MAJOR $build2.version.major$
+#define BUILD2_VERSION_MINOR $build2.version.minor$
+#define BUILD2_VERSION_PATCH $build2.version.patch$
+
+#define BUILD2_PRE_RELEASE $build2.version.pre_release$
+
+#define BUILD2_SNAPSHOT $build2.version.snapshot_sn$ULL
+#define BUILD2_SNAPSHOT_ID "$build2.version.snapshot_id$"
+
+#include <butl/version>
+
+$libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$
+
+#endif // BUILD2_VERSION
diff --git a/buildfile b/buildfile
index 8f52e29..7f3441e 100644
--- a/buildfile
+++ b/buildfile
@@ -3,9 +3,12 @@
# license : MIT; see accompanying LICENSE file
./: build2/ tests/ unit-tests/ doc/ \
-doc{INSTALL LICENSE NEWS README version} \
-file{bootstrap.sh bootstrap-msvc.bat bootstrap-mingw.bat} \
-file{INSTALL.cli config.guess config.sub manifest}
+ doc{INSTALL LICENSE NEWS README version} \
+ file{bootstrap.sh bootstrap-msvc.bat bootstrap-mingw.bat} \
+ file{INSTALL.cli config.guess config.sub 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 ed5f73a..bac68da 100644
--- a/manifest
+++ b/manifest
@@ -1,6 +1,6 @@
: 1
name: build2
-version: 0.5.0-a1
+version: 0.5.0-b.0.z
summary: build2 build system
license: MIT
tags: build2, c++, build, system
@@ -10,8 +10,8 @@ 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: 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