Merge pull request #46 from AArnott/topLevelTestFolder
Use top-level test folder beside src folder for shipping projects
This commit is contained in:
Коммит
f75f92a6d2
|
@ -155,3 +155,11 @@ csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
|
||||||
# Blocks are allowed
|
# Blocks are allowed
|
||||||
csharp_prefer_braces = true:silent
|
csharp_prefer_braces = true:silent
|
||||||
|
|
||||||
|
[*.cs]
|
||||||
|
|
||||||
|
# SA1130: Use lambda syntax
|
||||||
|
dotnet_diagnostic.SA1130.severity = silent
|
||||||
|
|
||||||
|
[*.sln]
|
||||||
|
indent_style = tab
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
<Project ToolsVersion="15.0"
|
||||||
|
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<RepoRootPath>$(MSBuildThisFileDirectory)</RepoRootPath>
|
||||||
|
<BaseIntermediateOutputPath>$(RepoRootPath)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
|
||||||
|
<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$(RepoRootPath)bin\$(MSBuildProjectName)\</BaseOutputPath>
|
||||||
|
<PackageOutputPath>$(RepoRootPath)bin\Packages\$(Configuration)\</PackageOutputPath>
|
||||||
|
<LangVersion>8.0</LangVersion>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\strongname.snk</AssemblyOriginatorKeyFile>
|
||||||
|
|
||||||
|
<Company>COMPANY-PLACEHOLDER</Company>
|
||||||
|
<Authors>COMPANY-PLACEHOLDER</Authors>
|
||||||
|
<Copyright>© COMPANY-PLACEHOLDER. All rights reserved.</Copyright>
|
||||||
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="all" />
|
||||||
|
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
|
||||||
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
|
||||||
|
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.74" PrivateAssets="all" />
|
||||||
|
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.5.0" PrivateAssets="all" />
|
||||||
|
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164" PrivateAssets="all" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemDefinitionGroup>
|
||||||
|
<!-- We always want MSBuild properties generated that point at the restored location of each package. -->
|
||||||
|
<PackageReference GeneratePathProperty="true" />
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup Condition=" '$(IsTestProject)' == 'true' ">
|
||||||
|
<CoverletOutputFormat>cobertura</CoverletOutputFormat>
|
||||||
|
<Exclude>[xunit.*]*</Exclude>
|
||||||
|
<!-- Ensure we preserve each coverlet output file per target framework: https://github.com/tonerdo/coverlet/issues/177 -->
|
||||||
|
<CoverletOutput>$(OutputPath)/</CoverletOutput>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
|
@ -83,20 +83,20 @@ try {
|
||||||
git mv Library.sln "$LibraryName.sln"
|
git mv Library.sln "$LibraryName.sln"
|
||||||
git mv src/Library/Library.csproj "src/Library/$LibraryName.csproj"
|
git mv src/Library/Library.csproj "src/Library/$LibraryName.csproj"
|
||||||
git mv src/Library "src/$LibraryName"
|
git mv src/Library "src/$LibraryName"
|
||||||
git mv src/Library.Tests/Library.Tests.csproj "src/Library.Tests/$LibraryName.Tests.csproj"
|
git mv test/Library.Tests/Library.Tests.csproj "test/Library.Tests/$LibraryName.Tests.csproj"
|
||||||
git mv src/Library.Tests "src/$LibraryName.Tests"
|
git mv test/Library.Tests "test/$LibraryName.Tests"
|
||||||
|
|
||||||
# Refresh solution file both to update paths and give the projects unique GUIDs
|
# Refresh solution file both to update paths and give the projects unique GUIDs
|
||||||
dotnet sln remove src/Library/Library.csproj
|
dotnet sln remove src/Library/Library.csproj
|
||||||
dotnet sln remove src/Library.Tests/Library.Tests.csproj
|
dotnet sln remove test/Library.Tests/Library.Tests.csproj
|
||||||
dotnet sln add "src/$LibraryName"
|
dotnet sln add "src/$LibraryName"
|
||||||
dotnet sln add "src/$LibraryName.Tests"
|
dotnet sln add "test/$LibraryName.Tests"
|
||||||
git add "$LibraryName.sln"
|
git add "$LibraryName.sln"
|
||||||
|
|
||||||
# Update project reference in test project. Add before removal to keep the same ItemGroup in place.
|
# Update project reference in test project. Add before removal to keep the same ItemGroup in place.
|
||||||
dotnet add "src/$LibraryName.Tests" reference "src/$LibraryName"
|
dotnet add "test/$LibraryName.Tests" reference "src/$LibraryName"
|
||||||
dotnet remove "src/$LibraryName.Tests" reference src/Library/Library.csproj
|
dotnet remove "test/$LibraryName.Tests" reference src/Library/Library.csproj
|
||||||
git add "src/$LibraryName.Tests/$LibraryName.Tests.csproj"
|
git add "test/$LibraryName.Tests/$LibraryName.Tests.csproj"
|
||||||
|
|
||||||
# Establish a new strong-name key
|
# Establish a new strong-name key
|
||||||
& $sn.Path -k 2048 src/strongname.snk
|
& $sn.Path -k 2048 src/strongname.snk
|
||||||
|
@ -107,17 +107,17 @@ try {
|
||||||
'Library'=$LibraryName
|
'Library'=$LibraryName
|
||||||
'COMPANY-PLACEHOLDER'=$Author
|
'COMPANY-PLACEHOLDER'=$Author
|
||||||
}
|
}
|
||||||
Replace-Placeholders -Path "src/$LibraryName.Tests/CalculatorTests.cs" -Replacements @{
|
Replace-Placeholders -Path "test/$LibraryName.Tests/CalculatorTests.cs" -Replacements @{
|
||||||
'Library'=$LibraryName
|
'Library'=$LibraryName
|
||||||
'COMPANY-PLACEHOLDER'=$Author
|
'COMPANY-PLACEHOLDER'=$Author
|
||||||
}
|
}
|
||||||
Replace-Placeholders -Path "LICENSE" -Replacements @{
|
Replace-Placeholders -Path "LICENSE" -Replacements @{
|
||||||
'COMPANY-PLACEHOLDER'=$Author
|
'COMPANY-PLACEHOLDER'=$Author
|
||||||
}
|
}
|
||||||
Replace-Placeholders -Path "src/stylecop.json" -Replacements @{
|
Replace-Placeholders -Path "stylecop.json" -Replacements @{
|
||||||
'COMPANY-PLACEHOLDER'=$Author
|
'COMPANY-PLACEHOLDER'=$Author
|
||||||
}
|
}
|
||||||
Replace-Placeholders -Path "src/Directory.Build.props" -Replacements @{
|
Replace-Placeholders -Path "Directory.Build.props" -Replacements @{
|
||||||
'COMPANY-PLACEHOLDER'=$Author
|
'COMPANY-PLACEHOLDER'=$Author
|
||||||
}
|
}
|
||||||
Replace-Placeholders -Path "README.md" -Replacements @{
|
Replace-Placeholders -Path "README.md" -Replacements @{
|
||||||
|
@ -174,4 +174,4 @@ try {
|
||||||
}
|
}
|
||||||
|
|
||||||
# When testing this script, all the changes can be quickly reverted with this command:
|
# When testing this script, all the changes can be quickly reverted with this command:
|
||||||
# git reset HEAD :/README.md :/LICENSE :/azure-pipelines.yml :/src :/azure-pipelines; git co -- :/README.md :/LICENSE :/azure-pipelines.yml :/src :/azure-pipelines; git clean -fd :/src
|
# git reset HEAD :/README.md :/LICENSE :/azure-pipelines.yml :/src :/test :/azure-pipelines; git co -- :/README.md :/LICENSE :/azure-pipelines.yml :/src :/azure-pipelines; git clean -fd :/src :/test
|
||||||
|
|
28
Library.sln
28
Library.sln
|
@ -5,21 +5,33 @@ VisualStudioVersion = 16.0.29322.22
|
||||||
MinimumVisualStudioVersion = 15.0.26124.0
|
MinimumVisualStudioVersion = 15.0.26124.0
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Library", "src\Library\Library.csproj", "{C06D702E-6FC7-453B-BDDF-608F825EC003}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Library", "src\Library\Library.csproj", "{C06D702E-6FC7-453B-BDDF-608F825EC003}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Library.Tests", "src\Library.Tests\Library.Tests.csproj", "{DC5F3D1C-A9A3-44B7-A3C0-82C1FF4C3336}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Library.Tests", "test\Library.Tests\Library.Tests.csproj", "{DC5F3D1C-A9A3-44B7-A3C0-82C1FF4C3336}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1CE9670B-D5FF-46A7-9D00-24E70E6ED48B}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1CE9670B-D5FF-46A7-9D00-24E70E6ED48B}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.editorconfig = .editorconfig
|
.editorconfig = .editorconfig
|
||||||
src\Directory.Build.props = src\Directory.Build.props
|
Directory.Build.props = Directory.Build.props
|
||||||
src\Directory.Build.targets = src\Directory.Build.targets
|
Directory.Build.targets = Directory.Build.targets
|
||||||
global.json = global.json
|
global.json = global.json
|
||||||
nuget.config = nuget.config
|
nuget.config = nuget.config
|
||||||
src\shipping.ruleset = src\shipping.ruleset
|
stylecop.json = stylecop.json
|
||||||
src\stylecop.json = src\stylecop.json
|
|
||||||
src\tests.ruleset = src\tests.ruleset
|
|
||||||
version.json = version.json
|
version.json = version.json
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9E154A29-1796-4B85-BD81-B6A385D8FF71}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
src\.editorconfig = src\.editorconfig
|
||||||
|
src\Directory.Build.props = src\Directory.Build.props
|
||||||
|
src\Directory.Build.targets = src\Directory.Build.targets
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
test\.editorconfig = test\.editorconfig
|
||||||
|
test\Directory.Build.props = test\Directory.Build.props
|
||||||
|
test\Directory.Build.targets = test\Directory.Build.targets
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -38,6 +50,10 @@ Global
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{9E154A29-1796-4B85-BD81-B6A385D8FF71} = {1CE9670B-D5FF-46A7-9D00-24E70E6ED48B}
|
||||||
|
{36CCE840-6FE5-4DB9-A8D5-8CF3CB6D342A} = {1CE9670B-D5FF-46A7-9D00-24E70E6ED48B}
|
||||||
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {E3944F6A-384B-4B0F-B93F-3BD513DC57BD}
|
SolutionGuid = {E3944F6A-384B-4B0F-B93F-3BD513DC57BD}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
|
|
@ -5,8 +5,8 @@ if ($env:AGENT_TEMPDIRECTORY) {
|
||||||
$env:AGENT_TEMPDIRECTORY = (Get-ChildItem $env:AGENT_TEMPDIRECTORY -Directory |? { $_.Name -match $guidRegex } |% { Get-ChildItem "$($_.FullName)\testhost*.dmp","$($_.FullName)\Sequence_*.xml" -Recurse });
|
$env:AGENT_TEMPDIRECTORY = (Get-ChildItem $env:AGENT_TEMPDIRECTORY -Directory |? { $_.Name -match $guidRegex } |% { Get-ChildItem "$($_.FullName)\testhost*.dmp","$($_.FullName)\Sequence_*.xml" -Recurse });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$srcRoot = Resolve-Path "$PSScriptRoot\..\..\src"
|
$testRoot = Resolve-Path "$PSScriptRoot\..\..\test"
|
||||||
@{
|
@{
|
||||||
$srcRoot = (Get-ChildItem "$srcRoot\TestResults" -Recurse -Directory | Get-ChildItem -Recurse -File);
|
$testRoot = (Get-ChildItem "$testRoot\TestResults" -Recurse -Directory | Get-ChildItem -Recurse -File);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,43 +1,7 @@
|
||||||
<Project ToolsVersion="15.0"
|
<Project>
|
||||||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))' != '' " />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<RepoRootPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\'))</RepoRootPath>
|
|
||||||
<BaseIntermediateOutputPath>$(RepoRootPath)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
|
|
||||||
<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$(RepoRootPath)bin\$(MSBuildProjectName)\</BaseOutputPath>
|
|
||||||
<PackageOutputPath>$(RepoRootPath)bin\Packages\$(Configuration)\</PackageOutputPath>
|
|
||||||
<LangVersion>8.0</LangVersion>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
|
||||||
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\strongname.snk</AssemblyOriginatorKeyFile>
|
|
||||||
|
|
||||||
<Company>COMPANY-PLACEHOLDER</Company>
|
|
||||||
<Authors>COMPANY-PLACEHOLDER</Authors>
|
|
||||||
<Copyright>© COMPANY-PLACEHOLDER. All rights reserved.</Copyright>
|
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
|
||||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
|
||||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
|
||||||
<IncludeSymbols>true</IncludeSymbols>
|
|
||||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="all" />
|
|
||||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
|
|
||||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
|
|
||||||
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.74" PrivateAssets="all" />
|
|
||||||
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.5.0" PrivateAssets="all" />
|
|
||||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164" PrivateAssets="all" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemDefinitionGroup>
|
|
||||||
<!-- We always want MSBuild properties generated that point at the restored location of each package. -->
|
|
||||||
<PackageReference GeneratePathProperty="true" />
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -3,10 +3,6 @@
|
||||||
<!-- Workaround https://github.com/dotnet/wpf/issues/1718 -->
|
<!-- Workaround https://github.com/dotnet/wpf/issues/1718 -->
|
||||||
<EmbedUntrackedSources Condition=" '$(UseWPF)' == 'true' ">false</EmbedUntrackedSources>
|
<EmbedUntrackedSources Condition=" '$(UseWPF)' == 'true' ">false</EmbedUntrackedSources>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(IsTestProject)' == 'true' ">
|
|
||||||
<CoverletOutputFormat>cobertura</CoverletOutputFormat>
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))' != '' " />
|
||||||
<Exclude>[xunit.*]*</Exclude>
|
|
||||||
<!-- Ensure we preserve each coverlet output file per target framework: https://github.com/tonerdo/coverlet/issues/177 -->
|
|
||||||
<CoverletOutput>$(OutputPath)/</CoverletOutput>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFrameworks>net472;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
|
||||||
<CodeAnalysisRuleSet>..\tests.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<RootNamespace />
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Library\Library.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="coverlet.msbuild" Version="2.8.0" />
|
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
|
||||||
<PackageReference Include="xunit" Version="2.4.1" />
|
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
|
@ -1,8 +1,3 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
|
||||||
<CodeAnalysisRuleSet>..\shipping.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="10.0">
|
|
||||||
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
|
|
||||||
<Name Resource="MinimumRecommendedRules_Name" />
|
|
||||||
<Description Resource="MinimumRecommendedRules_Description" />
|
|
||||||
</Localization>
|
|
||||||
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
|
|
||||||
<Rule Id="CA1001" Action="Warning" />
|
|
||||||
<Rule Id="CA1009" Action="Warning" />
|
|
||||||
<Rule Id="CA1016" Action="Warning" />
|
|
||||||
<Rule Id="CA1033" Action="Warning" />
|
|
||||||
<Rule Id="CA1049" Action="Warning" />
|
|
||||||
<Rule Id="CA1060" Action="Warning" />
|
|
||||||
<Rule Id="CA1061" Action="Warning" />
|
|
||||||
<Rule Id="CA1063" Action="Warning" />
|
|
||||||
<Rule Id="CA1065" Action="Warning" />
|
|
||||||
<Rule Id="CA1301" Action="Warning" />
|
|
||||||
<Rule Id="CA1400" Action="Warning" />
|
|
||||||
<Rule Id="CA1401" Action="Warning" />
|
|
||||||
<Rule Id="CA1403" Action="Warning" />
|
|
||||||
<Rule Id="CA1404" Action="Warning" />
|
|
||||||
<Rule Id="CA1405" Action="Warning" />
|
|
||||||
<Rule Id="CA1410" Action="Warning" />
|
|
||||||
<Rule Id="CA1415" Action="Warning" />
|
|
||||||
<Rule Id="CA1821" Action="Warning" />
|
|
||||||
<Rule Id="CA1900" Action="Warning" />
|
|
||||||
<Rule Id="CA1901" Action="Warning" />
|
|
||||||
<Rule Id="CA2002" Action="Warning" />
|
|
||||||
<Rule Id="CA2100" Action="Warning" />
|
|
||||||
<Rule Id="CA2101" Action="Warning" />
|
|
||||||
<Rule Id="CA2108" Action="Warning" />
|
|
||||||
<Rule Id="CA2111" Action="Warning" />
|
|
||||||
<Rule Id="CA2112" Action="Warning" />
|
|
||||||
<Rule Id="CA2114" Action="Warning" />
|
|
||||||
<Rule Id="CA2116" Action="Warning" />
|
|
||||||
<Rule Id="CA2117" Action="Warning" />
|
|
||||||
<Rule Id="CA2122" Action="Warning" />
|
|
||||||
<Rule Id="CA2123" Action="Warning" />
|
|
||||||
<Rule Id="CA2124" Action="Warning" />
|
|
||||||
<Rule Id="CA2126" Action="Warning" />
|
|
||||||
<Rule Id="CA2131" Action="Warning" />
|
|
||||||
<Rule Id="CA2132" Action="Warning" />
|
|
||||||
<Rule Id="CA2133" Action="Warning" />
|
|
||||||
<Rule Id="CA2134" Action="Warning" />
|
|
||||||
<Rule Id="CA2137" Action="Warning" />
|
|
||||||
<Rule Id="CA2138" Action="Warning" />
|
|
||||||
<Rule Id="CA2140" Action="Warning" />
|
|
||||||
<Rule Id="CA2141" Action="Warning" />
|
|
||||||
<Rule Id="CA2146" Action="Warning" />
|
|
||||||
<Rule Id="CA2147" Action="Warning" />
|
|
||||||
<Rule Id="CA2149" Action="Warning" />
|
|
||||||
<Rule Id="CA2200" Action="Warning" />
|
|
||||||
<Rule Id="CA2202" Action="Warning" />
|
|
||||||
<Rule Id="CA2207" Action="Warning" />
|
|
||||||
<Rule Id="CA2212" Action="Warning" />
|
|
||||||
<Rule Id="CA2213" Action="Warning" />
|
|
||||||
<Rule Id="CA2214" Action="Warning" />
|
|
||||||
<Rule Id="CA2216" Action="Warning" />
|
|
||||||
<Rule Id="CA2220" Action="Warning" />
|
|
||||||
<Rule Id="CA2229" Action="Warning" />
|
|
||||||
<Rule Id="CA2231" Action="Warning" />
|
|
||||||
<Rule Id="CA2232" Action="Warning" />
|
|
||||||
<Rule Id="CA2235" Action="Warning" />
|
|
||||||
<Rule Id="CA2236" Action="Warning" />
|
|
||||||
<Rule Id="CA2237" Action="Warning" />
|
|
||||||
<Rule Id="CA2238" Action="Warning" />
|
|
||||||
<Rule Id="CA2240" Action="Warning" />
|
|
||||||
<Rule Id="CA2241" Action="Warning" />
|
|
||||||
<Rule Id="CA2242" Action="Warning" />
|
|
||||||
</Rules>
|
|
||||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
|
|
||||||
<Rule Id="SA1130" Action="None" />
|
|
||||||
</Rules>
|
|
||||||
</RuleSet>
|
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="10.0">
|
|
||||||
<Include Path="shipping.ruleset" Action="Default" />
|
|
||||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
|
|
||||||
<Rule Id="SA1600" Action="Hidden" />
|
|
||||||
<Rule Id="SA1601" Action="Hidden" />
|
|
||||||
<Rule Id="SA1602" Action="Hidden" />
|
|
||||||
<Rule Id="SA1615" Action="Hidden" />
|
|
||||||
</Rules>
|
|
||||||
<Rules AnalyzerId="Microsoft.VisualStudio.Threading.Analyzers" RuleNamespace="Microsoft.VisualStudio.Threading.Analyzers">
|
|
||||||
<Rule Id="VSTHRD103" Action="Hidden" />
|
|
||||||
<Rule Id="VSTHRD111" Action="None" />
|
|
||||||
<Rule Id="VSTHRD200" Action="Hidden" />
|
|
||||||
</Rules>
|
|
||||||
<Rules AnalyzerId="Microsoft.NetCore.Analyzers" RuleNamespace="Microsoft.NetCore.Analyzers">
|
|
||||||
<Rule Id="CA1303" Action="None" />
|
|
||||||
</Rules>
|
|
||||||
</RuleSet>
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
[*.cs]
|
||||||
|
|
||||||
|
# SA1600: Elements should be documented
|
||||||
|
dotnet_diagnostic.SA1600.severity = silent
|
||||||
|
|
||||||
|
# SA1601: Partial elements should be documented
|
||||||
|
dotnet_diagnostic.SA1601.severity = silent
|
||||||
|
|
||||||
|
# SA1602: Enumeration items should be documented
|
||||||
|
dotnet_diagnostic.SA1602.severity = silent
|
||||||
|
|
||||||
|
# SA1615: Element return value should be documented
|
||||||
|
dotnet_diagnostic.SA1615.severity = silent
|
||||||
|
|
||||||
|
# VSTHRD103: Call async methods when in an async method
|
||||||
|
dotnet_diagnostic.VSTHRD103.severity = silent
|
||||||
|
|
||||||
|
# VSTHRD111: Use .ConfigureAwait(bool)
|
||||||
|
dotnet_diagnostic.VSTHRD111.severity = none
|
||||||
|
|
||||||
|
# VSTHRD200: Use Async suffix for async methods
|
||||||
|
dotnet_diagnostic.VSTHRD200.severity = silent
|
||||||
|
|
||||||
|
# CA1303: Do not pass literals as localized parameters
|
||||||
|
dotnet_diagnostic.CA1303.severity = none
|
||||||
|
|
||||||
|
# CS1591: Missing XML comment for publicly visible type or member
|
||||||
|
dotnet_diagnostic.CS1591.severity = silent
|
|
@ -0,0 +1,11 @@
|
||||||
|
<Project>
|
||||||
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))' != '' " />
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFrameworks>net472;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
<RootNamespace />
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<Project>
|
||||||
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))' != '' " />
|
||||||
|
</Project>
|
|
@ -0,0 +1,14 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\src\Library\Library.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="coverlet.msbuild" Version="2.8.0" />
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||||
|
<PackageReference Include="xunit" Version="2.4.1" />
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
|
@ -31,7 +31,7 @@ $sdkVersion = & "$PSScriptRoot/../azure-pipelines/variables/DotNetSdkVersion.ps1
|
||||||
|
|
||||||
# Search for all .NET Core runtime versions referenced from MSBuild projects and arrange to install them.
|
# Search for all .NET Core runtime versions referenced from MSBuild projects and arrange to install them.
|
||||||
$runtimeVersions = @()
|
$runtimeVersions = @()
|
||||||
Get-ChildItem "$PSScriptRoot\..\src\*.*proj" -Recurse |% {
|
Get-ChildItem "$PSScriptRoot\..\src\*.*proj","$PSScriptRoot\..\test\*.*proj","$PSScriptRoot\..\Directory.Build.props" -Recurse |% {
|
||||||
$projXml = [xml](Get-Content -Path $_)
|
$projXml = [xml](Get-Content -Path $_)
|
||||||
$targetFrameworks = $projXml.Project.PropertyGroup.TargetFramework
|
$targetFrameworks = $projXml.Project.PropertyGroup.TargetFramework
|
||||||
if (!$targetFrameworks) {
|
if (!$targetFrameworks) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче