Add Core scaffolding

This commit is contained in:
Rick Winter 2020-02-20 12:10:01 -08:00 committed by GitHub
parent acc0e20c56
commit eab3352932
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 3617 additions and 25 deletions

207
.clang-format Normal file
View File

@ -0,0 +1,207 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# https://releases.llvm.org/9.0.0/tools/clang/docs/ClangFormatStyleOptions.html
---
# Language: Cpp
BasedOnStyle: LLVM
# AccessModifierOffset: -2
AccessModifierOffset: -4
# AlignAfterOpenBracket: Align
AlignAfterOpenBracket: DontAlign
# AlignConsecutiveMacros: false
AlignConsecutiveMacros: false
# AlignConsecutiveAssignments: false
AlignConsecutiveAssignments: false
# AlignConsecutiveDeclarations: false
# AlignEscapedNewlines: Right
AlignEscapedNewlines: Left
# AlignOperands: true
# AlignTrailingComments: true
AlignTrailingComments: false
# AllowAllArgumentsOnNextLine: true
# AllowAllConstructorInitializersOnNextLine: true
# AllowAllParametersOfDeclarationOnNextLine: true
# AllowShortBlocksOnASingleLine: false
# AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: All
AllowShortFunctionsOnASingleLine: Empty
# AllowShortLambdasOnASingleLine: All
# AllowShortIfStatementsOnASingleLine: Never
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false
# AlwaysBreakTemplateDeclarations: MultiLine
AlwaysBreakTemplateDeclarations: Yes
# BinPackArguments: true
# BinPackParameters: true
# BraceWrapping:
# AfterCaseLabel: false
# AfterClass: false
# AfterControlStatement: false
# AfterEnum: false
# AfterFunction: false
# AfterNamespace: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# AfterExternBlock: false
# BeforeCatch: false
# BeforeElse: false
# IndentBraces: false
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
# BreakBeforeBinaryOperators: None
BreakBeforeBinaryOperators: NonAssignment
# BreakBeforeBraces: Attach
# BreakBeforeInheritanceComma: false
# BreakInheritanceList: BeforeColon
# BreakBeforeTernaryOperators: true
# BreakConstructorInitializersBeforeComma: false
# BreakConstructorInitializers: BeforeColon
# BreakAfterJavaFieldAnnotations: false
# BreakStringLiterals: true
# ColumnLimit: 80
ColumnLimit: 120
# CommentPragmas: '^ IWYU pragma:'
# CompactNamespaces: false
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
# ConstructorInitializerIndentWidth: 4
# ContinuationIndentWidth: 4
# Cpp11BracedListStyle: true
# DerivePointerAlignment: false
# DisableFormat: false
# ExperimentalAutoDetectBinPacking: false
# TRANSITION, LLVM-39247, fixed in clang-format 10.
# FixNamespaceComments: true
FixNamespaceComments: false
# ForEachMacros:
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# IncludeBlocks: Preserve
IncludeBlocks: Regroup
# IncludeCategories:
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
# Priority: 2
# - Regex: '^(<|"(gtest|gmock|isl|json)/)'
# Priority: 3
# - Regex: '.*'
# Priority: 1
IncludeCategories:
- Regex: '^<yvals(_core)?\.h>$'
Priority: 1
- Regex: '^<(Windows|userenv)\.h>$'
Priority: 3
- Regex: '^<WinIoCtl\.h>$'
Priority: 4
- Regex: '.*'
Priority: 2
# IncludeIsMainRegex: '(Test)?$'
# IndentCaseLabels: false
# IndentPPDirectives: None
# IndentWidth: 2
IndentWidth: 4
# IndentWrappedFunctionNames: false
IndentWrappedFunctionNames: true
# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
# KeepEmptyLinesAtTheStartOfBlocks: true
# NOTE: MacroBlockBegin/MacroBlockEnd don't work with _CATCH_ALL.
# MacroBlockBegin: ''
# MacroBlockEnd: ''
# MaxEmptyLinesToKeep: 1
MaxEmptyLinesToKeep: 2
# NamespaceIndentation: None
NamespaceIndentation: All
# ObjCBinPackProtocolList: Auto
# ObjCBlockIndentWidth: 2
# ObjCSpaceAfterProperty: false
# ObjCSpaceBeforeProtocolList: true
# PenaltyBreakAssignment: 2
# PenaltyBreakBeforeFirstCallParameter: 19
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 120
# PenaltyBreakString: 1000
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60
# PointerAlignment: Right
PointerAlignment: Left
# ReflowComments: true
# SortIncludes: true
# SortUsingDeclarations: true
# SpaceAfterCStyleCast: false
SpaceAfterCStyleCast: true
# SpaceAfterLogicalNot: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeCpp11BracedList: false
# SpaceBeforeCtorInitializerColon: true
# SpaceBeforeInheritanceColon: true
# SpaceBeforeParens: ControlStatements
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# Standard: Cpp11
# NOTE: _STD_BEGIN, _STD_END, etc. aren't macros for complete statements, but telling clang-format that they are
# produces the behavior that we want (with no block indentation).
# StatementMacros:
# - Q_UNUSED
# - QT_REQUIRE_VERSION
StatementMacros:
- _STD_BEGIN
- _STD_END
- _STDEXT_BEGIN
- _STDEXT_END
- _EXTERN_C
- _END_EXTERN_C
- _EXTERN_C_UNLESS_PURE
- _END_EXTERN_C_UNLESS_PURE
# TabWidth: 8
# UseTab: Never
...

23
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,23 @@
# Instructions for CODEOWNERS file format and automatic build failure notifications:
# https://github.com/Azure/azure-sdk/blob/master/docs/policies/opensource.md#codeowners
###########
# SDK
###########
# Catch all for non-code project files
* @gilbertw @joshfree @jeffreyrichter
# SDK team
/sdk/ @gilbertw @jeffreyrichter @antkmsft @vhvb1989
# Samples
/samples/ @gilbertw @jeffreyrichter
# Service teams
###########
# Eng Sys
###########
/eng/ @danieljurek
/**/ci.yml @danieljurek

40
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,40 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
***Exception or Stack Trace***
Add the exception log and stack trace if available
**To Reproduce**
Steps to reproduce the behavior:
***Code Snippet***
Add the code snippet that causes the issue.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Setup (please complete the following information):**
- OS: [e.g. iOS]
- IDE : [e.g. IntelliJ]
- Version of the Library used
**Additional context**
Add any other context about the problem here.
**Information Checklist**
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [ ] Bug Description Added
- [ ] Repro Steps Added
- [ ] Setup information Added

View File

@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE REQ]"
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
**Information Checklist**
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [ ] Description Added
- [ ] Expected solution specified

View File

@ -0,0 +1,24 @@
---
name: Question/Query template
about: Use this template to file a question/query for the SDK team
title: "[QUERY]"
labels: ''
assignees: ''
---
**Query/Question**
A clear and concise ask/query.
***Why is this not a Bug or a feature Request?***
A clear explanation of why is this not a bug or a feature request?
**Setup (please complete the following information if applicable):**
- OS: [e.g. iOS]
- IDE : [e.g. IntelliJ]
- Version of the Library used
**Information Checklist**
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [ ] Query Added
- [ ] Setup information Added

356
.gitignore vendored
View File

@ -1,32 +1,338 @@
# Prerequisites
*.d
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# Compiled Object files
*.slo
*.lo
*.o
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
# Precompiled Headers
*.gch
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Chutzpah Test files
_Chutzpah*
# Fortran module files
*.mod
*.smod
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Executables
*.exe
*.out
*.app
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# CMake
build/
/cmake-build-debug
.vscode/settings.json
#Doxygen
[Dd]ocs/

26
CMakeLists.txt Normal file
View File

@ -0,0 +1,26 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT
cmake_minimum_required (VERSION 3.12)
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON)
option(BUILD_CURL_TRANSPORT "Build internal http transport implementation with CURL for HTTP Pipeline" OFF)
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
endif()
if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "")
endif()
project(az LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
#enable_testing ()
include(eng/cmake/global_compile_options.txt)

16
CMakeSettings.json Normal file
View File

@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": []
}
]
}

134
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,134 @@
Azure SDK for C Contributing Guide
-------------------------------------
Thank you for your interest in contributing to Azure SDK for C.
- For reporting bugs, requesting features, or asking for support, please file an issue in the [issues](https://github.com/Azure/azure-sdk-for-c/issues) section of the project.
- If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.com/guidelines.html).
- To make code changes, or contribute something new, please follow the [GitHub Forks / Pull requests model](https://help.github.com/articles/fork-a-repo/): Fork the repo, make the change and propose it back by submitting a pull request.
- Refer to the [wiki](https://github.com/Azure/azure-sdk-for-c/wiki) to learn about how Azure SDK for C generates lint checker, doxygen, and code coverage reports.
Pull Requests
-------------
* **DO** submit all code changes via pull requests (PRs) rather than through a direct commit. PRs will be reviewed and potentially merged by the repo maintainers after a peer review that includes at least one maintainer.
* **DO NOT** submit "work in progress" PRs. A PR should only be submitted when it is considered ready for review and subsequent merging by the contributor.
* **DO** give PRs short-but-descriptive names (e.g. "Improve code coverage for Azure.Core by 10%", not "Fix #1234")
* **DO** refer to any relevant issues, and include [keywords](https://help.github.com/articles/closing-issues-via-commit-messages/) that automatically close issues when the PR is merged.
* **DO** tag any users that should know about and/or review the change.
* **DO** ensure each commit successfully builds. The entire PR must pass all tests in the Continuous Integration (CI) system before it'll be merged.
* **DO** address PR feedback in an additional commit(s) rather than amending the existing commits, and only rebase/squash them when necessary. This makes it easier for reviewers to track changes.
* **DO** assume that ["Squash and Merge"](https://github.com/blog/2141-squash-your-commits) will be used to merge your commit unless you request otherwise in the PR.
* **DO NOT** fix merge conflicts using a merge commit. Prefer `git rebase`.
* **DO NOT** mix independent, unrelated changes in one PR. Separate real product/test code changes from larger code formatting/dead code removal changes. Separate unrelated fixes into separate PRs, especially if they are in different assemblies.
Merging Pull Requests (for project contributors with write access)
----------------------------------------------------------
* **DO** use ["Squash and Merge"](https://github.com/blog/2141-squash-your-commits) by default for individual contributions unless requested by the PR author.
Do so, even if the PR contains only one commit. It creates a simpler history than "Create a Merge Commit".
Reasons that PR authors may request "Merge and Commit" may include (but are not limited to):
- The change is easier to understand as a series of focused commits. Each commit in the series must be buildable so as not to break `git bisect`.
- Contributor is using an e-mail address other than the primary GitHub address and wants that preserved in the history. Contributor must be willing to squash
the commits manually before acceptance.
## Developer Guide
### Pre-requisites
This project contains Git submodules which are required to build. After cloning this repo, run `git submodule update
--init --recursive`.
### CMake
CMake version 3.12 or higher is required to build these libraries. Download and install CMake from the project's
[website](https://cmake.org/download/).
### Vcpkg
Vcpkg is required to download project dependencies. To get started, first clone vcpkg to a location on your system and
run the bootstrapping script.
```sh
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg # Keep note of the location of this directory for the next step
Windows> .\bootstrap-vcpkg.bat
Linux/macOS:~/$ ./bootstrap-vcpkg.sh
```
On macOS, this command may fail if your version of the C++ toolchain is not new enough to support vcpkg. To resolve
this, vcpkg recommends to install `gcc@6` from Homebrew (`brew install gcc@6`), then re-run the bootstrapping script.
Next, define the `VCPKG_ROOT` environment variable and add the `vcpkg` command to your path. You will probably want to
persist these changes, so it's recommended to add/edit them via the Windows "System Properties" control panel, or via
your `.profile` file on Linux/macOS.
> **Windows**
> ```bat
> set VCPKG_ROOT=C:\path\to\vcpkg
> set PATH=%PATH%;%VCPKG_ROOT%
> ```
>
> **Linux/macOS**
> ```sh
> export VCPKG_ROOT=/path/to/vcpkg
> export PATH=$PATH:$VCPKG_ROOT
> ```
Finally, install the project dependencies with vcpkg.
> **Windows**
> ```bat
> set VCPKG_DEFAULT_TRIPLET=x64-windows-static
> vcpkg install curl[winssl]
> ```
>
> **Linux/macOS**
> ```sh
> vcpkg install curl[ssl]
> ```
### Development headers (Linux/macOS)
On Linux/macOS the development headers for OpenSSL 1.1 must be installed to a location where CMake can find them.
For Ubuntu 18.04 and up, you can install them directly from the main Ubuntu repository with `apt-get`. For macOS, you
can install them with Homebrew.
> **Linux (Ubuntu 18.04 and up)**
> ```sh
> sudo apt-get install libssl-dev
> ```
>
> **macOS**
> ```sh
> brew install openssl@1.1
> ```
### Building and Testing
#### Building the project
First, ensure that the `VCPKG_ROOT` environment variable is set, as described [above](#vcpkg). This needs to be defined
any time you want to build. Then generate the build files and build as you would any standard CMake project. From the
repo root, run:
```sh
mkdir build
cd build
cmake -Duse_default_uuid=ON ..
cmake --build .
```
#### Testing the project
Tests are executed via the `ctest` command included with CMake. From the repo root, run:
```sh
cd build
ctest -C Debug
```
### Visual Studio 2019
You can also build the project by simply opening the desired project directory in Visual Studio. Everything should be
preconfigured to build and run tests.

2566
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
if(MSVC)
if(WARNINGS_AS_ERRORS)
set(WARNINGS_AS_ERRORS_FLAG "/WX")
endif()
add_compile_options(/Wall ${WARNINGS_AS_ERRORS_FLAG} /wd5031 /wd4668 /wd4820 /wd4255 /wd4710 /analyze)
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(WARNINGS_AS_ERRORS)
set(WARNINGS_AS_ERRORS_FLAG "-Werror")
endif()
add_compile_options(-Xclang -Wall -Wextra -pedantic ${WARNINGS_AS_ERRORS_FLAG} -Wdocumentation -Wdocumentation-unknown-command -Wcast-qual)
else()
if(WARNINGS_AS_ERRORS)
set(WARNINGS_AS_ERRORS_FLAG "-Werror")
endif()
add_compile_options(-Wall -Wextra -pedantic ${WARNINGS_AS_ERRORS_FLAG})
endif()

View File

@ -0,0 +1,66 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT
cmake_minimum_required (VERSION 3.12)
project (azure-core LANGUAGES CXX)
set(CMAKE_C_STANDARD 99)
add_library (
azure-core
src/az_span.c
)
if(MSVC)
if(WARNINGS_AS_ERRORS)
set(WARNINGS_AS_ERRORS_FLAG "/WX")
endif()
target_compile_options(azure-core PRIVATE /Wall ${WARNINGS_AS_ERRORS_FLAG} /wd5031 /wd4668 /wd4820 /wd4255 /analyze)
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(WARNINGS_AS_ERRORS)
set(WARNINGS_AS_ERRORS_FLAG "-Werror")
endif()
target_compile_options(azure-core PRIVATE -Xclang -Wall -Wextra -pedantic ${WARNINGS_AS_ERRORS_FLAG} -Wdocumentation -Wdocumentation-unknown-command -Wcast-qual)
else()
if(WARNINGS_AS_ERRORS)
set(WARNINGS_AS_ERRORS_FLAG "-Werror")
endif()
target_compile_options(azure-core PRIVATE -Wall -Wextra -pedantic ${WARNINGS_AS_ERRORS_FLAG})
endif()
target_include_directories (azure-core PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> $<INSTALL_INTERFACE:include/az>)
# create interface for internal headers
#add_library(az_core_internal INTERFACE)
#target_include_directories(az_core_internal INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/internal> $<INSTALL_INTERFACE:include/az_internal>)
#target_link_libraries(az_core PRIVATE az_core_internal)
# make sure that users can consume the project as a library.
add_library (azure::core ALIAS azure-core)
add_executable (
azure-core_test
test/main.cpp
)
target_link_libraries(azure-core-test PRIVATE azure-core)
target_include_directories (azure-core-test PRIVATE src)
if (UNIX)
target_link_libraries(azure-core-test PRIVATE m)
endif()
target_include_directories (azure-core-test PRIVATE test)
add_test(NAME azure-core-test COMMAND azure-core-test)
if (MOCK_CURL)
MESSAGE("Will mock all calls to http client with static responses")
add_definitions(-DMOCK_CURL="MOCK")
endif()

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,97 @@
# Azure SDK Core Library for C++
Azure Core library for C++ (`azure-core`) provides shared primitives, abstractions, and helpers for modern Azure SDK client libraries written in the C++ programming language. These libraries follow the Azure SDK Design Guidelines for C++.
The library allows client libraries to expose common functionality in a consistent fashion. Once you learn how to use these APIs in one client library, you will know how to use them in other client libraries.
## Getting started
TODO
## Key concepts
TODO
### Error Structure
TODO
### Span of bytes
TODO
### Strings
TODO
## Examples
TODO
## Troubleshooting
### General
TODO
### Retry policy
While working with Azure you might encounter transient failures. For information about handling these types of failures, see [Retry pattern][azure_pattern_retry] in the Cloud Design Patterns guide, and the related [Circuit Breaker pattern][azure_pattern_circuit_breaker].
## Next steps
### More sample code
TODO
### Additional documentation
TODO
## Contributing
For details on contributing to this repository, see the [contributing guide][azure_sdk_for_cpp_contributing].
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
### Additional Helpful Links for Contributors
Many people all over the world have helped make this project better. You'll want to check out:
* [What are some good first issues for new contributors to the repo?](https://github.com/azure/azure-sdk-for-cpp/issues?q=is%3Aopen+is%3Aissue+label%3A%22up+for+grabs%22)
* [How to build and test your change][azure_sdk_for_cpp_contributing_developer_guide]
* [How you can make a change happen!][azure_sdk_for_cpp_contributing_pull_requests]
* Frequently Asked Questions (FAQ) and Conceptual Topics in the detailed [Azure SDK for C++ wiki](https://github.com/azure/azure-sdk-for-cpp/wiki).
### Community
* Chat with other community members [![Join the chat at https://gitter.im/azure/azure-sdk-for-cpp](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/azure/azure-sdk-for-cpp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
### Reporting security issues and security bugs
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <secure@microsoft.com>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://www.microsoft.com/msrc/faqs-report-an-issue).
### License
Azure SDK for C++ is licensed under the [MIT](LICENSE) license.
<!-- LINKS -->
[azure_sdk_for_c_contributing]: https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md
[azure_sdk_for_c_contributing_developer_guide]: https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md#developer-guide
[azure_sdk_for_c_contributing_pull_requests]: https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md#pull-requests
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_pattern_circuit_breaker]: https://docs.microsoft.com/azure/architecture/patterns/circuit-breaker
[azure_pattern_retry]: https://docs.microsoft.com/azure/architecture/patterns/retry
[azure_portal]: https://portal.azure.com
[azure_sub]: https://azure.microsoft.com/free/
[c_compiler]: https://visualstudio.microsoft.com/vs/features/cplusplus/
[cloud_shell]: https://docs.microsoft.com/azure/cloud-shell/overview
[cloud_shell_bash]: https://shell.azure.com/bash

View File

@ -0,0 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#pragma once
namespace Azure {
}

View File

@ -0,0 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include <azure.hpp>
#include <stdlib.h>
namespace azure {
namespace core {
int main() {
return 0;
}
}
}