Skip to content

Commit

Permalink
Merge pull request #890 from dotnet/vs_fixes
Browse files Browse the repository at this point in the history
Fixes for graph builds and NET35 targeted applications
  • Loading branch information
AArnott committed Feb 8, 2023
2 parents 7d22ed6 + 9cf6efb commit d146204
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Nerdbank.GitVersioning.Tasks/AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class AssemblyVersionInfo : Microsoft.Build.Utilities.Task
/// </summary>
/// <see href="https://github.com/dotnet/Nerdbank.GitVersioning/issues/346" />
private const string CompilerDefinesAroundGeneratedCodeAttribute = "NETSTANDARD || NETFRAMEWORK || NETCOREAPP";
private const string CompilerDefinesAroundExcludeFromCodeCoverageAttribute = "NETFRAMEWORK || NETCOREAPP || NETSTANDARD2_0 || NETSTANDARD2_1";
private const string CompilerDefinesAroundExcludeFromCodeCoverageAttribute = "NET40_OR_GREATER || NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER";
private const string FileHeaderComment = @"------------------------------------------------------------------------------
<auto-generated>
This code was generated by a tool.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Target Name="GetCopyToOutputDirectoryItems" />
<Target Name="GetCopyToPublishDirectoryItems" />
<Target Name="GetTargetFrameworksWithPlatformForSingleTargetFramework" />
<Target Name="_GetCopyToOutputDirectoryItemsFromThisProject" />

<!-- This target is called by Clean or Rebuild on a referencing project. -->
<Target Name="Clean" />
Expand Down
6 changes: 3 additions & 3 deletions test/Nerdbank.GitVersioning.Tests/AssemblyInfoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace AssemblyInfo
#if NETSTANDARD || NETFRAMEWORK || NETCOREAPP
[<System.CodeDom.Compiler.GeneratedCode(""{AssemblyVersionInfo.GeneratorName}"",""{AssemblyVersionInfo.GeneratorVersion}"")>]
#endif
#if NETFRAMEWORK || NETCOREAPP || NETSTANDARD2_0 || NETSTANDARD2_1
#if NET40_OR_GREATER || NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER
[<System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage>]
#endif
type internal ThisAssembly() =
Expand Down Expand Up @@ -146,7 +146,7 @@ public void CSharpGenerator(bool? thisAssemblyClass)
{(thisAssemblyClass.GetValueOrDefault(true) ? $@"#if NETSTANDARD || NETFRAMEWORK || NETCOREAPP
[System.CodeDom.Compiler.GeneratedCode(""{AssemblyVersionInfo.GeneratorName}"",""{AssemblyVersionInfo.GeneratorVersion}"")]
#endif
#if NETFRAMEWORK || NETCOREAPP || NETSTANDARD2_0 || NETSTANDARD2_1
#if NET40_OR_GREATER || NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
#endif
internal static partial class ThisAssembly {{
Expand Down Expand Up @@ -200,7 +200,7 @@ public void VisualBasicGenerator(bool? thisAssemblyClass)
<Assembly: System.Reflection.AssemblyVersionAttribute(""1.3.0.0"")>
<Assembly: System.Reflection.AssemblyFileVersionAttribute(""1.3.1.0"")>
<Assembly: System.Reflection.AssemblyInformationalVersionAttribute("""")>
{(thisAssemblyClass.GetValueOrDefault(true) ? $@"#If NETFRAMEWORK Or NETCOREAPP Or NETSTANDARD2_0 Or NETSTANDARD2_1 Then
{(thisAssemblyClass.GetValueOrDefault(true) ? $@"#If NET40_OR_GREATER Or NETCOREAPP2_0_OR_GREATER Or NETSTANDARD2_0_OR_GREATER Then
<System.CodeDom.Compiler.GeneratedCode(""{AssemblyVersionInfo.GeneratorName}"",""{AssemblyVersionInfo.GeneratorVersion}"")>
<System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage>
Partial Friend NotInheritable Class ThisAssembly
Expand Down

0 comments on commit d146204

Please sign in to comment.