Skip to content

Commit 7f59d22

Browse files
authored
Merge pull request #1674 from libgit2/updates
Housekeeping and cleanup updates
2 parents d47cfd9 + 69bea26 commit 7f59d22

10 files changed

+34
-43
lines changed

Diff for: Directory.Build.targets

-7
This file was deleted.

Diff for: LibGit2Sharp.Tests/GlobalSettingsFixture.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public void CanGetMinimumCompiledInFeatures()
2222
public void CanRetrieveValidVersionString()
2323
{
2424
// Version string format is:
25-
// Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features)
25+
// Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features)
2626
// Example output:
27-
// "0.25.0-preview.52+g871d13a67f.libgit2-15e1193 (x86 - Threads, Https)"
27+
// "0.25.0-preview.52+871d13a67f.libgit2-15e1193 (x86 - Threads, Https)"
2828

2929
string versionInfo = GlobalSettings.Version.ToString();
3030

@@ -33,14 +33,14 @@ public void CanRetrieveValidVersionString()
3333
// git2SharpHash: '871d13a67f' LibGit2Sharp hash.
3434
// arch: 'x86' or 'x64' libgit2 target.
3535
// git2Features: 'Threads, Ssh' libgit2 features compiled with.
36-
string regex = @"^(?<version>\d+\.\d+\.\d+(-[\w\-\.]+)?\+(g(?<git2SharpHash>[a-f0-9]{10})\.)?libgit2-[a-f0-9]{7}) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$";
36+
string regex = @"^(?<version>\d+\.\d+\.\d+(-[\w\-\.]+)?\+((?<git2SharpHash>[a-f0-9]{10})\.)?libgit2-[a-f0-9]{7}) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$";
3737

3838
Assert.NotNull(versionInfo);
3939

4040
Match regexResult = Regex.Match(versionInfo, regex);
4141

4242
Assert.True(regexResult.Success, "The following version string format is enforced:" +
43-
"Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features). " +
43+
"Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features). " +
4444
"But found \"" + versionInfo + "\" instead.");
4545
}
4646

Diff for: LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
4+
<TargetFrameworks>net46;netcoreapp2.1</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>
@@ -11,23 +11,20 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
15-
<PackageReference Include="Moq" Version="4.9.0" />
16-
<PackageReference Include="xunit" Version="2.4.0" />
17-
<PackageReference Include="xunit.runner.console" Version="2.4.0" />
18-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
19-
<PackageReference Include="xunit.skippablefact" Version="1.3.6" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
15+
<PackageReference Include="Moq" Version="4.10.1" />
16+
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
17+
<PackageReference Include="xunit" Version="2.4.1" />
18+
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
19+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
20+
<PackageReference Include="xunit.skippablefact" Version="1.3.12" />
2021
</ItemGroup>
2122

2223
<ItemGroup>
2324
<Compile Include="..\LibGit2Sharp\Core\Platform.cs" Link="TestHelpers\Platform.cs" />
24-
<Compile Remove="desktop\**" Condition=" '$(TargetFramework)' != 'net46' " />
25-
</ItemGroup>
26-
27-
<ItemGroup>
28-
<Content Include="Resources\**\*.*">
29-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30-
</Content>
25+
<Compile Remove="desktop\**" Condition="'$(TargetFramework)' != 'net46'" />
26+
<Content Include="Resources\**\*.*" CopyToOutputDirectory="PreserveNewest" />
27+
<None Update="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
3128
</ItemGroup>
3229

3330
<Target Name="CopyTestAppExes" AfterTargets="ResolveProjectReferences">
@@ -43,4 +40,4 @@
4340

4441
<Import Project="..\Targets\GenerateNativeDllName.targets" />
4542

46-
</Project>
43+
</Project>

Diff for: LibGit2Sharp.Tests/xunit.runner.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://xunit.github.io/schema/current/xunit.runner.schema.json",
3+
"shadowCopy": false
4+
}

Diff for: LibGit2Sharp.sln

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 15
3-
VisualStudioVersion = 15.0.27009.1
2+
# Visual Studio Version 16
3+
VisualStudioVersion = 16.0.28803.202
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibGit2Sharp", "LibGit2Sharp\LibGit2Sharp.csproj", "{EE6ED99F-CB12-4683-B055-D28FC7357A34}"
66
EndProject
@@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1111
.gitignore = .gitignore
1212
Targets\CodeGenerator.targets = Targets\CodeGenerator.targets
1313
Directory.Build.props = Directory.Build.props
14-
Directory.Build.targets = Directory.Build.targets
1514
Targets\GenerateNativeDllName.targets = Targets\GenerateNativeDllName.targets
1615
nuget.config = nuget.config
1716
version.json = version.json

Diff for: LibGit2Sharp/LibGit2Sharp.csproj

+4-6
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,18 @@
1818

1919
<ItemGroup>
2020
<CodeAnalysisDictionary Include="CustomDictionary.xml" />
21-
<None Include="Core\Handles\Objects.tt">
22-
<Generator>TextTemplatingFileGenerator</Generator>
23-
<LastGenOutput>Objects.cs</LastGenOutput>
24-
</None>
2521
<None Include="..\README.md" Pack="true" PackagePath="App_Readme\" />
2622
<None Include="..\LICENSE.md" Pack="true" PackagePath="App_Readme\" />
2723
<None Include="..\CHANGES.md" Pack="true" PackagePath="App_Readme\" />
28-
<Compile Update="Core\Handles\Objects.cs" DependentUpon="Objects.tt" />
24+
<None Update="Core\Handles\Objects.tt" Generator="TextTemplatingFileGenerator" LastGenOutput="Objects.cs" />
25+
<Compile Update="Core\Handles\Objects.cs" DependentUpon="Objects.tt" DesignTime="True" AutoGen="True" />
26+
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" /> <!-- Needed for T4 generation -->
2927
</ItemGroup>
3028

3129
<ItemGroup>
3230
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[2.0.278]" PrivateAssets="none" />
3331
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="all" />
34-
<PackageReference Include="Nerdbank.GitVersioning" Version="2.2.13" PrivateAssets="all" />
32+
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.138" PrivateAssets="all" />
3533
</ItemGroup>
3634

3735
<Import Project="..\Targets\CodeGenerator.targets" />

Diff for: LibGit2Sharp/Version.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private string RetrieveAbbrevShaFrom(string sha)
5555
/// </summary>
5656
/// <para>
5757
/// The format of the version number is as follows:
58-
/// <para>Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features)</para>
58+
/// <para>Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features)</para>
5959
/// </para>
6060
/// <returns></returns>
6161
public override string ToString()

Diff for: appveyor.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,20 @@ test_script:
9090
{
9191
.\packages\OpenCover\tools\OpenCover.Console.exe `
9292
-register:user `
93-
"-target:""$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.0\tools\net46\$runner""" `
93+
"-target:""$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.1\tools\net46\$runner""" `
9494
"-targetargs:""$Env:APPVEYOR_BUILD_FOLDER\bin\LibGit2Sharp.Tests\Release\net46\LibGit2Sharp.Tests.dll"" -noshadow" `
9595
"-filter:+[LibGit2Sharp]* -[LibGit2Sharp.Tests]*" `
9696
-hideskipped:All `
9797
-output:opencoverCoverage.xml
9898
}
9999
ElseIf ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $False)
100100
{
101-
& "$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.0\tools\net46\$runner" `
101+
& "$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.1\tools\net46\$runner" `
102102
"$Env:APPVEYOR_BUILD_FOLDER\bin\LibGit2Sharp.Tests\Release\net46\LibGit2Sharp.Tests.dll" -noshadow
103103
}
104104
}
105105
106-
- dotnet test LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj -f netcoreapp2.0 --no-restore --no-build
106+
- dotnet test LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj -f netcoreapp2.1 --no-restore --no-build
107107

108108
after_test:
109109
- ps: |

Diff for: buildandtest.cmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ dotnet build "%~dp0\" /v:minimal /nologo /property:ExtraDefine="%EXTRADEFINE%"
3131
@IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
3232

3333
:: Run tests on Desktop and CoreCLR
34-
"%userprofile%\.nuget\packages\xunit.runner.console\2.4.0\tools\net452\xunit.console.exe" "%~dp0bin\LibGit2Sharp.Tests\%Configuration%\net46\LibGit2Sharp.Tests.dll" -noshadow
34+
"%userprofile%\.nuget\packages\xunit.runner.console\2.4.1\tools\net46\xunit.console.exe" "%~dp0bin\LibGit2Sharp.Tests\%Configuration%\net46\LibGit2Sharp.Tests.dll" -noshadow
3535
@IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
36-
dotnet test "%~dp0LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj" -f netcoreapp2.0 --no-restore --no-build
36+
dotnet test "%~dp0LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj" -f netcoreapp2.1 --no-restore --no-build
3737
@IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
3838

3939
EXIT /B %ERRORLEVEL%

Diff for: buildandtest.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export Configuration=release
1515
# On linux we don't pack because we can't build for net40.
1616
# We just build for CoreCLR and run tests for it.
1717
dotnet restore
18-
dotnet build LibGit2Sharp.Tests -f netcoreapp2.0 -property:ExtraDefine="$EXTRADEFINE" -fl -flp:verbosity=detailed
19-
dotnet test LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj -f netcoreapp2.0 --no-restore --no-build
18+
dotnet build LibGit2Sharp.Tests -f netcoreapp2.1 -property:ExtraDefine="$EXTRADEFINE" -fl -flp:verbosity=detailed
19+
dotnet test LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj -f netcoreapp2.1 --no-restore --no-build
2020

2121
exit $?

0 commit comments

Comments
 (0)