Skip to content

Commit

Permalink
Incorporate release date with ensmallen version (#226)
Browse files Browse the repository at this point in the history
* Incorporate release date with ensmallen version

* Switch to strings instead of ints to preserve prefixed 0.

* More simplification on chare usage.

* 'x' single char, "xyz" multi-char

* Split into two functions

* Update include/ensmallen_bits/ens_version.hpp

Co-authored-by: Ryan Curtin <ryan@ratml.org>

* Update include/ensmallen_bits/ens_version.hpp

Co-authored-by: Marcus Edel <marcus.edel@fu-berlin.de>

* Switch to directly using the macro definitions

Co-authored-by: Ryan Curtin <ryan@ratml.org>
Co-authored-by: Marcus Edel <marcus.edel@fu-berlin.de>
  • Loading branch information
3 people authored Oct 30, 2020
1 parent 25d0d84 commit d53815d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Make a few tests more robust
([#228](https://github.com/mlpack/ensmallen/pull/228)).

* Add release date to version information. ([#226](https://github.com/mlpack/ensmallen/pull/226))

### ensmallen 2.14.2: "No Direction Home"
###### 2020-08-31
* Fix implementation of fonesca fleming problem function f1 and f2
Expand Down
14 changes: 13 additions & 1 deletion include/ensmallen_bits/ens_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
// (i.e. the version name will be "RC1", "RC2", etc.). Otherwise the version
// name will typically be a seemingly arbitrary set of words that does not
// contain the capitalized string "RC".
#define ENS_VERSION_NAME "No Direction Home"
#define ENS_VERSION_NAME "No Direction Home"
// Incorporate the date the version was released.
#define ENS_VERSION_YEAR "2020"
#define ENS_VERSION_MONTH "09"
#define ENS_VERSION_DAY "05"

namespace ens {

Expand All @@ -41,6 +45,14 @@ struct version

return ss.str();
}

static inline std::string date()
{
std::stringstream ss;
ss << ENS_VERSION_YEAR << '-' << ENS_VERSION_MONTH << '-' << ENS_VERSION_DAY;

return ss.str();
}
};

} // namespace ens
8 changes: 8 additions & 0 deletions scripts/ensmallen-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ new_line="ensmallen $MAJOR.$MINOR.$PATCH: \"$version_name\"";
sed -i "s/### ensmallen ?.??.?: \"???\"/### $new_line/" HISTORY.md;
sed -i "s/###### ????-??-??/###### $year-$month-$day/" HISTORY.md;

# Update date in ens_version.hpp
sed -i 's/ENS_VERSION_YEAR[ ]*\".*\"$/ENS_VERSION_YEAR \"'"$year"'\"/' \
include/ensmallen_bits/ens_version.hpp;
sed -i 's/ENS_VERSION_MONTH[ ]*\".*\"$/ENS_VERSION_MONTH \"'"$month"'\"/' \
include/ensmallen_bits/ens_version.hpp;
sed -i 's/ENS_VERSION_DAY[ ]*\".*\"$/ENS_VERSION_DAY \"'"$day"'\"/' \
include/ensmallen_bits/ens_version.hpp;

# Now, we'll do all this on a new release branch.
git checkout -b release-$MAJOR.$MINOR.$PATCH;

Expand Down

0 comments on commit d53815d

Please sign in to comment.