From e7e2ea8bb5ff3e5fc8e0a8a5a9b6962a55dadbf9 Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Mon, 8 Mar 2021 10:21:25 -0800 Subject: [PATCH] Move Version out of the Details namespace (#1809) * Move Version out of the Details namespace SDKVersion strings for each package are not a detail and can be used by customers. * Add changelog --- sdk/core/azure-core/CHANGELOG.md | 1 + sdk/core/azure-core/inc/azure/core/version.hpp | 4 ++-- sdk/core/azure-core/src/version.cpp | 2 +- sdk/core/azure-core/test/ut/simplified_header.cpp | 2 +- sdk/template/azure-template/inc/azure/template/version.hpp | 4 ++-- sdk/template/azure-template/src/template_client.cpp | 2 +- sdk/template/azure-template/src/version.cpp | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 40f94b394..f5a2b5b24 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -15,6 +15,7 @@ - Renamed `NoRevoke` to `EnableCertificateRevocationListCheck` for `Azure::Core::Http::CurlTransportSSLOptions`. - Renamed `GetString()` to `ToString()` in `Azure::Core::DateTime`. - Renamed `GetUuidString()` to `ToString()` in `Azure::Core::Uuid`. +- Moved `Version` from `Azure::Core::Details` to `Azure::Core`. - Moved `BodyStream` and its derived types from `Azure::Core::Http` namespace to `Azure::IO`, and moved the `body_stream.hpp` header from `azure/core/http` to `azure/core/io`. - Moved `NullBodyStream` to internal usage only. It is not meant for public use. - Removed `LimitBodyStream`. diff --git a/sdk/core/azure-core/inc/azure/core/version.hpp b/sdk/core/azure-core/inc/azure/core/version.hpp index 5af943c14..b8bf05564 100644 --- a/sdk/core/azure-core/inc/azure/core/version.hpp +++ b/sdk/core/azure-core/inc/azure/core/version.hpp @@ -17,7 +17,7 @@ #define AZURE_CORE_VERSION_PATCH 0 #define AZURE_CORE_VERSION_PRERELEASE "beta.7" -namespace Azure { namespace Core { namespace Details { +namespace Azure { namespace Core { /** * @brief Provides version information. @@ -48,7 +48,7 @@ namespace Azure { namespace Core { namespace Details { static constexpr const char* secret = AZURE_CORE_VERSION_PRERELEASE; }; -}}} // namespace Azure::Core::Details +}} // namespace Azure::Core #undef AZURE_CORE_VERSION_MAJOR #undef AZURE_CORE_VERSION_MINOR diff --git a/sdk/core/azure-core/src/version.cpp b/sdk/core/azure-core/src/version.cpp index 7c404fa30..89ea1305b 100644 --- a/sdk/core/azure-core/src/version.cpp +++ b/sdk/core/azure-core/src/version.cpp @@ -6,7 +6,7 @@ #include #include -using namespace Azure::Core::Details; +using namespace Azure::Core; const std::string Version::PreRelease = secret; diff --git a/sdk/core/azure-core/test/ut/simplified_header.cpp b/sdk/core/azure-core/test/ut/simplified_header.cpp index 4e9600536..27fce754b 100644 --- a/sdk/core/azure-core/test/ut/simplified_header.cpp +++ b/sdk/core/azure-core/test/ut/simplified_header.cpp @@ -44,7 +44,7 @@ TEST(SimplifiedHeader, core) EXPECT_NO_THROW(Azure::Core::Uuid::CreateUuid()); EXPECT_NO_THROW(Azure::Core::RequestFailedException("foo")); EXPECT_NO_THROW(Azure::Core::OperationStatus("foo")); - EXPECT_NO_THROW(Azure::Core::Details::Version::VersionString()); + EXPECT_NO_THROW(Azure::Core::Version::VersionString()); { std::vector buffer(10); diff --git a/sdk/template/azure-template/inc/azure/template/version.hpp b/sdk/template/azure-template/inc/azure/template/version.hpp index 81614b8cc..8ff41aa2e 100644 --- a/sdk/template/azure-template/inc/azure/template/version.hpp +++ b/sdk/template/azure-template/inc/azure/template/version.hpp @@ -12,7 +12,7 @@ #define AZURE_TEMPLATE_VERSION_PATCH 0 #define AZURE_TEMPLATE_VERSION_PRERELEASE "beta.25" -namespace Azure { namespace Template { namespace Details { +namespace Azure { namespace Template { /** * @brief Provides version information. @@ -43,7 +43,7 @@ namespace Azure { namespace Template { namespace Details { static constexpr const char* secret = AZURE_TEMPLATE_VERSION_PRERELEASE; }; -}}} // namespace Azure::Template::Details +}} // namespace Azure::Template #undef AZURE_TEMPLATE_VERSION_MAJOR #undef AZURE_TEMPLATE_VERSION_MINOR diff --git a/sdk/template/azure-template/src/template_client.cpp b/sdk/template/azure-template/src/template_client.cpp index 878f18693..409e21d01 100644 --- a/sdk/template/azure-template/src/template_client.cpp +++ b/sdk/template/azure-template/src/template_client.cpp @@ -8,4 +8,4 @@ using namespace Azure::Template; -std::string const TemplateClient::ClientVersion() { return Details::Version::VersionString(); } +std::string const TemplateClient::ClientVersion() { return Version::VersionString(); } diff --git a/sdk/template/azure-template/src/version.cpp b/sdk/template/azure-template/src/version.cpp index d5176ce22..8695c78b5 100644 --- a/sdk/template/azure-template/src/version.cpp +++ b/sdk/template/azure-template/src/version.cpp @@ -5,7 +5,7 @@ #include #include -using namespace Azure::Template::Details; +using namespace Azure::Template; const std::string Version::PreRelease = secret;