Skip to content

Commit a18b677

Browse files
committed
Make build task only target .NET Standard 2.0.
1 parent 71b4f19 commit a18b677

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

build/GitBuildInfo.SourceGenerator.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup>
44
<TaskAssembly>$(MSBuildThisFileDirectory)..\tasks\netstandard2.0\GitBuildInfo.dll</TaskAssembly>
5-
<TaskAssembly Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\net472\GitBuildInfo.dll</TaskAssembly>
65
</PropertyGroup>
76

87
<UsingTask TaskName="GitBuildInfo.GitInfoTask" AssemblyFile="$(TaskAssembly)" />

src/GitBuildInfo.SourceGenerator/Directory.Build.props

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<IsPackable>true</IsPackable>
66
<Version>1.0.13</Version>
7-
<PackageReleaseNotes>Fixed issue where building can result in a build performance decrease due to having the build task being inline.</PackageReleaseNotes>
7+
<PackageReleaseNotes>Fixed issue where building can result in a build performance decrease due to having the build task being inline.
8+
Also made build task target .NET Standard 2.0 only.
9+
I think this one should work for everyone even for those using .NET Framework's msbuild.</PackageReleaseNotes>
810
<Copyright>Copyright (c) 2021</Copyright>
911
<!-- Suppresses the warnings about the package not having assemblies in lib/*/.dll.-->
1012
<NoPackageAnalysis>true</NoPackageAnalysis>

src/GitBuildInfo/Directory.Build.props

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
<PropertyGroup>
44
<CheckEolTargetFramework>false</CheckEolTargetFramework>
5-
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
5+
<TargetFramework>netstandard2.0</TargetFramework>
66
<!-- We need to pack this up inside of the source generator package. -->
77
<IsPackable>false</IsPackable>
88
<Version>0.0.0</Version>
99
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
1010
<Description>A MSBuild task that generates the git build information.</Description>
11+
<NoWarn>$(NoWarn);S3903</NoWarn>
12+
<!--
13+
This wrongfully lists the analyzers used in this project as dependencies.
14+
Disable this to prevent the possibility that the task might fail to load.
15+
-->
16+
<GenerateDependencyFile>false</GenerateDependencyFile>
1117
</PropertyGroup>
1218

1319
<Import Project="../../Directory.Build.props" />

src/GitBuildInfo/GitInfoTask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private string RunGit(string arguments)
9090
}
9191
}
9292

93-
private class GitInfo
93+
private sealed class GitInfo
9494
{
9595
public string Head { get; set; }
9696

0 commit comments

Comments
 (0)