Skip to content

Commit

Permalink
Added .NET Core support & updated dependencies (#40)
Browse files Browse the repository at this point in the history
* Added .NET Core 2.1 support & merged project files
* AppVeyopr use VS2017 image&.NET Restore
* Update Solution to VS15
* Update reference versions
  • Loading branch information
luvies authored and jdeering committed Dec 21, 2018
1 parent 68bb92d commit aac5494
Show file tree
Hide file tree
Showing 18 changed files with 129 additions and 428 deletions.
Binary file modified .nuget/NuGet.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion .nuget/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit.Runners" version="2.6.4" />
<package id="NUnit.Console" version="3.8.0" />
<package id="OpenCover" version="4.5.3723" />
</packages>
110 changes: 8 additions & 102 deletions Coveralls.Lib/Coveralls.csproj
Original file line number Diff line number Diff line change
@@ -1,108 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\LibGit2Sharp.0.21.0.176\build\net40\LibGit2Sharp.props" Condition="Exists('..\packages\LibGit2Sharp.0.21.0.176\build\net40\LibGit2Sharp.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F43802C1-065A-4735-8E2D-ECA06493B79B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Coveralls</RootNamespace>
<AssemblyName>Coveralls</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<NuGetPackageImportStamp>c38f1737</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<BuildToolsFxCopVersion>1.0.1</BuildToolsFxCopVersion>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<RunCodeAnalysis>False</RunCodeAnalysis>
<CodeAnalysisRuleSet>BasicDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisTreatWarningsAsErrors>True</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;CODE_ANALYSIS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisRuleSet>BasicCorrectnessRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisTreatWarningsAsErrors>True</CodeAnalysisTreatWarningsAsErrors>
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
</PropertyGroup>
<ItemGroup>
<Reference Include="LibGit2Sharp, Version=0.21.0.176, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\LibGit2Sharp.0.21.0.176\lib\net40\LibGit2Sharp.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AppVeyorGit.cs" />
<Compile Include="CoverageFile.cs" />
<Compile Include="CoverallsBootstrap.cs" />
<Compile Include="CoverallsData.cs" />
<Compile Include="CoverallsException.cs" />
<Compile Include="GitData.cs" />
<Compile Include="GitRepository.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="ICommandOptions.cs" />
<Compile Include="JenkinsGit.cs" />
<Compile Include="LocalGit.cs" />
<Compile Include="Parser\AutoParser.cs" />
<Compile Include="Parser\ICoverageParser.cs" />
<Compile Include="IFileSystem.cs" />
<Compile Include="IGitRepository.cs" />
<Compile Include="Parser\CoberturaCoverageParser.cs" />
<Compile Include="Parser\OpenCoverParser.cs" />
<Compile Include="ParserType.cs" />
<Compile Include="Parser\BaseParser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PathTools.cs" />
<Compile Include="StringTools.cs" />
</ItemGroup>

<ItemGroup>
<None Include="CodeAnalysisRules.ruleset" />
<None Include="packages.config" />
<PackageReference Include="LibGit2Sharp" Version="0.25.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
<Error Condition="!Exists('..\packages\LibGit2Sharp.0.21.0.176\build\net40\LibGit2Sharp.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.0.21.0.176\build\net40\LibGit2Sharp.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->

</Project>
2 changes: 1 addition & 1 deletion Coveralls.Lib/JenkinsGit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override string CurrentBranch
{
_branch = Environment.GetEnvironmentVariable("GIT_BRANCH");

if (_branch.IsBlank()) _branch = _repository.Head.Name;
if (_branch.IsBlank()) _branch = _repository.Head.CanonicalName;

// The git branch is of the form origin/<branch> or origin/pr/1152/merge. The links on the coveralls page
// will link to that branch, but only the first form (without origin) will work. Strip away all but the last
Expand Down
9 changes: 5 additions & 4 deletions Coveralls.Lib/LocalGit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ public LocalGit(IFileSystem fileSystem)
while (!directory.EnumerateDirectories().Any(x => x.Name == ".git"))
{
directory = directory.Parent;
if (directory == directory.Root) break;
// if parent is null, we are at root directory
if (directory.Parent == null) break;
}

_repository = new Repository(directory.FullName + "\\.git");
_repository = new Repository(Path.Combine(directory.FullName, ".git"));
}

public sealed override void Dispose()
Expand All @@ -37,7 +38,7 @@ public sealed override void Dispose()

public override IEnumerable<string> Branches
{
get { return _repository.Branches.Select(x => x.Name); }
get { return _repository.Branches.Select(x => x.CanonicalName); }
}

public override IEnumerable<CommitData> Commits
Expand All @@ -57,7 +58,7 @@ public override IEnumerable<CommitData> Commits
}
}

public override string CurrentBranch { get { return _repository.Head.Name; } }
public override string CurrentBranch { get { return _repository.Head.CanonicalName; } }
public override CommitData Head
{
get { return Commits.First(); }
Expand Down
61 changes: 27 additions & 34 deletions Coveralls.Lib/PathTools.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
using System;
using System.Globalization;
using System.IO;
using System;
using System.Globalization;
using System.IO;

namespace Coveralls
{
public static class PathTools
{
public static string ToUnixPath(this string path)
{
if (string.IsNullOrEmpty(path)) return "";

return path.Replace('\\', '/');
}

public static string ToRelativePath(this string fullPath, string baseFolder)
{
if (string.IsNullOrEmpty(fullPath)) return fullPath;
if (string.IsNullOrEmpty(baseFolder)) return fullPath;

if (fullPath.Equals(baseFolder)) return "";

var pathUri = new Uri(fullPath);

if (!baseFolder.EndsWith(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal))
{
baseFolder += Path.DirectorySeparatorChar;
}
var folderUri = new Uri(baseFolder);

var relativeUri = folderUri.MakeRelativeUri(pathUri);
var relativePath = relativeUri.ToString().Replace('/', Path.DirectorySeparatorChar);

return Uri.UnescapeDataString(relativePath).ToUnixPath();
}
}
{
public static class PathTools
{
public static string ToUnixPath(this string path)
{
if (string.IsNullOrEmpty(path)) return "";

return path.Replace('\\', '/');
}

public static string ToRelativePath(this string fullPath, string baseFolder)
{
if (string.IsNullOrEmpty(fullPath)) return fullPath;
if (string.IsNullOrEmpty(baseFolder)) return fullPath;

if (fullPath.Equals(baseFolder)) return "";
if (baseFolder[baseFolder.Length - 1] != '\\' && baseFolder[baseFolder.Length - 1] != '/')
baseFolder += Path.DirectorySeparatorChar;

var pathUri = new Uri(fullPath, UriKind.Absolute);
var baseUri = new Uri(baseFolder, UriKind.Absolute);
return baseUri.MakeRelativeUri(pathUri).ToString();
}
}
}
5 changes: 3 additions & 2 deletions Coveralls.Lib/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BuildTools.FxCop" version="1.0.1" targetFramework="net45" />
<package id="LibGit2Sharp" version="0.21.0.176" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
<package id="LibGit2Sharp" version="0.25.0" targetFramework="net462" />
<package id="LibGit2Sharp.NativeBinaries" version="1.0.210" targetFramework="net462" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
</packages>
Loading

0 comments on commit aac5494

Please sign in to comment.