Skip to content

Commit

Permalink
Merge pull request #1538 from microsoft/develop
Browse files Browse the repository at this point in the history
merge DEVELOP to MASTER (prep 2.13-beta1)
  • Loading branch information
TimothyMothra authored Jan 10, 2020
2 parents da00d03 + eda87b8 commit 85b3daf
Show file tree
Hide file tree
Showing 268 changed files with 1,801 additions and 1,439 deletions.
7 changes: 3 additions & 4 deletions .props/Product.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
<Message Text="Info: Product.props imported by $(MSBuildProjectName)." Importance="high"/>
</Target>

<Import Project=".\_Common.props" />
<Import Project=".\_AnalyzerSettings.props" />

<Import Project=".\_GlobalStaticVersion.props" />
<Import Project=".\_Nupkg.props" />
<Import Project=".\_Common.props" />

<PropertyGroup>

</PropertyGroup>
</Project>
4 changes: 1 addition & 3 deletions .props/Test.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
</Target>

<Import Project=".\_Common.props" />
<Import Project=".\_AnalyzerSettings.props" />

<PropertyGroup>

</PropertyGroup>
</Project>
34 changes: 34 additions & 0 deletions .props/_AnalyzerSettings.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="Info_AnalyzerSettingsProps" BeforeTargets="Build" Condition=" $(Internal_Logging) == 'true' ">
<Message Text="Info: AnalyzerSettings.props imported by $(MSBuildProjectName)." Importance="high"/>
</Target>

<PropertyGroup>
<CodeAnalysisRuleSet>$(RulesetsRoot)\ApplicationInsightsSDKRules.ruleset</CodeAnalysisRuleSet>

<!-- Microsoft recommends that we disable CodeAnalysis in favor of FxCop Analyzers. aka.ms/fxcopanalyzers -->
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>

<StyleCopEnabled>true</StyleCopEnabled>

</PropertyGroup>

<Choose>
<When Condition=" '$(Configuration)' == 'Release' ">
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<StyleCopTreatErrorsAsWarnings>true</StyleCopTreatErrorsAsWarnings>
</PropertyGroup>
</When>
<When Condition=" '$(Configuration)' != 'Release' ">
<PropertyGroup>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
</PropertyGroup>
</When>
</Choose>

</Project>
42 changes: 39 additions & 3 deletions .props/_Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,46 @@
<Message Text="Info: Common.props imported by $(MSBuildProjectName)." Importance="high"/>
</Target>

<Import Project=".\_Signing.props" />
<Import Project="$(TargetsRoot)\AddXmlLanguage.targets" />

<PropertyGroup>
<!-- COMMON PROJECTS SETTINGS -->

<!-- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errorreport-compiler-option -->
<ErrorReport>prompt</ErrorReport>

<!-- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/warn-compiler-option -->
<WarningLevel>4</WarningLevel>

<!-- TODO: NEEDS INVESTIGATION. This has some conflicts with the functional test apps using dirs.proj -->
<!-- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/langversion-compiler-option -->
<!-- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version -->
<!--<LangVersion>7.3</LangVersion>-->

</PropertyGroup>

<!--
Regarding Debug Type:
FULL is the legacy Windows format.
NetCore has switched to PORTABLE. https://github.com/dotnet/core/blob/master/Documentation/diagnostics/portable_pdb.md
We tried switching to Portable in 2018, ago but Microsoft Symbol Server didn't support it yet.
I tried onboarding to Nuget Symbols Server in 2019, but they require Portable.
DotNet SDK recommends using PORTABLE https://github.com/dotnet/sdk/issues/2679#issuecomment-441098067
This needs to be revisited when someone has time.
-->

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
</PropertyGroup>

</Project>
6 changes: 3 additions & 3 deletions .props/_GlobalStaticVersion.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
Update for every public release.
-->
<SemanticVersionMajor>2</SemanticVersionMajor>
<SemanticVersionMinor>12</SemanticVersionMinor> <!-- If changing the Minor version, also update the Date value. -->
<SemanticVersionMinor>13</SemanticVersionMinor> <!-- If changing the Minor version, also update the Date value. -->
<SemanticVersionPatch>0</SemanticVersionPatch>
<PreReleaseMilestone></PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
<PreReleaseMilestone>beta1</PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
<!--
Date when Semantic Version was changed.
Update for every MINOR release.
NOTE!!!!!! Do not update when updating PreReleaseMilestone update
as it will restart file versions so 2.4.0-beta1 may have higher
file version (like 2.4.0.2222) than 2.4.0-beta2 (like 2.4.0.1111)
-->
<SemanticVersionDate>2019-09-23</SemanticVersionDate>
<SemanticVersionDate>2020-01-09</SemanticVersionDate>

<!--
Pre-release version is used to distinguish internally built NuGet packages.
Expand Down
52 changes: 48 additions & 4 deletions .props/_Nupkg.props
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Including this file will generate both the *.nupkg and *.snupkg -->

<Target Name="Info_NupkgProps" BeforeTargets="Build" Condition=" $(Internal_Logging) == 'true' ">
<Message Text="Info: Nupkg.props imported by $(MSBuildProjectName)." Importance="high"/>
</Target>

<PropertyGroup Condition="$(OS) == 'Windows_NT'">
<!-- Including this file will generate both the *.nupkg and *.symbols.nupkg -->
<!--https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg-->
<!-- Automatically generate package on build https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli#automatically-generate-package-on-build -->
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>

<!-- Documenting your code with XML comments https://docs.microsoft.com/en-us/dotnet/csharp/codedoc -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<!-- Creating symbol packages (.snupkg) https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg -->
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<!-- Include the PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<PropertyGroup>
<!-- These are the common properties used when generating the nupkg -->
<!-- https://docs.microsoft.com/en-us/nuget/schema/msbuild-targets -->
<!-- These are the common properties used when generating the nupkg https://docs.microsoft.com/en-us/nuget/schema/msbuild-targets -->
<Company>Microsoft</Company>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<!-- <PackageVersion>Defined in GlobalStaticVersion.props</PackageVersion> -->
Expand Down Expand Up @@ -55,4 +62,41 @@
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
</PropertyGroup>

<Target Name="FixXmlDocumentation" AfterTargets="AfterBuild" DependsOnTargets="AfterBuild" Condition="$(OS) == 'Windows_NT'">
<!-- This target will add an English localization tag to our xml documentation file. -->
<InjectXmlLanguage FilePath="$(OutputPath)\$(AssemblyName).XML" />
</Target>

<UsingTask TaskName="InjectXmlLanguage" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<FilePath ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Using Namespace="System.Diagnostics" />
<Using Namespace="System.IO" />
<!--
Not sure where the requirement of xml:lang="en" came from. But to address it - hacking is the only way now:
https://social.msdn.microsoft.com/forums/en-us/70b984eb-f490-4494-8fbc-12fe4a62e5e4/xmllang-on-doc-for-xml-doc-comments?forum=xmlandnetfx
-->
<Code Type="Fragment" Language="cs">
<![CDATA[
Log.LogMessage(MessageImportance.High, "InjectXmlLanguage -> {0}", FilePath);
if (File.Exists(FilePath))
{
string text = File.ReadAllText(FilePath);
text = text.Replace("<doc>", "<doc xml:lang=\"en\">");
File.WriteAllText(FilePath, text);
}
else
{
Log.LogError("InjectXmlLanguage: Assembly XML Doc file not found in bin folder.");
}
]]>
</Code>
</Task>
</UsingTask>

</Project>
10 changes: 4 additions & 6 deletions .rulesets/ApplicationInsightsSDKRules.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<Rule Id="CA1049" Action="Warning" />
<Rule Id="CA1060" Action="Warning" />
<Rule Id="CA1061" Action="Warning" />
<!-- Disabling this check "CA1063: Implement IDisposable correctly".
This analyzer has a bug which fails the build, https://github.com/dotnet/roslyn-analyzers/issues/1815 -->
<Rule Id="CA1063" Action="None" />
<Rule Id="CA1063" Action="Warning" />
<Rule Id="CA1065" Action="Warning" />
<!-- Suppressing Message "Do not pass literals as localized parameters" because we do not localize our SDK -->
<Rule Id="CA1303" Action="None" />
<Rule Id="CA1304" Action="Warning" />
<Rule Id="CA1305" Action="Warning" />
<Rule Id="CA1307" Action="Warning" />
Expand Down Expand Up @@ -85,9 +85,7 @@
<Rule Id="CA2207" Action="Warning" />
<Rule Id="CA2210" Action="None" />
<Rule Id="CA2212" Action="Warning" />
<!-- Disabling this check "CA2213:DisposableFieldsShouldBeDisposed".
This analyzer has a bug which fails the build, https://github.com/dotnet/roslyn-analyzers/issues/1815 -->
<Rule Id="CA2213" Action="None" />
<Rule Id="CA2213" Action="Warning" />
<Rule Id="CA2214" Action="Warning" />
<Rule Id="CA2216" Action="Warning" />
<Rule Id="CA2219" Action="Warning" />
Expand Down
28 changes: 28 additions & 0 deletions .scripts/release_NupkgAudit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,31 @@ function Get-DoesXmlDocExist ([string]$dllPath) {
Test-Condition (Test-Path $docFile) $message $requirement;
}

function Get-DoesXmlDocContainsLang ([string]$dllPath) {
# CONFIRM .XML DOCUMENTATION FILE EXISTS WITH EACH DLL
[string]$docFile = $dllPath -replace ".dll", ".xml";

[bool]$result = $false;
[string]$searchString = '<doc xml:lang="en">';

if (Test-Path $docFile) {
$result = select-string -path $docFile -Pattern $searchString -Quiet;
}

$message = "XML Documentation:";
$requirement = "Must contain xml:lang='en' ";
Test-Condition ($result) $message $requirement;
}

function Get-DoesPdbExist ([string]$dllPath) {
# CONFIRM .PDB SYMBOLS EXIST WITH EACH DLL
[string]$docFile = $dllPath -replace ".dll", ".pdb";

$message = "Symbols in package:";
$requirement = "Not a requirement, but made a decision to include these in packages."
Test-Condition (Test-Path $docFile) $message $requirement;
}

function Get-DoesDllVersionsMatch ([string]$dllPath) {
# CONFIRM Assembly version matches File version
[string]$fileVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($dllPath).FileVersion;
Expand Down Expand Up @@ -322,7 +347,10 @@ function Start-EvaluateNupkg ($nupkgPath) {

Get-DoesDllVersionsMatch $_.FullName;

Get-DoesPdbExist $_.FullName;

Get-DoesXmlDocExist $_.FullName;
Get-DoesXmlDocContainsLang $_.FullName;
}
}

Expand Down
80 changes: 0 additions & 80 deletions .targets/AddXmlLanguage.targets

This file was deleted.

Loading

0 comments on commit 85b3daf

Please sign in to comment.