Version strings (#1276)

Moves package version strings in the details namespace.
Fixes #1249 

# Pull Request Checklist

Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly:

See the detailed list in the [contributing guide](https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md#pull-requests).

- [x] [C++ Guidelines](https://azure.github.io/azure-sdk/cpp_introduction.html)
- [x] Doxygen docs
- [x] Unit tests
- [x] No unwanted commits/changes
- [x] Descriptive title/description
  - [x] PR is single purpose
  - [x] Related issue listed
- [x] Comments in source
- [x] No typos
- [x] Update changelog
- [x] Not work-in-progress
- [x] External references or docs updated
- [x] Self review of PR done
- [x] Any breaking changes?
This commit is contained in:
Rick Winter 2021-01-07 00:07:46 -08:00 committed by GitHub
parent 1897f9ee85
commit 36fbcd9cee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 32 additions and 13 deletions

View File

@ -21,7 +21,7 @@
- Renamed methods from `Azure::Core::Context`.
- `IsCanceled` to `IsCancelled`
- `ThrowIfCanceled` to `ThrowIfCancelled`.
- Moved `Azure::Core::Version`, defined in `azure/core/version.hpp` to `Azure::Core::Details` namespace in `azure/core/version.hpp` header.
### Bug Fixes

View File

@ -15,7 +15,7 @@
#define AZURE_CORE_VERSION_PATCH 0
#define AZURE_CORE_VERSION_PRERELEASE "beta.4"
namespace Azure { namespace Core {
namespace Azure { namespace Core { namespace Details {
/**
* @brief Provides version information.
@ -46,7 +46,7 @@ namespace Azure { namespace Core {
static constexpr const char* secret = AZURE_CORE_VERSION_PRERELEASE;
};
}} // namespace Azure::Core
}}} // namespace Azure::Core::Details
#undef AZURE_CORE_VERSION_MAJOR
#undef AZURE_CORE_VERSION_MINOR

View File

@ -6,7 +6,7 @@
#include <sstream>
#include <string>
using namespace Azure::Core;
using namespace Azure::Core::Details;
const std::string Version::PreRelease = secret;

View File

@ -22,7 +22,7 @@ TEST(Logging, simplifiedHeader)
1, 1, Azure::Core::Http::HttpStatusCode::Accepted, "phrase"));
EXPECT_NO_THROW(Azure::Core::Strings::ToLower("A"));
EXPECT_NO_THROW(Azure::Core::Uuid::CreateUuid());
EXPECT_NO_THROW(Azure::Core::Version::VersionString());
EXPECT_NO_THROW(Azure::Core::Details::Version::VersionString());
{
std::vector<uint8_t> buffer(10);

View File

@ -2,6 +2,10 @@
## 1.0.0-beta.2 (Unreleased)
### Breaking Changes
- Moved `Azure::Identity::Version`, defined in `azure/identity/version.hpp` to `Azure::Identity::Details` namespace in `azure/identity/version.hpp` header.
### Other changes and Improvements
- Add high-level and simplified identity.hpp file for simpler include experience for customers.

View File

@ -15,7 +15,7 @@
#define AZURE_IDENTITY_VERSION_PATCH 0
#define AZURE_IDENTITY_VERSION_PRERELEASE "beta.2"
namespace Azure { namespace Identity {
namespace Azure { namespace Identity { namespace Details {
/**
* @brief Provides version information.
@ -46,7 +46,7 @@ namespace Azure { namespace Identity {
static constexpr char const* secret = AZURE_IDENTITY_VERSION_PRERELEASE;
};
}} // namespace Azure::Identity
}}} // namespace Azure::Identity::Details
#undef AZURE_IDENTITY_VERSION_MAJOR
#undef AZURE_IDENTITY_VERSION_MINOR

View File

@ -6,7 +6,7 @@
#include <sstream>
#include <string>
using namespace Azure::Identity;
using namespace Azure::Identity::Details;
std::string const Version::PreRelease = secret;

View File

@ -10,14 +10,29 @@
#define AZURE_TEMPLATE_VERSION_PATCH 0
#define AZURE_TEMPLATE_VERSION_PRERELEASE "beta.8"
namespace Azure { namespace Template {
namespace Azure { namespace Template { namespace Details {
/**
* @brief Provides version information.
*/
class Version {
public:
/// Major numeric identifier.
static constexpr int Major = AZURE_TEMPLATE_VERSION_MAJOR;
/// Minor numeric identifier.
static constexpr int Minor = AZURE_TEMPLATE_VERSION_MINOR;
/// Patch numeric identifier.
static constexpr int Patch = AZURE_TEMPLATE_VERSION_PATCH;
/// Optional pre-release identifier. SDK is in a pre-release state when not empty.
static std::string const PreRelease;
/**
* @brief The version in string format used for telemetry following the `semver.org` standard
* (https://semver.org).
*/
static std::string VersionString();
private:
@ -26,7 +41,7 @@ namespace Azure { namespace Template {
static constexpr const char* secret = AZURE_TEMPLATE_VERSION_PRERELEASE;
};
}} // namespace Azure::Template
}}} // namespace Azure::Template::Details
#undef AZURE_TEMPLATE_VERSION_MAJOR
#undef AZURE_TEMPLATE_VERSION_MINOR

View File

@ -8,4 +8,4 @@
using namespace Azure::Template;
std::string const TemplateClient::ClientVersion() { return Version::VersionString(); }
std::string const TemplateClient::ClientVersion() { return Details::Version::VersionString(); }

View File

@ -5,11 +5,11 @@
#include <sstream>
#include <string>
using namespace Azure::Template;
using namespace Azure::Template::Details;
const std::string Version::PreRelease = secret;
std::string Azure::Template::Version::VersionString()
std::string Version::VersionString()
{
static const std::string versionString = [] {
std::string version;