From 02f58695592e1634db76617ee16320c225c64241 Mon Sep 17 00:00:00 2001 From: JinmingHu Date: Mon, 26 Oct 2020 10:43:13 +0800 Subject: [PATCH] storage service starts using version.hpp (#845) * version.hpp * 12 * fix --- cmake-modules/az_version.cmake | 2 +- .../azure-storage-blobs/CMakeLists.txt | 12 +--- .../inc/azure/storage/blobs/version.hpp | 61 +++++++++++++++++++ .../src/blob_batch_client.cpp | 8 +-- .../azure-storage-blobs/src/blob_client.cpp | 8 +-- .../src/blob_container_client.cpp | 8 +-- .../src/blob_service_client.cpp | 8 +-- sdk/storage/azure-storage-blobs/version.txt | 1 - .../azure-storage-common/CMakeLists.txt | 15 ++--- .../azure/storage/common/storage_version.hpp | 13 ---- .../inc/azure/storage/common/version.hpp | 61 +++++++++++++++++++ .../src/storage_version.cpp | 11 ---- sdk/storage/azure-storage-common/version.txt | 1 - .../CMakeLists.txt | 12 +--- .../azure/storage/files/datalake/version.hpp | 61 +++++++++++++++++++ .../src/datalake_directory_client.cpp | 8 +-- .../src/datalake_file_client.cpp | 8 +-- .../src/datalake_file_system_client.cpp | 8 +-- .../src/datalake_path_client.cpp | 8 +-- .../src/datalake_service_client.cpp | 8 +-- .../azure-storage-files-datalake/version.txt | 1 - .../azure-storage-files-shares/CMakeLists.txt | 12 +--- .../azure/storage/files/shares/version.hpp | 61 +++++++++++++++++++ .../src/share_client.cpp | 8 +-- .../src/share_directory_client.cpp | 8 +-- .../src/share_file_client.cpp | 8 +-- .../src/share_service_client.cpp | 8 +-- .../azure-storage-files-shares/version.txt | 1 - 28 files changed, 310 insertions(+), 119 deletions(-) create mode 100644 sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/version.hpp delete mode 100644 sdk/storage/azure-storage-blobs/version.txt delete mode 100644 sdk/storage/azure-storage-common/inc/azure/storage/common/storage_version.hpp create mode 100644 sdk/storage/azure-storage-common/inc/azure/storage/common/version.hpp delete mode 100644 sdk/storage/azure-storage-common/src/storage_version.cpp delete mode 100644 sdk/storage/azure-storage-common/version.txt create mode 100644 sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/version.hpp delete mode 100644 sdk/storage/azure-storage-files-datalake/version.txt create mode 100644 sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/version.hpp delete mode 100644 sdk/storage/azure-storage-files-shares/version.txt diff --git a/cmake-modules/az_version.cmake b/cmake-modules/az_version.cmake index 9bbe0c434..276b39b23 100644 --- a/cmake-modules/az_version.cmake +++ b/cmake-modules/az_version.cmake @@ -14,7 +14,7 @@ function(get_az_version VERSION_HPP_FILE) string( REGEX MATCH - "#define AZURE_[A-Z]+_VERSION_MAJOR ([0-9]+)[ \t\r\n]+#define AZURE_[A-Z]+_VERSION_MINOR ([0-9]+)[ \t\r\n]+#define AZURE_[A-Z]+_VERSION_PATCH ([0-9]+)[ \t\r\n]+#define AZURE_[A-Z]+_VERSION_PRERELEASE \"([a-zA-Z0-9.]*)\"" + "#define AZURE_[A-Z_]+_VERSION_MAJOR ([0-9]+)[ \t\r\n]+#define AZURE_[A-Z_]+_VERSION_MINOR ([0-9]+)[ \t\r\n]+#define AZURE_[A-Z_]+_VERSION_PATCH ([0-9]+)[ \t\r\n]+#define AZURE_[A-Z_]+_VERSION_PRERELEASE \"([a-zA-Z0-9.]*)\"" VERSION_PARTS ${VERSION_H_CONTENT}) diff --git a/sdk/storage/azure-storage-blobs/CMakeLists.txt b/sdk/storage/azure-storage-blobs/CMakeLists.txt index f3294ba57..5ec754718 100644 --- a/sdk/storage/azure-storage-blobs/CMakeLists.txt +++ b/sdk/storage/azure-storage-blobs/CMakeLists.txt @@ -16,6 +16,7 @@ set (AZURE_STORAGE_BLOB_HEADER inc/azure/storage/blobs/block_blob_client.hpp inc/azure/storage/blobs/page_blob_client.hpp inc/azure/storage/blobs/protocol/blob_rest_client.hpp + inc/azure/storage/blobs/version.hpp ) set (AZURE_STORAGE_BLOB_SOURCE @@ -33,14 +34,7 @@ add_library(azure-storage-blobs ${AZURE_STORAGE_BLOB_HEADER} ${AZURE_STORAGE_BLO target_include_directories(azure-storage-blobs PUBLIC inc) target_link_libraries(azure-storage-blobs azure::storage::common) -# TODO: Do not read from version.txt, use version.hpp and replace this file -# command with: -# get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/inc/azure/storage//version.hpp") -# Access the variable from this function using ${AZ_LIBRARY_VERSION} -# Look at the CMakeLists.txt for template package for example usage -file(READ version.txt AZURE_STORAGE_BLOBS_PACKAGE_VERSION) -target_compile_definitions(azure-storage-common PUBLIC AZURE_STORAGE_BLOBS_PACKAGE_VERSION="${AZURE_STORAGE_BLOBS_PACKAGE_VERSION}") -message("Azure Storage Blobs Package Version ${AZURE_STORAGE_BLOBS_PACKAGE_VERSION}") +get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/inc/azure/storage/blobs/version.hpp") add_library(azure::storage::blobs ALIAS azure-storage-blobs) @@ -73,4 +67,4 @@ target_sources( ) target_link_libraries(azure-storage-sample PUBLIC azure::storage::blobs) -generate_documentation(azure-storage-blobs ${AZURE_STORAGE_BLOBS_PACKAGE_VERSION}) +generate_documentation(azure-storage-blobs ${AZ_LIBRARY_VERSION}) diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/version.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/version.hpp new file mode 100644 index 000000000..72e06d06f --- /dev/null +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/version.hpp @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @file + * @brief Provides version information. + */ + +#pragma once + +#include +#include + +#define AZURE_STORAGE_BLOBS_VERSION_MAJOR 12 +#define AZURE_STORAGE_BLOBS_VERSION_MINOR 0 +#define AZURE_STORAGE_BLOBS_VERSION_PATCH 0 +#define AZURE_STORAGE_BLOBS_VERSION_PRERELEASE "beta.4" + +namespace Azure { namespace Storage { namespace Blobs { + + /** + * @brief Provides version information. + */ + struct Version + { + public: + /// Major numeric identifier. + constexpr static int Major = AZURE_STORAGE_BLOBS_VERSION_MAJOR; + + /// Minor numeric identifier. + constexpr static int Minor = AZURE_STORAGE_BLOBS_VERSION_MINOR; + + /// Patch numeric identifier. + constexpr static int Patch = AZURE_STORAGE_BLOBS_VERSION_PATCH; + + /// Optional pre-release identifier. SDK is in a pre-release state when not empty. + constexpr static const char* PreRelease = AZURE_STORAGE_BLOBS_VERSION_PRERELEASE; + + /** + * @brief The version in string format used for telemetry following the `semver.org` standard + * (https://semver.org). + */ + static std::string VersionString() + { + std::string versionString + = std::to_string(Major) + "." + std::to_string(Minor) + "." + std::to_string(Patch); + if (std::strlen(PreRelease) != 0) + { + versionString += "-"; + versionString += PreRelease; + } + return versionString; + } + }; + +}}} // namespace Azure::Storage::Blobs + +#undef AZURE_STORAGE_BLOBS_VERSION_MAJOR +#undef AZURE_STORAGE_BLOBS_VERSION_MINOR +#undef AZURE_STORAGE_BLOBS_VERSION_PATCH +#undef AZURE_STORAGE_BLOBS_VERSION_PRERELEASE diff --git a/sdk/storage/azure-storage-blobs/src/blob_batch_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_batch_client.cpp index ddbd4a38f..a94201c54 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_batch_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_batch_client.cpp @@ -9,10 +9,10 @@ #include "azure/core/credentials.hpp" #include "azure/core/http/curl/curl.hpp" +#include "azure/storage/blobs/version.hpp" #include "azure/storage/common/constants.hpp" #include "azure/storage/common/shared_key_policy.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" namespace Azure { namespace Storage { namespace Blobs { @@ -91,7 +91,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -132,7 +132,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -174,7 +174,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-blobs/src/blob_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_client.cpp index 920fa6912..c508cc706 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_client.cpp @@ -8,6 +8,7 @@ #include "azure/storage/blobs/append_blob_client.hpp" #include "azure/storage/blobs/block_blob_client.hpp" #include "azure/storage/blobs/page_blob_client.hpp" +#include "azure/storage/blobs/version.hpp" #include "azure/storage/common/concurrent_transfer.hpp" #include "azure/storage/common/constants.hpp" #include "azure/storage/common/file_io.hpp" @@ -15,7 +16,6 @@ #include "azure/storage/common/shared_key_policy.hpp" #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" namespace Azure { namespace Storage { namespace Blobs { @@ -48,7 +48,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -74,7 +74,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -99,7 +99,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp index 8e3355c8b..bec50f12d 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp @@ -8,11 +8,11 @@ #include "azure/storage/blobs/append_blob_client.hpp" #include "azure/storage/blobs/block_blob_client.hpp" #include "azure/storage/blobs/page_blob_client.hpp" +#include "azure/storage/blobs/version.hpp" #include "azure/storage/common/constants.hpp" #include "azure/storage/common/shared_key_policy.hpp" #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" namespace Azure { namespace Storage { namespace Blobs { @@ -44,7 +44,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -70,7 +70,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -97,7 +97,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp index 5971d3d19..7ef04d5af 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp @@ -5,11 +5,11 @@ #include "azure/core/credentials.hpp" #include "azure/core/http/curl/curl.hpp" +#include "azure/storage/blobs/version.hpp" #include "azure/storage/common/constants.hpp" #include "azure/storage/common/shared_key_policy.hpp" #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" namespace Azure { namespace Storage { namespace Blobs { @@ -39,7 +39,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -65,7 +65,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -91,7 +91,7 @@ namespace Azure { namespace Storage { namespace Blobs { { std::vector> policies; policies.emplace_back(std::make_unique( - Details::c_BlobServicePackageName, BlobServiceVersion)); + Details::c_BlobServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-blobs/version.txt b/sdk/storage/azure-storage-blobs/version.txt deleted file mode 100644 index 4740ad788..000000000 --- a/sdk/storage/azure-storage-blobs/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.0.0-beta.4 \ No newline at end of file diff --git a/sdk/storage/azure-storage-common/CMakeLists.txt b/sdk/storage/azure-storage-common/CMakeLists.txt index c0ee54699..330f265b7 100644 --- a/sdk/storage/azure-storage-common/CMakeLists.txt +++ b/sdk/storage/azure-storage-common/CMakeLists.txt @@ -18,7 +18,7 @@ set(AZURE_STORAGE_COMMON_HEADER inc/azure/storage/common/storage_error.hpp inc/azure/storage/common/storage_per_retry_policy.hpp inc/azure/storage/common/storage_retry_policy.hpp - inc/azure/storage/common/storage_version.hpp + inc/azure/storage/common/version.hpp inc/azure/storage/common/xml_wrapper.hpp ) @@ -33,7 +33,6 @@ set(AZURE_STORAGE_COMMON_SOURCE src/storage_error.cpp src/storage_per_retry_policy.cpp src/storage_retry_policy.cpp - src/storage_version.cpp src/xml_wrapper.cpp ) @@ -55,14 +54,8 @@ else() target_link_libraries(azure-storage-common OpenSSL::SSL OpenSSL::Crypto) endif() -# TODO: Do not read from version.txt, use version.hpp and replace this file -# command with: -# get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/inc/azure/storage//version.hpp") -# Access the variable from this function using ${AZ_LIBRARY_VERSION} -# Look at the CMakeLists.txt for template package for example usage -file(READ version.txt AZURE_STORAGE_COMMON_PACKAGE_VERSION) -target_compile_definitions(azure-storage-common PUBLIC AZURE_STORAGE_COMMON_PACKAGE_VERSION="${AZURE_STORAGE_COMMON_PACKAGE_VERSION}") -message("Azure Storage Common Package Version ${AZURE_STORAGE_COMMON_PACKAGE_VERSION}") + +get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/inc/azure/storage/common/version.hpp") add_library(azure::storage::common ALIAS azure-storage-common) @@ -90,4 +83,4 @@ target_sources( target_include_directories(azure-storage-sample PUBLIC sample) -generate_documentation(azure-storage-common ${AZURE_STORAGE_COMMON_PACKAGE_VERSION}) +generate_documentation(azure-storage-common ${AZ_LIBRARY_VERSION}) diff --git a/sdk/storage/azure-storage-common/inc/azure/storage/common/storage_version.hpp b/sdk/storage/azure-storage-common/inc/azure/storage/common/storage_version.hpp deleted file mode 100644 index 65d106c13..000000000 --- a/sdk/storage/azure-storage-common/inc/azure/storage/common/storage_version.hpp +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -#pragma once - -namespace Azure { namespace Storage { - - extern const char* CommonComponentVersion; - extern const char* BlobServiceVersion; - extern const char* DataLakeServiceVersion; - extern const char* FileServiceVersion; - -}} // namespace Azure::Storage diff --git a/sdk/storage/azure-storage-common/inc/azure/storage/common/version.hpp b/sdk/storage/azure-storage-common/inc/azure/storage/common/version.hpp new file mode 100644 index 000000000..4fe63898d --- /dev/null +++ b/sdk/storage/azure-storage-common/inc/azure/storage/common/version.hpp @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @file + * @brief Provides version information. + */ + +#pragma once + +#include +#include + +#define AZURE_STORAGE_COMMON_VERSION_MAJOR 12 +#define AZURE_STORAGE_COMMON_VERSION_MINOR 0 +#define AZURE_STORAGE_COMMON_VERSION_PATCH 0 +#define AZURE_STORAGE_COMMON_VERSION_PRERELEASE "beta.4" + +namespace Azure { namespace Storage { namespace Common { + + /** + * @brief Provides version information. + */ + struct Version + { + public: + /// Major numeric identifier. + constexpr static int Major = AZURE_STORAGE_COMMON_VERSION_MAJOR; + + /// Minor numeric identifier. + constexpr static int Minor = AZURE_STORAGE_COMMON_VERSION_MINOR; + + /// Patch numeric identifier. + constexpr static int Patch = AZURE_STORAGE_COMMON_VERSION_PATCH; + + /// Optional pre-release identifier. SDK is in a pre-release state when not empty. + constexpr static const char* PreRelease = AZURE_STORAGE_COMMON_VERSION_PRERELEASE; + + /** + * @brief The version in string format used for telemetry following the `semver.org` standard + * (https://semver.org). + */ + static std::string VersionString() + { + std::string versionString + = std::to_string(Major) + "." + std::to_string(Minor) + "." + std::to_string(Patch); + if (std::strlen(PreRelease) != 0) + { + versionString += "-"; + versionString += PreRelease; + } + return versionString; + } + }; + +}}} // namespace Azure::Storage::Common + +#undef AZURE_STORAGE_COMMON_VERSION_MAJOR +#undef AZURE_STORAGE_COMMON_VERSION_MINOR +#undef AZURE_STORAGE_COMMON_VERSION_PATCH +#undef AZURE_STORAGE_COMMON_VERSION_PRERELEASE diff --git a/sdk/storage/azure-storage-common/src/storage_version.cpp b/sdk/storage/azure-storage-common/src/storage_version.cpp deleted file mode 100644 index 061de3750..000000000 --- a/sdk/storage/azure-storage-common/src/storage_version.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// SPDX-License-Identifier: MIT - -namespace Azure { namespace Storage { - - const char* CommonComponentVersion = AZURE_STORAGE_COMMON_PACKAGE_VERSION; - const char* BlobServiceVersion = AZURE_STORAGE_BLOBS_PACKAGE_VERSION; - const char* DataLakeServiceVersion = AZURE_STORAGE_FILES_DATALAKE_PACKAGE_VERSION; - const char* FileServiceVersion = AZURE_STORAGE_FILES_SHARES_PACKAGE_VERSION; - -}} // namespace Azure::Storage diff --git a/sdk/storage/azure-storage-common/version.txt b/sdk/storage/azure-storage-common/version.txt deleted file mode 100644 index ffddd24fa..000000000 --- a/sdk/storage/azure-storage-common/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.0.0-beta.3 \ No newline at end of file diff --git a/sdk/storage/azure-storage-files-datalake/CMakeLists.txt b/sdk/storage/azure-storage-files-datalake/CMakeLists.txt index dd79e05b9..4e216d78b 100644 --- a/sdk/storage/azure-storage-files-datalake/CMakeLists.txt +++ b/sdk/storage/azure-storage-files-datalake/CMakeLists.txt @@ -15,6 +15,7 @@ set (AZURE_STORAGE_DATALAKE_HEADER inc/azure/storage/files/datalake/datalake_service_client.hpp inc/azure/storage/files/datalake/datalake_utilities.hpp inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp + inc/azure/storage/files/datalake/version.hpp ) set (AZURE_STORAGE_DATALAKE_SOURCE @@ -32,14 +33,7 @@ add_library(azure-storage-files-datalake ${AZURE_STORAGE_DATALAKE_HEADER} ${AZUR target_include_directories(azure-storage-files-datalake PUBLIC inc) target_link_libraries(azure-storage-files-datalake azure-storage-blobs) -# TODO: Do not read from version.txt, use version.hpp and replace this file -# command with: -# get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/inc/azure/storage//version.hpp") -# Access the variable from this function using ${AZ_LIBRARY_VERSION} -# Look at the CMakeLists.txt for template package for example usage -file(READ version.txt AZURE_STORAGE_FILES_DATALAKE_PACKAGE_VERSION) -target_compile_definitions(azure-storage-common PUBLIC AZURE_STORAGE_FILES_DATALAKE_PACKAGE_VERSION="${AZURE_STORAGE_FILES_DATALAKE_PACKAGE_VERSION}") -message("Azure Storage Files DataLake Package Version ${AZURE_STORAGE_FILES_DATALAKE_PACKAGE_VERSION}") +get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/inc/azure/storage/files/datalake/version.hpp") add_library(azure::storage::files::datalake ALIAS azure-storage-files-datalake) @@ -69,4 +63,4 @@ target_sources( ) target_link_libraries(azure-storage-sample PUBLIC azure::storage::files::datalake) -generate_documentation(azure-storage-files-datalake ${AZURE_STORAGE_FILES_DATALAKE_PACKAGE_VERSION}) +generate_documentation(azure-storage-files-datalake ${AZ_LIBRARY_VERSION}) diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/version.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/version.hpp new file mode 100644 index 000000000..2fb3ad648 --- /dev/null +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/version.hpp @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @file + * @brief Provides version information. + */ + +#pragma once + +#include +#include + +#define AZURE_STORAGE_FILES_DATALAKE_VERSION_MAJOR 12 +#define AZURE_STORAGE_FILES_DATALAKE_VERSION_MINOR 0 +#define AZURE_STORAGE_FILES_DATALAKE_VERSION_PATCH 0 +#define AZURE_STORAGE_FILES_DATALAKE_VERSION_PRERELEASE "beta.4" + +namespace Azure { namespace Storage { namespace Files { namespace DataLake { + + /** + * @brief Provides version information. + */ + struct Version + { + public: + /// Major numeric identifier. + constexpr static int Major = AZURE_STORAGE_FILES_DATALAKE_VERSION_MAJOR; + + /// Minor numeric identifier. + constexpr static int Minor = AZURE_STORAGE_FILES_DATALAKE_VERSION_MINOR; + + /// Patch numeric identifier. + constexpr static int Patch = AZURE_STORAGE_FILES_DATALAKE_VERSION_PATCH; + + /// Optional pre-release identifier. SDK is in a pre-release state when not empty. + constexpr static const char* PreRelease = AZURE_STORAGE_FILES_DATALAKE_VERSION_PRERELEASE; + + /** + * @brief The version in string format used for telemetry following the `semver.org` standard + * (https://semver.org). + */ + static std::string VersionString() + { + std::string versionString + = std::to_string(Major) + "." + std::to_string(Minor) + "." + std::to_string(Patch); + if (std::strlen(PreRelease) != 0) + { + versionString += "-"; + versionString += PreRelease; + } + return versionString; + } + }; + +}}}} // namespace Azure::Storage::Files::DataLake + +#undef AZURE_STORAGE_FILES_DATALAKE_VERSION_MAJOR +#undef AZURE_STORAGE_FILES_DATALAKE_VERSION_MINOR +#undef AZURE_STORAGE_FILES_DATALAKE_VERSION_PATCH +#undef AZURE_STORAGE_FILES_DATALAKE_VERSION_PRERELEASE diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp index e87980c82..affb6cfa5 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp @@ -11,9 +11,9 @@ #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" #include "azure/storage/common/storage_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" #include "azure/storage/files/datalake/datalake_file_client.hpp" #include "azure/storage/files/datalake/datalake_utilities.hpp" +#include "azure/storage/files/datalake/version.hpp" #include #include //std::pair @@ -50,7 +50,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -80,7 +80,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -109,7 +109,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp index 720e41997..e7241485d 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp @@ -11,8 +11,8 @@ #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" #include "azure/storage/common/storage_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" #include "azure/storage/files/datalake/datalake_utilities.hpp" +#include "azure/storage/files/datalake/version.hpp" #include #include //std::pair @@ -128,7 +128,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -159,7 +159,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -187,7 +187,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp index dc4d5c813..e734e18cb 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp @@ -12,11 +12,11 @@ #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" #include "azure/storage/common/storage_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" #include "azure/storage/files/datalake/datalake_directory_client.hpp" #include "azure/storage/files/datalake/datalake_file_client.hpp" #include "azure/storage/files/datalake/datalake_path_client.hpp" #include "azure/storage/files/datalake/datalake_utilities.hpp" +#include "azure/storage/files/datalake/version.hpp" namespace Azure { namespace Storage { namespace Files { namespace DataLake { namespace { @@ -72,7 +72,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -106,7 +106,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -139,7 +139,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp index 75a8ee7b0..4f5d61280 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp @@ -11,8 +11,8 @@ #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" #include "azure/storage/common/storage_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" #include "azure/storage/files/datalake/datalake_utilities.hpp" +#include "azure/storage/files/datalake/version.hpp" #include #include //std::pair @@ -112,7 +112,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -143,7 +143,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -172,7 +172,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp index 642a2c1d8..5a8d8d125 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp @@ -12,9 +12,9 @@ #include "azure/storage/common/storage_credential.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" #include "azure/storage/common/storage_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" #include "azure/storage/files/datalake/datalake_file_system_client.hpp" #include "azure/storage/files/datalake/datalake_utilities.hpp" +#include "azure/storage/files/datalake/version.hpp" namespace Azure { namespace Storage { namespace Files { namespace DataLake { namespace { @@ -80,7 +80,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -112,7 +112,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -141,7 +141,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion)); + Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-files-datalake/version.txt b/sdk/storage/azure-storage-files-datalake/version.txt deleted file mode 100644 index 4740ad788..000000000 --- a/sdk/storage/azure-storage-files-datalake/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.0.0-beta.4 \ No newline at end of file diff --git a/sdk/storage/azure-storage-files-shares/CMakeLists.txt b/sdk/storage/azure-storage-files-shares/CMakeLists.txt index 3955009cc..c6e86d3b7 100644 --- a/sdk/storage/azure-storage-files-shares/CMakeLists.txt +++ b/sdk/storage/azure-storage-files-shares/CMakeLists.txt @@ -15,6 +15,7 @@ set (AZURE_STORAGE_SHARES_HEADER inc/azure/storage/files/shares/share_responses.hpp inc/azure/storage/files/shares/share_sas_builder.hpp inc/azure/storage/files/shares/share_service_client.hpp + inc/azure/storage/files/shares/version.hpp ) set (AZURE_STORAGE_SHARES_SOURCE @@ -29,14 +30,7 @@ add_library(azure-storage-files-shares ${AZURE_STORAGE_SHARES_HEADER} ${AZURE_ST target_include_directories(azure-storage-files-shares PUBLIC inc) target_link_libraries(azure-storage-files-shares azure-storage-common) -# TODO: Do not read from version.txt, use version.hpp and replace this file -# command with: -# get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/inc/azure/storage//version.hpp") -# Access the variable from this function using ${AZ_LIBRARY_VERSION} -# Look at the CMakeLists.txt for template package for example usage -file(READ version.txt AZURE_STORAGE_FILES_SHARES_PACKAGE_VERSION) -target_compile_definitions(azure-storage-common PUBLIC AZURE_STORAGE_FILES_SHARES_PACKAGE_VERSION="${AZURE_STORAGE_FILES_SHARES_PACKAGE_VERSION}") -message("Azure Storage Files Shares Package Version ${AZURE_STORAGE_FILES_SHARES_PACKAGE_VERSION}") +get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/inc/azure/storage/files/shares/version.hpp") add_library(azure::storage::files::shares ALIAS azure-storage-files-shares) @@ -63,4 +57,4 @@ target_sources( ) target_link_libraries(azure-storage-sample PUBLIC azure::storage::files::shares) -generate_documentation(azure-storage-files-shares ${AZURE_STORAGE_FILES_SHARES_PACKAGE_VERSION}) +generate_documentation(azure-storage-files-shares ${AZ_LIBRARY_VERSION}) diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/version.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/version.hpp new file mode 100644 index 000000000..7c0001727 --- /dev/null +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/version.hpp @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @file + * @brief Provides version information. + */ + +#pragma once + +#include +#include + +#define AZURE_STORAGE_FILES_SHARES_VERSION_MAJOR 12 +#define AZURE_STORAGE_FILES_SHARES_VERSION_MINOR 0 +#define AZURE_STORAGE_FILES_SHARES_VERSION_PATCH 0 +#define AZURE_STORAGE_FILES_SHARES_VERSION_PRERELEASE "beta.4" + +namespace Azure { namespace Storage { namespace Files { namespace Shares { + + /** + * @brief Provides version information. + */ + struct Version + { + public: + /// Major numeric identifier. + constexpr static int Major = AZURE_STORAGE_FILES_SHARES_VERSION_MAJOR; + + /// Minor numeric identifier. + constexpr static int Minor = AZURE_STORAGE_FILES_SHARES_VERSION_MINOR; + + /// Patch numeric identifier. + constexpr static int Patch = AZURE_STORAGE_FILES_SHARES_VERSION_PATCH; + + /// Optional pre-release identifier. SDK is in a pre-release state when not empty. + constexpr static const char* PreRelease = AZURE_STORAGE_FILES_SHARES_VERSION_PRERELEASE; + + /** + * @brief The version in string format used for telemetry following the `semver.org` standard + * (https://semver.org). + */ + static std::string VersionString() + { + std::string versionString + = std::to_string(Major) + "." + std::to_string(Minor) + "." + std::to_string(Patch); + if (std::strlen(PreRelease) != 0) + { + versionString += "-"; + versionString += PreRelease; + } + return versionString; + } + }; + +}}}} // namespace Azure::Storage::Files::Shares + +#undef AZURE_STORAGE_FILES_SHARES_VERSION_MAJOR +#undef AZURE_STORAGE_FILES_SHARES_VERSION_MINOR +#undef AZURE_STORAGE_FILES_SHARES_VERSION_PATCH +#undef AZURE_STORAGE_FILES_SHARES_VERSION_PRERELEASE diff --git a/sdk/storage/azure-storage-files-shares/src/share_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_client.cpp index a598c3760..ab8eaadbb 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_client.cpp @@ -11,9 +11,9 @@ #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" #include "azure/storage/common/storage_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" #include "azure/storage/files/shares/share_directory_client.hpp" #include "azure/storage/files/shares/share_file_client.hpp" +#include "azure/storage/files/shares/version.hpp" namespace Azure { namespace Storage { namespace Files { namespace Shares { @@ -45,7 +45,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -71,7 +71,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -95,7 +95,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp index 5c8453095..9d80fd13e 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp @@ -11,8 +11,8 @@ #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" #include "azure/storage/common/storage_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" #include "azure/storage/files/shares/share_file_client.hpp" +#include "azure/storage/files/shares/version.hpp" namespace Azure { namespace Storage { namespace Files { namespace Shares { @@ -46,7 +46,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -72,7 +72,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -98,7 +98,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp index b45832c68..36e0dfc2c 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp @@ -14,8 +14,8 @@ #include "azure/storage/common/storage_common.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" #include "azure/storage/common/storage_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" #include "azure/storage/files/shares/share_constants.hpp" +#include "azure/storage/files/shares/version.hpp" namespace Azure { namespace Storage { namespace Files { namespace Shares { @@ -49,7 +49,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -75,7 +75,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -99,7 +99,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp index ab0a77882..dfe3141b7 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp @@ -11,8 +11,8 @@ #include "azure/storage/common/storage_credential.hpp" #include "azure/storage/common/storage_per_retry_policy.hpp" #include "azure/storage/common/storage_retry_policy.hpp" -#include "azure/storage/common/storage_version.hpp" #include "azure/storage/files/shares/share_client.hpp" +#include "azure/storage/files/shares/version.hpp" namespace Azure { namespace Storage { namespace Files { namespace Shares { ServiceClient ServiceClient::CreateFromConnectionString( @@ -41,7 +41,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -67,7 +67,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { @@ -91,7 +91,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::vector> policies; policies.emplace_back(std::make_unique( - Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion)); + Azure::Storage::Details::c_FileServicePackageName, Version::VersionString())); policies.emplace_back(std::make_unique()); for (const auto& p : options.PerOperationPolicies) { diff --git a/sdk/storage/azure-storage-files-shares/version.txt b/sdk/storage/azure-storage-files-shares/version.txt deleted file mode 100644 index 4740ad788..000000000 --- a/sdk/storage/azure-storage-files-shares/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.0.0-beta.4 \ No newline at end of file