azure-sdk-for-cpp/cmake-modules/FolderList.cmake
George Arama 20d9364a3d
Storage tables implementation (#5137)
* dss

* first pass at a client and tests

* constructors work

* working request, need to fix the response parsing

* basic tests working for service client

* refactored the constructors

* testproxy and tests

* format file

* got client and one API working

* list working

* all apis recorded

* new assets.json

* assets.json regen

* format json

* adding word to cspell

* fix build issues

* fix one more break

* typo

* clangs

* one more issue

* more fixezez

* regen recordings

* try again

* clangs

* clangs again

* new assets

* new test proxy

* regen tests based on new merge

* hmmm

* restore

* add debug env for test proxy

* resync cmake presets from main

* gor get and set working

* get stats

* table client and create

* delete

* get/set acls

* list tables

* some cleanup

* Create /update/merge/delete

* upsert

* query entities

* generated tests

* clangs

* some fixes

* some more errors

* cspells

* got transaction API working

* transactions working , need to parse response

* get data out of the response

* clangs

* batch1

* regen tests

* part 2

* batch3

* batch4

* clangs

* regen tests

* regen tests

* try again

* live only

* added some more tests for the transaction body

* small refactor for tests

* oops

* some oter update

* darn includes

* sddfsd

* erorr fix

* key clients

* sas

* small cleanup

* All tests passing

* test recordings

* clangs

* missing ENV for test

* attempt1

* retry

* couple recordings

* regen some tests

* clangs

* again

* again

* comments

* comments

* headers and footers

* some cleanjup

* Move folders step1

* revert assets and test resources in storage

* revert to main

* cspell

* readme

* comments

* revert ci.yml

* liveonly test

* clangs

* camke

* ci2

* try again

* fdssfs

* fdsfsd

* some cleanup

* dasda

* dsdsds

* asda

* assets

* comments

* a few more bits and pieces

* some other updates for cspell

* typo

* more docs

* spell

* another doc error

* clangs docs

* docs

* test cov

* dasdas

* hg

* stress test

* cspell

* Update sdk/storage/azure-storage-common/test/ut/CMakeLists.txt

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/storage/azure-storage-common/test/ut/shared_key_policy_lite_test.cpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/tables/azure-data-tables/CHANGELOG.md

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/tables/azure-data-tables/CMakeLists.txt

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/tables/azure-data-tables/test/stress/scenarios-matrix.yaml

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/tables/azure-data-tables/test/stress/Dockerfile

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* PR comments

* respurces cleanup

* cleanup 2

* respurce fix

* revddrt

* weqq

* oops

* try again

* Update sdk/tables/azure-data-tables/vcpkg/vcpkg.json

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* try

* test fix

* samples

* readmes

* readmes

* readmes

* api view settings

* qualify friends

* try

* moving usings

* refactor for API View tool

* some more

* clangs

* Update sdk/tables/README.md

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/core/azure-core/inc/azure/core/http/http.hpp

Co-authored-by: Ahson Khan <ahkha@microsoft.com>

* Update sdk/core/azure-core/src/http/transport_policy.cpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/tables/azure-data-tables/inc/azure/data/tables/rest_client.hpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/tables/azure-data-tables/CHANGELOG.md

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/tables/azure-data-tables/test/ut/CMakeLists.txt

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/tables/azure-data-tables/src/rest_client.cpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* some comments

* comments

* comments part N

* clang

* try now

* clang

* comments

* update file names

* update test to check for the final signature

* ccc

* rename shared key policy lite

* cleanup some includes

* add a couple more tests

* small update

* clang

* increase test limits

* xml transition

* service_version_policy

* shared creds and key policy lite

* switch to secondary policy

* code done

* remove last storage vestiges

* put back some code

* readme/changelog

* Update sdk/tables/azure-data-tables/src/serializers.cpp

Co-authored-by: Rick Winter <rick.winter@microsoft.com>

* Add the shared key policy for Larry

* Larry comments

* curlybracify the initializers

* Update sdk/core/azure-core-xml/inc/azure/core/xml/dll_import_export.hpp

Co-authored-by: Rick Winter <rick.winter@microsoft.com>

* Update sdk/core/azure-core-xml/vcpkg.json

Co-authored-by: Rick Winter <rick.winter@microsoft.com>

* Update sdk/tables/azure-data-tables/inc/azure/data/tables.hpp

Co-authored-by: Rick Winter <rick.winter@microsoft.com>

* Rick's comments one more namespace change for serializers

* whiteline

* typo

* oops

* includes and clangs

* cleanup

* jhfjdhjfd

* hjkjdhf

* daas

* Anton's comments

* clang

* revert some changes

* fdss

* Update sdk/core/azure-core-xml/CHANGELOG.md

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* everything works

* clangs and vcpkg test

* test remove azure-core-xml

* vcpkg json

* remove the code

* merge main

* saa

* wqw

* last comments

* clang

---------

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
Co-authored-by: Rick Winter <rick.winter@microsoft.com>
2024-01-12 11:04:43 -08:00

136 lines
6.7 KiB
CMake

macro(GetFolderList project)
message ("project found ${project}")
message ("FLAG VALUE : ${FETCH_SOURCE_DEPS}")
if(${project} STREQUAL CERTIFICATES)
DownloadDepVersion(sdk/core azure-core 1.5.0)
DownloadDepVersion(sdk/identity azure-identity 1.1.0)
elseif(${project} STREQUAL IDENTITY)
DownloadDepVersion(sdk/core azure-core 1.2.0)
elseif(${project} STREQUAL SECRETS)
DownloadDepVersion(sdk/core azure-core 1.5.0)
DownloadDepVersion(sdk/identity azure-identity 1.1.0)
elseif(${project} STREQUAL KEYS)
DownloadDepVersion(sdk/core azure-core 1.5.0)
DownloadDepVersion(sdk/identity azure-identity 1.1.0)
elseif(${project} STREQUAL ADMINISTRATION)
DownloadDepVersion(sdk/core azure-core 1.5.0)
DownloadDepVersion(sdk/identity azure-identity 1.1.0)
elseif(${project} STREQUAL STORAGE_COMMON)
DownloadDepVersion(sdk/core azure-core 1.10.3)
elseif(${project} STREQUAL STORAGE_BLOBS)
DownloadDepVersion(sdk/core azure-core 1.10.3)
DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.5.0)
elseif(${project} STREQUAL STORAGE_FILES_DATALAKE)
DownloadDepVersion(sdk/core azure-core 1.10.3)
DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.5.0)
DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.10.0)
elseif(${project} STREQUAL STORAGE_FILES_SHARES)
DownloadDepVersion(sdk/core azure-core 1.10.3)
DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.5.0)
elseif(${project} STREQUAL STORAGE_QUEUES)
DownloadDepVersion(sdk/core azure-core 1.10.3)
DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.5.0)
elseif(${project} STREQUAL DATA_TABLES)
DownloadDepVersion(sdk/core azure-core 1.10.3)
elseif(${project} STREQUAL EVENTHUBS)
DownloadDepVersion(sdk/core azure-core 1.10.1)
DownloadDepVersion(sdk/core azure-core-amqp 1.0.0-beta.1)
elseif(${project} STREQUAL EVENTHUBS_CHECKPOINTSTORE_BLOB)
DownloadDepVersion(sdk/core azure-core 1.10.1)
DownloadDepVersion(sdk/core azure-core-amqp 1.0.0-beta.1)
DownloadDepVersion(sdk/eventhubs azure-messaging-eventhubs 1.0.0-beta.3)
DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.3.3)
DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.8.0)
elseif(${project} STREQUAL CORE_XML)
DownloadDepVersion(sdk/core azure-core 1.10.3)
endif()
list(REMOVE_DUPLICATES BUILD_FOLDERS)
endmacro()
macro(SetGlobalOptions)
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON)
option(BUILD_TRANSPORT_CURL "Build an HTTP transport implementation with CURL" OFF)
option(BUILD_TRANSPORT_WINHTTP "Build an HTTP transport implementation with WIN HTTP" OFF)
option(BUILD_TRANSPORT_CUSTOM "Implementation for AzureSdkGetCustomHttpTransport function must be linked to the final application" OFF)
option(BUILD_TESTING "Build test cases" OFF)
option(BUILD_RTTI "Build libraries with run-time type information." ON)
option(BUILD_CODE_COVERAGE "Build gcov targets for HTML and XML reports. Requires debug build and BUILD_TESTING" OFF)
option(BUILD_DOCUMENTATION "Create HTML based API documentation (requires Doxygen)" OFF)
option(BUILD_SAMPLES "Build sample application for Azure Storage clients" OFF)
option(RUN_LONG_UNIT_TESTS "Tests that takes more than 5 minutes to complete. No effect if BUILD_TESTING is OFF" OFF)
option(BUILD_PERFORMANCE_TESTS "Build the performance test library" OFF)
option(MSVC_USE_STATIC_CRT "(MSVC only) Set to ON to link SDK with static CRT (/MT or /MTd switch)." OFF)
option(FETCH_SOURCE_DEPS "fetch source dependencies for a package, not for global use, instead use when building specific component" OFF)
endmacro()
macro(SetCompileOptions project)
message ("setting up compile options for ${project}")
# Compile Options
SetGlobalOptions()
endmacro()
macro(DownloadDepVersion DEP_FOLDER DEP_NAME DEP_VERSION)
file(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/build/${DEP_FOLDER})
set(DOWNLOAD_FOLDER ${CMAKE_SOURCE_DIR}/build/downloads)
set(DOWNLOAD_FILE ${DEP_NAME}_${DEP_VERSION}.zip)
set(DEP_PREFIX azure-sdk-for-cpp)
if(FETCH_SOURCE_DEPS STREQUAL "LATEST")
SET(DOWNLOAD_MESSAGE "Downloading latest version of ${DEP_NAME}")
#get the latest version from main
SET(DOWNLOAD_LINK "http://github.com/Azure/azure-sdk-for-cpp/archive/main.zip")
else()
SET(DOWNLOAD_MESSAGE "Downloading version ${DEP_VERSION} of ${DEP_NAME}")
# get the zip
SET(DOWNLOAD_LINK "https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/${DOWNLOAD_FILE}")
endif()
foreach(RETRY_ATTEMPT RANGE 2)
math(EXPR RETRY_DELAY "10 * ${RETRY_ATTEMPT}" OUTPUT_FORMAT DECIMAL)
if (RETRY_ATTEMPT GREATER 0)
message("Waiting for ${RETRY_DELAY} seconds before retrying download.")
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${RETRY_DELAY})
endif()
message(${DOWNLOAD_MESSAGE})
file(
DOWNLOAD ${DOWNLOAD_LINK}
${DOWNLOAD_FOLDER}/${DOWNLOAD_FILE}
SHOW_PROGRESS
STATUS DOWNLOAD_STATUS
)
list(GET DOWNLOAD_STATUS 0 STATUS_CODE)
if (${STATUS_CODE} EQUAL 0)
break()
else()
list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE)
message("Download failed with status code ${STATUS_CODE}: ${ERROR_MESSAGE}.")
endif()
endforeach()
if (NOT ${STATUS_CODE} EQUAL 0)
message(FATAL_ERROR "Dependency download failed (Link: ${DOWNLOAD_LINK}).")
endif()
#extract the zip
file(ARCHIVE_EXTRACT INPUT ${DOWNLOAD_FOLDER}/${DOWNLOAD_FILE} DESTINATION ${DOWNLOAD_FOLDER}/${DEP_NAME})
#make target folder
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/build/${DEP_FOLDER})
# need a nicer way to copy/move folder
# i need to archive the folder then extract at new location
if(FETCH_SOURCE_DEPS STREQUAL "LATEST")
execute_process(COMMAND tar -cf ${DOWNLOAD_FOLDER}/${DEP_NAME}.tar -C ${DOWNLOAD_FOLDER}/${DEP_NAME}/azure-sdk-for-cpp-main/${DEP_FOLDER} .)
else()
execute_process(COMMAND tar -cf ${DOWNLOAD_FOLDER}/${DEP_NAME}.tar -C ${DOWNLOAD_FOLDER}/${DEP_NAME}/${DEP_PREFIX}-${DEP_NAME}_${DEP_VERSION}/${DEP_FOLDER} .)
endif()
file(ARCHIVE_EXTRACT INPUT ${DOWNLOAD_FOLDER}/${DEP_NAME}.tar DESTINATION ${CMAKE_SOURCE_DIR}/build/${DEP_FOLDER})
#cleanup
file(REMOVE_RECURSE ${DOWNLOAD_FOLDER})
#add dependency folder to build list
list(APPEND BUILD_FOLDERS build/${DEP_FOLDER})
endmacro()