This commit is contained in:
Victor Vazquez 2022-06-18 01:48:18 +00:00
parent 61636bba41
commit b70563673c
6 changed files with 10752 additions and 63 deletions

View File

@ -9,51 +9,28 @@ az_vcpkg_integrate()
cmake_minimum_required (VERSION 3.13)
project(azure-template LANGUAGES CXX)
include(AzureTransportAdapters)
include(AzureBuildTargetForCI)
include(AzureVersion)
include(AzureCodeCoverage)
include(AzureDoxygen)
include(AzureGlobalCompileOptions)
include(AzureConfigRTTI)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
include(AzureVersion)
include(AzureCodeCoverage)
include(AzureTransportAdapters)
include(AzureDoxygen)
include(AzureGlobalCompileOptions)
include(AzureConfigRTTI)
include(AzureBuildTargetForCI)
# Add create_map_file function
include(CreateMapFile)
if(NOT AZ_ALL_LIBRARIES)
find_package(azure-core-cpp "1.2.0" CONFIG QUIET)
if(NOT azure-core-cpp_FOUND)
find_package(azure-core-cpp "1.2.0" REQUIRED)
endif()
endif()
find_package(azure-storage-common-cpp REQUIRED)
set(
AZURE_TEMPLATE_HEADER
inc/azure/template/dll_import_export.hpp
inc/azure/template/template_client.hpp
inc/azure/template.hpp
inc/azure/storage/blobs/rest_client.hpp
)
set(
AZURE_TEMPLATE_SOURCE
src/private/package_version.hpp
src/template_client.cpp
src/rest_client.cpp
)
add_library(azure-template ${AZURE_TEMPLATE_HEADER} ${AZURE_TEMPLATE_SOURCE})
create_per_service_target_build(template azure-template)
target_include_directories(
azure-template
@ -62,35 +39,8 @@ target_include_directories(
$<INSTALL_INTERFACE:include>
)
target_link_libraries(azure-template PUBLIC Azure::azure-core)
target_link_libraries(azure-template PUBLIC Azure::azure-core Azure::azure-storage-common)
# make sure that users can consume the project as a library.
add_library(Azure::azure-template ALIAS azure-template)
# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(template azure-template azure-template-test "tests?/*;samples?/*")
get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private/package_version.hpp")
generate_documentation(azure-template ${AZ_LIBRARY_VERSION})
az_vcpkg_export(
azure-template
TEMPLATE
"azure/template/dll_import_export.hpp"
)
az_rtti_setup(
azure-template
TEMPLATE
"azure/template/rtti.hpp"
)
if(BUILD_TESTING)
if (NOT AZ_ALL_LIBRARIES OR FETCH_SOURCE_DEPS)
include(AddGoogleTest)
enable_testing ()
endif()
# tests
add_subdirectory(test)
endif()

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
#pragma once
#include <azure/core/internal/client_options.hpp>
#include <azure/core/internal/tracing/service_tracing.hpp>
// #include <azure/core/internal/tracing/service_tracing.hpp>
#include <string>
namespace Azure { namespace Template {
@ -19,7 +19,7 @@ namespace Azure { namespace Template {
int GetValue(int key, Azure::Core::Context const& context = Azure::Core::Context{}) const;
private:
Azure::Core::Tracing::_internal::TracingContextFactory m_tracingFactory;
//Azure::Core::Tracing::_internal::TracingContextFactory m_tracingFactory;
};
}} // namespace Azure::Template

File diff suppressed because it is too large Load Diff

View File

@ -10,15 +10,15 @@
using namespace Azure::Template;
using namespace Azure::Template::_detail;
TemplateClient::TemplateClient(TemplateClientOptions const& options)
: m_tracingFactory(options, "Template", PackageVersion::ToString())
// TemplateClient::TemplateClient(TemplateClientOptions const& options)
// : m_tracingFactory(options, "Template", PackageVersion::ToString())
{
}
// {
// }
int TemplateClient::GetValue(int key, Azure::Core::Context const& context) const
int TemplateClient::GetValue(int key, Azure::Core::Context const&) const
{
auto tracingContext = m_tracingFactory.CreateTracingContext("GetValue", context);
// auto tracingContext = m_tracingFactory.CreateTracingContext("GetValue", context);
try
{
@ -60,7 +60,7 @@ int TemplateClient::GetValue(int key, Azure::Core::Context const& context) const
}
catch (std::exception const& e)
{
tracingContext.Span.AddEvent(e);
// tracingContext.Span.AddEvent(e);
throw;
}
}

View File

@ -5,6 +5,9 @@
{
"name": "azure-core-cpp"
},
{
"name": "azure-storage-common-cpp"
},
{
"name": "vcpkg-cmake",
"host": true