diff --git a/.gitignore b/.gitignore index d36403d..cd62915 100644 --- a/.gitignore +++ b/.gitignore @@ -128,4 +128,7 @@ src/_NCrunch_GitTools.Core/ #################### # JetBrains IDEs #################### -.idea \ No newline at end of file +.idea + +# Visual Studio 2017 +.vs diff --git a/.travis.yml b/.travis.yml index 8893245..e506c6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,14 @@ language: csharp solution: src/GitTools.Core.sln sudo: false -dotnet: 1.0.3 +dotnet: 2.1.300 dist: trusty mono: none -addons: - apt: - sources: - - sourceline: 'deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main' - key_url: 'https://apt-mo.trafficmanager.net/keys/microsoft.asc' - packages: - - dotnet-dev-1.0.3 install: # - sudo nuget update -self - dotnet restore "./src/GitTools.Core.sln" script: - - dotnet restore "./src/GitTools.Core.Tests/GitTools.Core.Tests.csproj" /p:TargetFramework=netcoreapp1.1 /verbosity:detailed - - dotnet build "./src/GitTools.Core.Tests/GitTools.Core.Tests.csproj" --configuration Debug --framework netcoreapp1.1 /verbosity:detailed - - dotnet test "./src/GitTools.Core.Tests/GitTools.Core.Tests.csproj" --framework netcoreapp1.1 --filter TestCategory!=NoMono + - dotnet restore "./src/GitTools.Core.Tests/GitTools.Core.Tests.csproj" /p:TargetFramework=netcoreapp2.0 /verbosity:detailed + - dotnet build "./src/GitTools.Core.Tests/GitTools.Core.Tests.csproj" --configuration Debug --framework netcoreapp2.0 /verbosity:detailed + - dotnet test "./src/GitTools.Core.Tests/GitTools.Core.Tests.csproj" --framework netcoreapp2.0 --filter TestCategory!=NoMono # - mono --debug --runtime=v4.0.30319 %userprofile%.nuget/packages/nunit.consolerunner/3.6.1/tools/nunit3-console.exe ./output/debug/GitTools.Core.Tests/net45/GitTools.Core.Tests.dll -where "cat != NoMono" diff --git a/src/GitTools.Core.Tests/GitTools.Core.Tests.csproj b/src/GitTools.Core.Tests/GitTools.Core.Tests.csproj index 509fd05..1ea9f94 100644 --- a/src/GitTools.Core.Tests/GitTools.Core.Tests.csproj +++ b/src/GitTools.Core.Tests/GitTools.Core.Tests.csproj @@ -4,8 +4,7 @@ Debug Any CPU Library - net46 - netcoreapp1.1;net46 + netcoreapp2.0 true @@ -22,21 +21,14 @@ - - - + + + + - - - - - - - - diff --git a/src/GitTools.Core.Tests/app.config b/src/GitTools.Core.Tests/app.config deleted file mode 100644 index 364d0b7..0000000 --- a/src/GitTools.Core.Tests/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/GitTools.Core/Git/Extensions/LibGitExtensions.cs b/src/GitTools.Core/Git/Extensions/LibGitExtensions.cs index 043eed2..e816e80 100644 --- a/src/GitTools.Core/Git/Extensions/LibGitExtensions.cs +++ b/src/GitTools.Core/Git/Extensions/LibGitExtensions.cs @@ -150,7 +150,6 @@ public static void CheckoutFilesIfExist(this IRepository repository, params stri } } -#if !NETSTANDARD1_3 public static void DumpGraph(this IRepository repository, Action writer = null, int? maxCommits = null) { DumpGraph(repository.Info.Path, writer, maxCommits); @@ -191,7 +190,7 @@ public static void DumpGraph(string workingDirectory, Action writer = nu Console.Write(output.ToString()); } } -#endif + public static string CreateGitLogArgs(int? maxCommits) { return @"log --graph --format=""%h %cr %d"" --decorate --date=relative --all --remotes=*" + (maxCommits != null ? string.Format(" -n {0}", maxCommits) : null); diff --git a/src/GitTools.Core/GitTools.Core.csproj b/src/GitTools.Core/GitTools.Core.csproj index 174fce8..b442db5 100644 --- a/src/GitTools.Core/GitTools.Core.csproj +++ b/src/GitTools.Core/GitTools.Core.csproj @@ -1,8 +1,7 @@  - + netstandard2.0 Library - netstandard1.3;net45;net40 GitTools.Core @@ -15,45 +14,15 @@ Copyright GitTools 2015. https://github.com/GitTools/GitTools.Core/blob/master/LICENSE https://raw.github.com/GitTools/GitTools.Core/master/GitTools_logo.png - - - - TRACE;NET45;NETDESKTOP - - - TRACE;NET40;NETDESKTOP - - - TRACE;LIBLOG_PORTABLE;NETSTANDARD1_3; + TRACE;LIBLOG_PORTABLE; - - - - - - - - - - - - - - - + + - - - - - - - - \ No newline at end of file diff --git a/src/GitTools.Core/Helpers/ProcessHelper.cs b/src/GitTools.Core/Helpers/ProcessHelper.cs index 2e57085..46a2116 100644 --- a/src/GitTools.Core/Helpers/ProcessHelper.cs +++ b/src/GitTools.Core/Helpers/ProcessHelper.cs @@ -1,4 +1,3 @@ -#if !NETSTANDARD1_3 namespace GitTools { using System; @@ -6,7 +5,6 @@ namespace GitTools using System.ComponentModel; using System.Diagnostics; using System.IO; - using System.Runtime.InteropServices; using System.Threading; @@ -184,33 +182,14 @@ public struct ChangeErrorMode : IDisposable public ChangeErrorMode(ErrorModes mode) { - try - { - oldMode = SetErrorMode((int)mode); - } - catch (EntryPointNotFoundException) - { - oldMode = (int)mode; - } + Environment.ExitCode = oldMode = (int) mode; } void IDisposable.Dispose() { - try - { - SetErrorMode(oldMode); - } - catch (EntryPointNotFoundException) - { - // NOTE: Mono doesn't support DllImport("kernel32.dll") and its SetErrorMode method, obviously. @asbjornu - } + Environment.ExitCode = oldMode; } - - [DllImport("kernel32.dll")] - static extern int SetErrorMode(int newMode); } } } - -#endif \ No newline at end of file