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

Fixes for graph builds and NET35 targeted applications #890

Merged
merged 2 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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