From 009e96e5385aef0d34942999e8b67a551ef62957 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 28 Apr 2017 12:30:32 +0200 Subject: Switch to version module --- .gitignore | 4 ++++ build/bootstrap.build | 11 +---------- build2/.gitignore | 1 + build2/buildfile | 3 +++ build2/version-impl | 37 ------------------------------------- build2/version-impl.in | 44 ++++++++++++++++++++++++++++++++++++++++++++ buildfile | 9 ++++++--- manifest | 8 ++++---- version | 1 - 9 files changed, 63 insertions(+), 55 deletions(-) delete mode 100644 build2/version-impl create mode 100644 build2/version-impl.in delete mode 100644 version 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 // 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 + +$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 -- cgit v1.1