storage service starts using version.hpp (#845)

* version.hpp

* 12

* fix
This commit is contained in:
JinmingHu 2020-10-26 10:43:13 +08:00 коммит произвёл GitHub
Родитель 26ad18c6e3
Коммит 02f5869559
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
28 изменённых файлов: 310 добавлений и 119 удалений

Просмотреть файл

@ -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})

Просмотреть файл

@ -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/<package-name>/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})

Просмотреть файл

@ -0,0 +1,61 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
/**
* @file
* @brief Provides version information.
*/
#pragma once
#include <cstring>
#include <string>
#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

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -132,7 +132,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -174,7 +174,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -74,7 +74,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -99,7 +99,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -70,7 +70,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -97,7 +97,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -65,7 +65,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -91,7 +91,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Details::c_BlobServicePackageName, BlobServiceVersion));
Details::c_BlobServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -1 +0,0 @@
1.0.0-beta.4

Просмотреть файл

@ -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/<package-name>/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})

Просмотреть файл

@ -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

Просмотреть файл

@ -0,0 +1,61 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
/**
* @file
* @brief Provides version information.
*/
#pragma once
#include <cstring>
#include <string>
#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

Просмотреть файл

@ -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

Просмотреть файл

@ -1 +0,0 @@
1.0.0-beta.3

Просмотреть файл

@ -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/<package-name>/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})

Просмотреть файл

@ -0,0 +1,61 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
/**
* @file
* @brief Provides version information.
*/
#pragma once
#include <cstring>
#include <string>
#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

Просмотреть файл

@ -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 <limits>
#include <utility> //std::pair
@ -50,7 +50,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -80,7 +80,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -109,7 +109,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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 <limits>
#include <utility> //std::pair
@ -128,7 +128,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -159,7 +159,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -187,7 +187,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -106,7 +106,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -139,7 +139,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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 <limits>
#include <utility> //std::pair
@ -112,7 +112,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -143,7 +143,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -172,7 +172,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -112,7 +112,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -141,7 +141,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_DatalakeServicePackageName, DataLakeServiceVersion));
Azure::Storage::Details::c_DatalakeServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -1 +0,0 @@
1.0.0-beta.4

Просмотреть файл

@ -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/<package-name>/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})

Просмотреть файл

@ -0,0 +1,61 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
/**
* @file
* @brief Provides version information.
*/
#pragma once
#include <cstring>
#include <string>
#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

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -71,7 +71,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -95,7 +95,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -72,7 +72,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -98,7 +98,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -75,7 +75,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -99,7 +99,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -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<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -67,7 +67,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{
@ -91,7 +91,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> policies;
policies.emplace_back(std::make_unique<Azure::Core::Http::TelemetryPolicy>(
Azure::Storage::Details::c_FileServicePackageName, FileServiceVersion));
Azure::Storage::Details::c_FileServicePackageName, Version::VersionString()));
policies.emplace_back(std::make_unique<Azure::Core::Http::RequestIdPolicy>());
for (const auto& p : options.PerOperationPolicies)
{

Просмотреть файл

@ -1 +0,0 @@
1.0.0-beta.4