Skip to content

Commit a95ec45

Browse files
committed
Retarget from net462 to net472
This allows us to update our libgit2sharp dependency. And while projects that use NB.GV may *target* net462 without a problem, NB.GV requiring that build machines have at least net472 installed seems totally reasonable.
1 parent 2c95cc7 commit a95ec45

File tree

8 files changed

+23
-26
lines changed

8 files changed

+23
-26
lines changed

src/NerdBank.GitVersioning/Nerdbank.GitVersioning.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net472;net6.0</TargetFrameworks>
44
<GenerateDocumentationFile>true</GenerateDocumentationFile>
55
<DebugType>Full</DebugType>
66
<IsPackable>false</IsPackable>

src/Nerdbank.GitVersioning.Tasks/AssemblyVersionInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ the code is regenerated.
3737
------------------------------------------------------------------------------
3838
";
3939

40-
#if NET462
40+
#if NETFRAMEWORK
4141
private static readonly CodeGeneratorOptions CodeGeneratorOptions = new CodeGeneratorOptions
4242
{
4343
BlankLinesBetweenMembers = false,
@@ -136,7 +136,7 @@ public string BuildCode()
136136
return null;
137137
}
138138

139-
#if NET462
139+
#if NETFRAMEWORK
140140
/// <inheritdoc/>
141141
public override bool Execute()
142142
{
@@ -186,7 +186,7 @@ public override bool Execute()
186186
}
187187
#endif
188188

189-
#if !NET462
189+
#if !NETFRAMEWORK
190190
/// <inheritdoc/>
191191
public override bool Execute()
192192
{
@@ -233,7 +233,7 @@ private static byte[] GetPublicKeyFromKeyPair(byte[] keyPair)
233233
}
234234
}
235235

236-
#if NET462
236+
#if NETFRAMEWORK
237237
private static CodeMemberField CreateField<T>(string name, T value)
238238
{
239239
return new CodeMemberField(typeof(T), name)

src/Nerdbank.GitVersioning.Tasks/NativeVersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private void CreateDefines()
177177
{
178178
if (!int.TryParse(this.AssemblyLanguage, out lcid))
179179
{
180-
#if NET462
180+
#if NETFRAMEWORK
181181
try
182182
{
183183
var cultureInfo = new CultureInfo(this.AssemblyLanguage);

src/Nerdbank.GitVersioning.Tasks/Nerdbank.GitVersioning.Tasks.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net462;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net472;net6.0</TargetFrameworks>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
55

66
<NuSpecFile>Nerdbank.GitVersioning.nuspec</NuSpecFile>
@@ -41,16 +41,13 @@
4141
</ItemDefinitionGroup>
4242

4343
<ItemGroup>
44+
<PackageReference Include="Microsoft.Build.Tasks.Core" />
4445
<PackageReference Include="Nerdbank.GitVersioning.LKG" />
4546
</ItemGroup>
4647
<ItemGroup>
4748
<ProjectReference Include="..\NerdBank.GitVersioning\Nerdbank.GitVersioning.csproj" />
4849
</ItemGroup>
49-
<ItemGroup Condition="'$(TargetFramework)' == 'net462' ">
50-
<PackageReference Include="Microsoft.Build.Tasks.Core" />
51-
</ItemGroup>
5250
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
53-
<PackageReference Include="Microsoft.Build.Tasks.Core" />
5451
<PackageReference Include="System.Runtime.Loader" />
5552
</ItemGroup>
5653
<ItemGroup>

src/Nerdbank.GitVersioning.Tasks/Nerdbank.GitVersioning.Tasks.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Target Name="PackBuildOutputs" DependsOnTargets="SatelliteDllsProjectOutputGroup;DebugSymbolsProjectOutputGroup">
1111
<PropertyGroup>
1212
<BuildSubDir Condition=" '$(TargetFramework)' == 'net6.0' ">MSBuildCore\</BuildSubDir>
13-
<BuildSubDir Condition=" '$(TargetFramework)' == 'net462' ">MSBuildFull\</BuildSubDir>
13+
<BuildSubDir Condition=" '$(TargetFramework)' == 'net472' ">MSBuildFull\</BuildSubDir>
1414
</PropertyGroup>
1515
<Error Text="Unrecognized TargetFramework" Condition=" '$(BuildSubDir)' == '' " />
1616
<ItemGroup>

src/Nerdbank.GitVersioning.Tasks/Nerdbank.GitVersioning.nuspec

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ IMPORTANT: The 3.x release may produce a different version height than prior maj
1717
<repository type="git" url="https://github.com/dotnet/Nerdbank.GitVersioning.git" commit="$commit$" />
1818
</metadata>
1919
<files>
20-
<file src="$BaseOutputPath$net462\LibGit2Sharp.dll" target="build\MSBuildFull\LibGit2Sharp.dll" />
21-
<file src="$BaseOutputPath$net462\LibGit2Sharp.dll.config" target="build\MSBuildFull\LibGit2Sharp.dll.config" />
22-
<file src="$BaseOutputPath$net462\Microsoft.DotNet.PlatformAbstractions.dll" target="build\MSBuildFull\Microsoft.DotNet.PlatformAbstractions.dll" />
23-
<file src="$BaseOutputPath$net462\Nerdbank.GitVersioning.dll" target="build\MSBuildFull\Nerdbank.GitVersioning.dll" />
24-
<file src="$BaseOutputPath$net462\Nerdbank.GitVersioning.Tasks.dll" target="build\MSBuildFull\Nerdbank.GitVersioning.Tasks.dll" />
25-
<file src="$BaseOutputPath$net462\Newtonsoft.Json.dll" target="build\MSBuildFull\Newtonsoft.Json.dll" />
26-
<file src="$BaseOutputPath$net462\System.Buffers.dll" target="build\MSBuildFull\System.Buffers.dll" />
27-
<file src="$BaseOutputPath$net462\System.Memory.dll" target="build\MSBuildFull\System.Memory.dll" />
28-
<file src="$BaseOutputPath$net462\System.Numerics.Vectors.dll" target="build\MSBuildFull\System.Numerics.Vectors.dll" />
29-
<file src="$BaseOutputPath$net462\System.Runtime.CompilerServices.Unsafe.dll" target="build\MSBuildFull\System.Runtime.CompilerServices.Unsafe.dll" />
30-
<file src="$BaseOutputPath$net462\System.Text.Json.dll" target="build\MSBuildFull\System.Text.Json.dll" />
31-
<file src="$BaseOutputPath$net462\Validation.dll" target="build\MSBuildFull\Validation.dll" />
20+
<file src="$BaseOutputPath$net472\LibGit2Sharp.dll" target="build\MSBuildFull\LibGit2Sharp.dll" />
21+
<file src="$BaseOutputPath$net472\LibGit2Sharp.dll.config" target="build\MSBuildFull\LibGit2Sharp.dll.config" />
22+
<file src="$BaseOutputPath$net472\Microsoft.DotNet.PlatformAbstractions.dll" target="build\MSBuildFull\Microsoft.DotNet.PlatformAbstractions.dll" />
23+
<file src="$BaseOutputPath$net472\Nerdbank.GitVersioning.dll" target="build\MSBuildFull\Nerdbank.GitVersioning.dll" />
24+
<file src="$BaseOutputPath$net472\Nerdbank.GitVersioning.Tasks.dll" target="build\MSBuildFull\Nerdbank.GitVersioning.Tasks.dll" />
25+
<file src="$BaseOutputPath$net472\Newtonsoft.Json.dll" target="build\MSBuildFull\Newtonsoft.Json.dll" />
26+
<file src="$BaseOutputPath$net472\System.Buffers.dll" target="build\MSBuildFull\System.Buffers.dll" />
27+
<file src="$BaseOutputPath$net472\System.Memory.dll" target="build\MSBuildFull\System.Memory.dll" />
28+
<file src="$BaseOutputPath$net472\System.Numerics.Vectors.dll" target="build\MSBuildFull\System.Numerics.Vectors.dll" />
29+
<file src="$BaseOutputPath$net472\System.Runtime.CompilerServices.Unsafe.dll" target="build\MSBuildFull\System.Runtime.CompilerServices.Unsafe.dll" />
30+
<file src="$BaseOutputPath$net472\System.Text.Json.dll" target="build\MSBuildFull\System.Text.Json.dll" />
31+
<file src="$BaseOutputPath$net472\Validation.dll" target="build\MSBuildFull\Validation.dll" />
3232
<file src="$LibGit2SharpNativeBinaries$runtimes\**" target="build\runtimes\" />
3333

3434
<!-- Additional copies to work around DllNotFoundException on Mono (https://github.com/dotnet/Nerdbank.GitVersioning/issues/222) -->

test/Nerdbank.GitVersioning.Benchmarks/GetVersionBenchmarks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Nerdbank.GitVersioning.Benchmarks
1111
{
1212
[SimpleJob(RuntimeMoniker.Net70)]
13-
[SimpleJob(RuntimeMoniker.Net462, baseline: true)]
13+
[SimpleJob(RuntimeMoniker.Net472, baseline: true)]
1414
public class GetVersionBenchmarks
1515
{
1616
// You must manually clone these repositories:

test/Nerdbank.GitVersioning.Benchmarks/Nerdbank.GitVersioning.Benchmarks.csproj

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

33
<PropertyGroup>
44
<TargetFrameworks>net7.0</TargetFrameworks>
5-
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net472</TargetFrameworks>
66
<OutputType>Exe</OutputType>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<PlatformTarget>AnyCPU</PlatformTarget>

0 commit comments

Comments
 (0)