From c470ddbfccef5c33f204535cb9327abdc6fcf2e2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 28 Apr 2017 12:13:53 +0200 Subject: Switch to version module --- .gitignore | 4 ++++ build/bootstrap.build | 17 +---------------- buildfile | 3 +++ butl/.gitignore | 1 + butl/buildfile | 9 ++++++--- butl/version | 26 -------------------------- butl/version.in | 40 ++++++++++++++++++++++++++++++++++++++++ manifest | 6 +++--- version | 1 - 9 files changed, 58 insertions(+), 49 deletions(-) create mode 100644 butl/.gitignore delete mode 100644 butl/version create mode 100644 butl/version.in delete mode 100644 version 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/build/bootstrap.build b/build/bootstrap.build index 95b80e3..5a5e3fc 100644 --- a/build/bootstrap.build +++ b/build/bootstrap.build @@ -4,22 +4,7 @@ project = libbutl -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 c63d3dd..05995b1 100644 --- a/buildfile +++ b/buildfile @@ -4,6 +4,9 @@ ./: butl/ 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/butl/.gitignore b/butl/.gitignore new file mode 100644 index 0000000..088eda4 --- /dev/null +++ b/butl/.gitignore @@ -0,0 +1 @@ +version diff --git a/butl/buildfile b/butl/buildfile index 04e6e09..8a86b2c 100644 --- a/butl/buildfile +++ b/butl/buildfile @@ -58,13 +58,16 @@ lib{butl}: file{sha256c.c} # lib{butl}: file{strptime.c timelocal.h timelocal.c} +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{butl}: bin.lib.version = @-$version +if $version.pre_release + lib{butl}: bin.lib.version = @"-$version.project_id" else - lib{butl}: bin.lib.version = @-$abi_major.$abi_minor + lib{butl}: bin.lib.version = @"-$version.major.$version.minor" cxx.poptions =+ "-I$src_root" obja{*}: cxx.poptions += -DLIBBUTL_STATIC_BUILD diff --git a/butl/version b/butl/version deleted file mode 100644 index a7756ef..0000000 --- a/butl/version +++ /dev/null @@ -1,26 +0,0 @@ -// file : butl/version -*- C++ -*- -// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#ifndef LIBBUTL_VERSION // Note: using the version macro itself. - -// 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 LIBBUTL_VERSION 49901 -#define LIBBUTL_VERSION_STR "0.5.0-a1" - -#endif // LIBBUTL_VERSION diff --git a/butl/version.in b/butl/version.in new file mode 100644 index 0000000..ef6b7f7 --- /dev/null +++ b/butl/version.in @@ -0,0 +1,40 @@ +// file : butl/version.in -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef LIBBUTL_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 LIBBUTL_VERSION $libbutl.version.project_number$ULL +#define LIBBUTL_VERSION_STR "$libbutl.version.project$" +#define LIBBUTL_VERSION_ID "$libbutl.version.project_id$" + +#define LIBBUTL_VERSION_MAJOR $libbutl.version.major$ +#define LIBBUTL_VERSION_MINOR $libbutl.version.minor$ +#define LIBBUTL_VERSION_PATCH $libbutl.version.patch$ + +#define LIBBUTL_PRE_RELEASE $libbutl.version.pre_release$ + +#define LIBBUTL_SNAPSHOT $libbutl.version.snapshot_sn$ULL +#define LIBBUTL_SNAPSHOT_ID "$libbutl.version.snapshot_id$" + +#endif // LIBBUTL_VERSION diff --git a/manifest b/manifest index b4bccff..31a05cf 100644 --- a/manifest +++ b/manifest @@ -1,6 +1,6 @@ : 1 name: libbutl -version: 0.5.0-a1 +version: 0.5.0-b.0.z summary: build2 utility library license: MIT, BSD-2; MIT except for 4 files from the FreeBSD project. tags: build2, utility, library @@ -10,5 +10,5 @@ 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- diff --git a/version b/version deleted file mode 100644 index d1f4eb1..0000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -0.5.0-a1 -- cgit v1.1