Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge v724-or-v730 to default branch #979

Merged
merged 25 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1a5e00c
Bump version to 7.3.1
martincostello Jan 17, 2022
dfa9040
Change version to 7.2.4
martincostello Jan 17, 2022
ac01478
Add RateLimit benchmarks (#910)
martincostello Jan 17, 2022
9d13eac
Fixed an incorrect exception argument (#915)
FoxTes Feb 3, 2022
9d7d8bc
Upgrade FluentAssertions (#918)
dotnetspark Feb 13, 2022
3cbef2b
Add code coverage (#919)
martincostello Feb 13, 2022
98f7429
Add Visual Studio Code config files
martincostello Feb 13, 2022
c36712e
Bump Cake to v2.0.0 (#921)
eugeneogongo Feb 13, 2022
9f2c129
Tidy up build scripts
martincostello Feb 13, 2022
50b723b
Set executable bit
martincostello Feb 13, 2022
9f8d370
Disable download progress
martincostello Feb 13, 2022
475b7ba
Skip net4xx tests on non-Windows
martincostello Feb 13, 2022
47a2b5d
Drop test target for netcoreapp2.1
martincostello Feb 13, 2022
440955d
Speed up CI
martincostello Feb 13, 2022
28ebb94
Fix NullReferenceException (#923)
FoxTes Feb 14, 2022
e327306
Use file-scoped namespaces
martincostello Dec 16, 2022
053d891
Create .git-blame-ignore-revs
martincostello Dec 16, 2022
80002fe
Revert "expression body members"
martincostello Dec 16, 2022
63b151e
Revert "file scoped namespaces"
martincostello Dec 16, 2022
a792446
Revert "use var"
martincostello Dec 16, 2022
78c9860
Merge branch 'v724-or-v730' into undo-syntax-changes
martincostello Dec 16, 2022
35cf357
Update .git-blame-ignore-revs
martincostello Dec 16, 2022
b08876b
Add GitHub Actions CI
martincostello Dec 16, 2022
6f4d997
Add build matrix
martincostello Dec 16, 2022
1073e82
Remove macOS and Linux
martincostello Dec 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "2.0.0",
"commands": [
"dotnet-cake"
]
}
}
}
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Use file-scoped namespaces
a450cb69b5e4549f5515cdb057a68771f56cefd7
e32730600746b479db0241826b9bdef8eec9bb28
63b151ebc191ef35df9e3f29584ca94ec5d7c792
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
include:
#- os: macos-latest
# os_name: macos
#- os: ubuntu-latest
# os_name: linux
- os: windows-latest
os_name: windows

steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Setup .NET SDK
uses: actions/setup-dotnet@v3

- name: Build, Test and Package
shell: pwsh
run: ./build.ps1
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
NUGET_XMLDOC_MODE: skip
TERM: xterm

- name: Publish NuGet packages
uses: actions/upload-artifact@v3
with:
name: packages-${{ matrix.os_name }}
path: ./artifacts/nuget-package
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ TestResults
*.user
*.sln.docstates
.vs/
.vscode/
.idea/
.ionide/

Expand Down Expand Up @@ -123,4 +122,5 @@ tools

*.lock.json
*.nuget.targets
*.nuget.props
*.nuget.props
coverage.*.json
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"EditorConfig.EditorConfig",
"k--kato.docomment",
"ms-dotnettools.csharp"
]
}
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run tests",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "dotnet",
"args": [
"test"
],
"cwd": "${workspaceFolder}/src/Polly.Specs",
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
}
]
}
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet build ./src/Polly.sln",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
2 changes: 1 addition & 1 deletion GitVersionConfig.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
next-version: 7.3.0
next-version: 7.2.4
6 changes: 4 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ artifacts:
- path: artifacts\nuget-package\*.snupkg

environment:
# Skip dotnet package caching on build servers
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_NOLOGO: true
NUGET_XMLDOC_MODE: skip
1 change: 0 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ PUSHD %~dp0
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& './build.ps1'"

IF %errorlevel% neq 0 PAUSE

83 changes: 46 additions & 37 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ var configuration = Argument<string>("configuration", "Release");
// EXTERNAL NUGET TOOLS
//////////////////////////////////////////////////////////////////////

#Tool "xunit.runner.console"
#Tool "GitVersion.CommandLine"
#Tool "GitVersion.CommandLine&version=5.8.1"
#Tool "xunit.runner.console&version=2.4.1"

//////////////////////////////////////////////////////////////////////
// EXTERNAL NUGET LIBRARIES
//////////////////////////////////////////////////////////////////////

#addin nuget:?package=Cake.FileHelpers&version=3.3.0
#addin nuget:?package=Cake.Yaml&version=3.1.1
#addin nuget:?package=YamlDotNet&version=5.2.1
#addin nuget:?package=Cake.FileHelpers&version=5.0.0
#addin nuget:?package=Cake.Yaml&version=4.0.0
#addin nuget:?package=Newtonsoft.Json&version=13.0.1
#addin nuget:?package=YamlDotNet&version=11.2.1

///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
Expand All @@ -31,15 +32,15 @@ var solutionPaths = solutions.Select(solution => solution.GetDirectory());

var srcDir = Directory("./src");
var artifactsDir = Directory("./artifacts");
var testResultsDir = artifactsDir + Directory("test-results");
var testResultsDir = System.IO.Path.Combine(artifactsDir, Directory("test-results"));

// NuGet
var nupkgDestDir = artifactsDir + Directory("nuget-package");
var nupkgDestDir = System.IO.Path.Combine(artifactsDir, Directory("nuget-package"));

// Gitversion
// GitVersion
var gitVersionPath = ToolsExePath("GitVersion.exe");
Dictionary<string, object> gitVersionOutput;
var gitVersionConfigFilePath = "./GitVersionConfig.yaml";
Dictionary<string, object> gitVersionOutput;

// Versioning
string nugetVersion;
Expand Down Expand Up @@ -81,7 +82,8 @@ Teardown(_ =>
Task("__Clean")
.Does(() =>
{
DirectoryPath[] cleanDirectories = new DirectoryPath[] {
DirectoryPath[] cleanDirectories = new DirectoryPath[]
{
testResultsDir,
nupkgDestDir,
artifactsDir
Expand All @@ -94,17 +96,17 @@ Task("__Clean")
foreach(var path in solutionPaths)
{
Information("Cleaning {0}", path);
DotNetCoreClean(path.ToString());
DotNetClean(path.ToString());
}
});

Task("__RestoreNugetPackages")
Task("__RestoreNuGetPackages")
.Does(() =>
{
foreach(var solution in solutions)
{
Information("Restoring NuGet Packages for {0}", solution);
DotNetCoreRestore(solution.ToString());
DotNetRestore(solution.ToString());
}
});

Expand All @@ -114,7 +116,8 @@ Task("__UpdateAssemblyVersionInformation")
var gitVersionSettings = new ProcessSettings()
.SetRedirectStandardOutput(true);

try {
try
{
IEnumerable<string> outputLines;
StartProcess(gitVersionPath, gitVersionSettings, out outputLines);

Expand All @@ -129,13 +132,13 @@ Task("__UpdateAssemblyVersionInformation")
GitVersionConfigYaml deserialized = DeserializeYaml<GitVersionConfigYaml>(gitVersionYamlString.Replace("next-version", "NextVersion"));
string gitVersionConfig = deserialized.NextVersion;

gitVersionOutput = new Dictionary<string, object>{
gitVersionOutput = new Dictionary<string, object>
{
{ "NuGetVersion", gitVersionConfig + "-NotFromGitRepo" },
{ "FullSemVer", gitVersionConfig },
{ "AssemblySemVer", gitVersionConfig },
{ "Major", gitVersionConfig.Split('.')[0] },
};

}

Information("");
Expand All @@ -151,19 +154,21 @@ Task("__UpdateAssemblyVersionInformation")

Information("");
Information("Mapping versioning information to:");
Information("Appveyor build number -> {0}", appveyorBuildNumber);
Information("Nuget package version -> {0}", nugetVersion);
Information("AppVeyor build number -> {0}", appveyorBuildNumber);
Information("NuGet package version -> {0}", nugetVersion);
Information("AssemblyVersion -> {0}", assemblyVersion);
Information("AssemblyFileVersion -> {0}", assemblySemver);
Information("AssemblyInformationalVersion -> {0}", assemblySemver);
});

Task("__UpdateDotNetStandardAssemblyVersionNumber")
.WithCriteria(() => AppVeyor.IsRunningOnAppVeyor)
.Does(() =>
{
Information("Updating Assembly Version Information");

var attributeToValueMap = new Dictionary<string, string>() {
var attributeToValueMap = new Dictionary<string, string>()
{
{ "AssemblyVersion", assemblyVersion },
{ "FileVersion", assemblySemver },
{ "InformationalVersion", assemblySemver },
Expand All @@ -174,7 +179,8 @@ Task("__UpdateDotNetStandardAssemblyVersionNumber")

var csproj = File("./src/" + projectName + "/" + projectName + ".csproj");

foreach(var attributeMap in attributeToValueMap) {
foreach(var attributeMap in attributeToValueMap)
{
var attribute = attributeMap.Key;
var value = attributeMap.Value;

Expand All @@ -184,7 +190,6 @@ Task("__UpdateDotNetStandardAssemblyVersionNumber")
throw new Exception($"{attribute} version could not be updated in {csproj}.");
}
}

});

Task("__UpdateAppVeyorBuildNumber")
Expand All @@ -201,42 +206,46 @@ Task("__BuildSolutions")
{
Information("Building {0}", solution);

var dotNetCoreBuildSettings = new DotNetCoreBuildSettings {
Configuration = configuration,
Verbosity = DotNetCoreVerbosity.Minimal,
NoRestore = true,
MSBuildSettings = new DotNetCoreMSBuildSettings { TreatAllWarningsAs = MSBuildTreatAllWarningsAs.Error }
var dotNetCoreBuildSettings = new DotNetBuildSettings
{
Configuration = configuration,
Verbosity = DotNetCoreVerbosity.Minimal,
NoRestore = true,
MSBuildSettings = new DotNetMSBuildSettings { TreatAllWarningsAs = MSBuildTreatAllWarningsAs.Error },
};

DotNetCoreBuild(solution.ToString(), dotNetCoreBuildSettings);
DotNetBuild(solution.ToString(), dotNetCoreBuildSettings);
}
});

Task("__RunTests")
.Does(() =>
{
foreach(var specsProj in GetFiles("./src/**/*.Specs.csproj")) {
DotNetCoreTest(specsProj.FullPath, new DotNetCoreTestSettings {
foreach(var specsProj in GetFiles("./src/**/*.Specs.csproj"))
{
DotNetTest(specsProj.FullPath, new DotNetTestSettings
{
Configuration = configuration,
NoBuild = true
NoBuild = true,
});
}
});

Task("__CreateSignedNugetPackage")
Task("__CreateSignedNuGetPackage")
.Does(() =>
{
var packageName = projectName;

Information("Building {0}.{1}.nupkg", packageName, nugetVersion);

var dotNetCorePackSettings = new DotNetCorePackSettings {
var dotNetCorePackSettings = new DotNetPackSettings
{
Configuration = configuration,
NoBuild = true,
OutputDirectory = nupkgDestDir
OutputDirectory = nupkgDestDir,
};

DotNetCorePack($@"{srcDir}\{projectName}.sln", dotNetCorePackSettings);
DotNetPack(System.IO.Path.Combine(srcDir, projectName + ".sln"), dotNetCorePackSettings);
});

//////////////////////////////////////////////////////////////////////
Expand All @@ -245,13 +254,13 @@ Task("__CreateSignedNugetPackage")

Task("Build")
.IsDependentOn("__Clean")
.IsDependentOn("__RestoreNugetPackages")
.IsDependentOn("__RestoreNuGetPackages")
.IsDependentOn("__UpdateAssemblyVersionInformation")
.IsDependentOn("__UpdateDotNetStandardAssemblyVersionNumber")
.IsDependentOn("__UpdateAppVeyorBuildNumber")
.IsDependentOn("__BuildSolutions")
.IsDependentOn("__RunTests")
.IsDependentOn("__CreateSignedNugetPackage");
.IsDependentOn("__CreateSignedNuGetPackage");

///////////////////////////////////////////////////////////////////////////////
// PRIMARY TARGETS
Expand All @@ -271,6 +280,6 @@ RunTarget(target);
//////////////////////////////////////////////////////////////////////

string ToolsExePath(string exeFileName) {
var exePath = System.IO.Directory.GetFiles(@"./tools", exeFileName, SearchOption.AllDirectories).FirstOrDefault();
var exePath = System.IO.Directory.GetFiles("./tools", exeFileName, SearchOption.AllDirectories).FirstOrDefault();
return exePath;
}
Loading