From 40a75e4be373957540643f46c21fb76f1febde74 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 Apr 2019 19:41:19 -0400 Subject: [PATCH 1/7] Update testing packages --- LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj | 13 +++++++------ appveyor.yml | 4 ++-- buildandtest.cmd | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj index c31cb9476..4b5c2a762 100644 --- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj +++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj @@ -11,12 +11,13 @@ - - - - - - + + + + + + + diff --git a/appveyor.yml b/appveyor.yml index 6d5eebafa..d0cbdbe90 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -90,7 +90,7 @@ test_script: { .\packages\OpenCover\tools\OpenCover.Console.exe ` -register:user ` - "-target:""$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.0\tools\net46\$runner""" ` + "-target:""$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.1\tools\net46\$runner""" ` "-targetargs:""$Env:APPVEYOR_BUILD_FOLDER\bin\LibGit2Sharp.Tests\Release\net46\LibGit2Sharp.Tests.dll"" -noshadow" ` "-filter:+[LibGit2Sharp]* -[LibGit2Sharp.Tests]*" ` -hideskipped:All ` @@ -98,7 +98,7 @@ test_script: } ElseIf ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $False) { - & "$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.0\tools\net46\$runner" ` + & "$Env:userprofile\.nuget\packages\xunit.runner.console\2.4.1\tools\net46\$runner" ` "$Env:APPVEYOR_BUILD_FOLDER\bin\LibGit2Sharp.Tests\Release\net46\LibGit2Sharp.Tests.dll" -noshadow } } diff --git a/buildandtest.cmd b/buildandtest.cmd index 3bc1d6656..6b4b37d52 100644 --- a/buildandtest.cmd +++ b/buildandtest.cmd @@ -31,7 +31,7 @@ dotnet build "%~dp0\" /v:minimal /nologo /property:ExtraDefine="%EXTRADEFINE%" @IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL% :: Run tests on Desktop and CoreCLR -"%userprofile%\.nuget\packages\xunit.runner.console\2.4.0\tools\net452\xunit.console.exe" "%~dp0bin\LibGit2Sharp.Tests\%Configuration%\net46\LibGit2Sharp.Tests.dll" -noshadow +"%userprofile%\.nuget\packages\xunit.runner.console\2.4.1\tools\net46\xunit.console.exe" "%~dp0bin\LibGit2Sharp.Tests\%Configuration%\net46\LibGit2Sharp.Tests.dll" -noshadow @IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL% dotnet test "%~dp0LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj" -f netcoreapp2.0 --no-restore --no-build @IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL% From 5c62df8dba76a93b59ef90973d269493f66df791 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 Apr 2019 20:00:06 -0400 Subject: [PATCH 2/7] Move to netcoreapp2.1 for tests --- LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj | 4 ++-- appveyor.yml | 2 +- buildandtest.cmd | 2 +- buildandtest.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj index 4b5c2a762..7605eb345 100644 --- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj +++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj @@ -1,7 +1,7 @@  - net46;netcoreapp2.0 + net46;netcoreapp2.1 @@ -44,4 +44,4 @@ - + \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index d0cbdbe90..3db8b2b8a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -103,7 +103,7 @@ test_script: } } -- dotnet test LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj -f netcoreapp2.0 --no-restore --no-build +- dotnet test LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj -f netcoreapp2.1 --no-restore --no-build after_test: - ps: | diff --git a/buildandtest.cmd b/buildandtest.cmd index 6b4b37d52..612161b87 100644 --- a/buildandtest.cmd +++ b/buildandtest.cmd @@ -33,7 +33,7 @@ dotnet build "%~dp0\" /v:minimal /nologo /property:ExtraDefine="%EXTRADEFINE%" :: Run tests on Desktop and CoreCLR "%userprofile%\.nuget\packages\xunit.runner.console\2.4.1\tools\net46\xunit.console.exe" "%~dp0bin\LibGit2Sharp.Tests\%Configuration%\net46\LibGit2Sharp.Tests.dll" -noshadow @IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL% -dotnet test "%~dp0LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj" -f netcoreapp2.0 --no-restore --no-build +dotnet test "%~dp0LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj" -f netcoreapp2.1 --no-restore --no-build @IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL% EXIT /B %ERRORLEVEL% diff --git a/buildandtest.sh b/buildandtest.sh index a5501a042..24994cdae 100755 --- a/buildandtest.sh +++ b/buildandtest.sh @@ -15,7 +15,7 @@ export Configuration=release # On linux we don't pack because we can't build for net40. # We just build for CoreCLR and run tests for it. dotnet restore -dotnet build LibGit2Sharp.Tests -f netcoreapp2.0 -property:ExtraDefine="$EXTRADEFINE" -fl -flp:verbosity=detailed -dotnet test LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj -f netcoreapp2.0 --no-restore --no-build +dotnet build LibGit2Sharp.Tests -f netcoreapp2.1 -property:ExtraDefine="$EXTRADEFINE" -fl -flp:verbosity=detailed +dotnet test LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj -f netcoreapp2.1 --no-restore --no-build exit $? From de2de6f2555d61ae3fae31035944422b047809a8 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 Apr 2019 20:17:49 -0400 Subject: [PATCH 3/7] Clean up project files --- LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj | 6 ++---- LibGit2Sharp/LibGit2Sharp.csproj | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj index 7605eb345..a0703f6ff 100644 --- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj +++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj @@ -22,13 +22,11 @@ - + - - PreserveNewest - + diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 4dc5085e0..7a6406cd5 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -18,14 +18,12 @@ - - TextTemplatingFileGenerator - Objects.cs - - + + + From 3ad4565dd79e80f15788ac177ed5b7892eff6385 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 Apr 2019 20:50:32 -0400 Subject: [PATCH 4/7] Disable shadow copying so all tests pass in VS runner --- LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj | 4 +--- LibGit2Sharp.Tests/xunit.runner.json | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 LibGit2Sharp.Tests/xunit.runner.json diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj index a0703f6ff..3503801c9 100644 --- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj +++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj @@ -23,10 +23,8 @@ - - - + diff --git a/LibGit2Sharp.Tests/xunit.runner.json b/LibGit2Sharp.Tests/xunit.runner.json new file mode 100644 index 000000000..e54567a36 --- /dev/null +++ b/LibGit2Sharp.Tests/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://xunit.github.io/schema/current/xunit.runner.schema.json", + "shadowCopy": false +} From f5fa5536dddbbe125dbf297f9ea32e1fbeff7d74 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 Apr 2019 20:51:29 -0400 Subject: [PATCH 5/7] Remove targets file since all platforms can sign now --- Directory.Build.targets | 7 ------- LibGit2Sharp.sln | 5 ++--- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 Directory.Build.targets diff --git a/Directory.Build.targets b/Directory.Build.targets deleted file mode 100644 index 080355c7d..000000000 --- a/Directory.Build.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - - true - - - diff --git a/LibGit2Sharp.sln b/LibGit2Sharp.sln index 43b82cf6c..a81b0ce37 100644 --- a/LibGit2Sharp.sln +++ b/LibGit2Sharp.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27009.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28803.202 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibGit2Sharp", "LibGit2Sharp\LibGit2Sharp.csproj", "{EE6ED99F-CB12-4683-B055-D28FC7357A34}" EndProject @@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .gitignore = .gitignore Targets\CodeGenerator.targets = Targets\CodeGenerator.targets Directory.Build.props = Directory.Build.props - Directory.Build.targets = Directory.Build.targets Targets\GenerateNativeDllName.targets = Targets\GenerateNativeDllName.targets nuget.config = nuget.config version.json = version.json From 97bcd0b92bbcf71176f13088e6f508b99ca6cbd3 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 Apr 2019 21:00:42 -0400 Subject: [PATCH 6/7] Update Nerdbank.GitVersioning to 2.3.138 --- LibGit2Sharp/LibGit2Sharp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 7a6406cd5..3982172fc 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -29,7 +29,7 @@ - + From 69bea2679563f834b5fce86de1f488d28a7acecf Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 Apr 2019 21:36:59 -0400 Subject: [PATCH 7/7] Update version test to account for GitVersioning change --- LibGit2Sharp.Tests/GlobalSettingsFixture.cs | 8 ++++---- LibGit2Sharp/Version.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LibGit2Sharp.Tests/GlobalSettingsFixture.cs b/LibGit2Sharp.Tests/GlobalSettingsFixture.cs index 381d13d65..55260a6f5 100644 --- a/LibGit2Sharp.Tests/GlobalSettingsFixture.cs +++ b/LibGit2Sharp.Tests/GlobalSettingsFixture.cs @@ -22,9 +22,9 @@ public void CanGetMinimumCompiledInFeatures() public void CanRetrieveValidVersionString() { // Version string format is: - // Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features) + // Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features) // Example output: - // "0.25.0-preview.52+g871d13a67f.libgit2-15e1193 (x86 - Threads, Https)" + // "0.25.0-preview.52+871d13a67f.libgit2-15e1193 (x86 - Threads, Https)" string versionInfo = GlobalSettings.Version.ToString(); @@ -33,14 +33,14 @@ public void CanRetrieveValidVersionString() // git2SharpHash: '871d13a67f' LibGit2Sharp hash. // arch: 'x86' or 'x64' libgit2 target. // git2Features: 'Threads, Ssh' libgit2 features compiled with. - string regex = @"^(?\d+\.\d+\.\d+(-[\w\-\.]+)?\+(g(?[a-f0-9]{10})\.)?libgit2-[a-f0-9]{7}) \((?\w+) - (?(?:\w*(?:, )*\w+)*)\)$"; + string regex = @"^(?\d+\.\d+\.\d+(-[\w\-\.]+)?\+((?[a-f0-9]{10})\.)?libgit2-[a-f0-9]{7}) \((?\w+) - (?(?:\w*(?:, )*\w+)*)\)$"; Assert.NotNull(versionInfo); Match regexResult = Regex.Match(versionInfo, regex); Assert.True(regexResult.Success, "The following version string format is enforced:" + - "Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features). " + + "Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features). " + "But found \"" + versionInfo + "\" instead."); } diff --git a/LibGit2Sharp/Version.cs b/LibGit2Sharp/Version.cs index 747529e84..3795382a3 100644 --- a/LibGit2Sharp/Version.cs +++ b/LibGit2Sharp/Version.cs @@ -55,7 +55,7 @@ private string RetrieveAbbrevShaFrom(string sha) /// /// /// The format of the version number is as follows: - /// Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features) + /// Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features) /// /// public override string ToString()