Skip to content

Commit c72b740

Browse files
authored
Merge pull request #1318 from AArnott/portable
Target .NET Standard 1.3
2 parents e656b51 + dc8e4a3 commit c72b740

File tree

97 files changed

+1603
-1761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1603
-1761
lines changed

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,5 @@ _ReSharper*/
3636
*.userprefs
3737
*.swp
3838
*.DotSettings
39-
#Ignore custom generated files
40-
LibGit2Sharp/Core/UniqueIdentifier.cs
41-
LibGit2Sharp/Core/NativeDllName.cs
4239

43-
!nuget.package/build/
4440
_NCrunch_LibGit2Sharp/
45-
packages/

.nuget/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

.travis.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,25 @@
22
# see travis-ci.org for details
33

44
language: csharp
5-
mono:
6-
- 4.8.0
5+
dist: trusty
6+
dotnet: 1.0.1
7+
mono: none
78

89
os:
910
- osx
1011
- linux
1112

12-
env:
13-
global:
14-
- MONO_OPTIONS=--debug
15-
16-
install:
17-
- curl -L -o nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
18-
- mono nuget.exe restore LibGit2Sharp.sln
19-
2013
before_install:
2114
- date -u
2215
- uname -a
2316
- env | sort
2417

25-
solution: LibGit2Sharp.sln
18+
install:
19+
- git fetch --unshallow
2620

2721
# Build libgit2, LibGit2Sharp and run the tests
2822
script:
29-
- ./build.libgit2sharp.sh 'LEAKS_IDENTIFYING'
23+
- ./buildandtest.sh 'LEAKS_IDENTIFYING'
3024

3125
# Only watch the development branch
3226
branches:

CI/build.msbuild

Lines changed: 0 additions & 58 deletions
This file was deleted.

CodeGeneration/CodeGeneration.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>netstandard1.5</TargetFramework>
4+
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
5+
<IsPackable>false</IsPackable>
6+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="CodeGeneration.Roslyn" Version="$(CodeGenerationRoslynVersion)" />
11+
</ItemGroup>
12+
</Project>

CodeGeneration/OfferFriendlyInteropOverloadsGenerator.cs

Lines changed: 310 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net40;netstandard1.0</TargetFrameworks>
4+
<SignAssembly>true</SignAssembly>
5+
<AssemblyOriginatorKeyFile>..\libgit2sharp.snk</AssemblyOriginatorKeyFile>
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="CodeGeneration.Roslyn.Attributes" Version="$(CodeGenerationRoslynVersion)" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Text;
5+
6+
namespace LibGit2Sharp
7+
{
8+
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false)]
9+
[Conditional("CodeGeneration")]
10+
public class CustomMarshalerAttribute : Attribute
11+
{
12+
/// <summary>
13+
/// Initializes a new instance of the <see cref="CustomMarshalerAttribute"/> class.
14+
/// </summary>
15+
/// <param name="customMarshaler">The type that derives from ICustomMarshaler.</param>
16+
/// <param name="friendlyType">The type to expose in the generated overload.</param>
17+
public CustomMarshalerAttribute(Type customMarshaler, Type friendlyType)
18+
{
19+
}
20+
}
21+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Diagnostics;
3+
using CodeGeneration.Roslyn;
4+
5+
namespace LibGit2Sharp
6+
{
7+
/// <summary>
8+
/// Causes generation of an overload of a P/Invoke method that has a more friendly signature.
9+
/// </summary>
10+
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
11+
[CodeGenerationAttribute("CodeGeneration.OfferFriendlyInteropOverloadsGenerator, CodeGeneration, Version=" + ThisAssembly.AssemblyVersion + ", Culture=neutral, PublicKeyToken=null")]
12+
[Conditional("CodeGeneration")]
13+
public class OfferFriendlyInteropOverloadsAttribute : Attribute
14+
{
15+
}
16+
}

Directory.Build.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project>
2+
<PropertyGroup>
3+
<OutputPath>$(MSBuildThisFileDirectory)bin\$(MSBuildProjectName)\$(Configuration)\</OutputPath>
4+
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
5+
6+
<CodeGenerationRoslynVersion>0.3.13-gfce1c8ba1e</CodeGenerationRoslynVersion>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Nerdbank.GitVersioning" Version="1.6.25" PrivateAssets="all" />
11+
</ItemGroup>
12+
</Project>

Directory.Build.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
<PropertyGroup>
3+
<PublicSign Condition=" '$(AssemblyOriginatorKeyFile)' != '' and '$(OS)' != 'Windows_NT' ">true</PublicSign>
4+
</PropertyGroup>
5+
</Project>

Lib/.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

Lib/CustomBuildTasks/CustomBuildTasks.csproj

Lines changed: 0 additions & 43 deletions
This file was deleted.
-5.5 KB
Binary file not shown.

Lib/CustomBuildTasks/GenerateNativeDllNameTask.cs

Lines changed: 0 additions & 41 deletions
This file was deleted.

Lib/CustomBuildTasks/GenerateUniqueIdentifierTask.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

Lib/NuGet/NuGet.exe

-4.38 MB
Binary file not shown.

Lib/NuGet/NuGet.license.txt

Lines changed: 0 additions & 29 deletions
This file was deleted.

LibGit2Sharp.Tests/ArchiveTarFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public void CanArchiveACommitWithDirectoryAsTar()
3030

3131
repo.ObjectDatabase.Archive(commit, archivePath);
3232

33-
using (var expectedStream = new StreamReader(Path.Combine(ResourcesDirectory.FullName, "expected_archives/commit_with_directory.tar")))
34-
using (var actualStream = new StreamReader(archivePath))
33+
using (var expectedStream = new StreamReader(File.OpenRead(Path.Combine(ResourcesDirectory.FullName, "expected_archives/commit_with_directory.tar"))))
34+
using (var actualStream = new StreamReader(File.OpenRead(archivePath)))
3535
{
3636
string expected = expectedStream.ReadToEnd();
3737
string actual = actualStream.ReadToEnd();

LibGit2Sharp.Tests/BranchFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ public void TrackedBranchExistsFromDefaultConfigInEmptyClone()
11131113

11141114
using (var emptyRepo = new Repository(repoPath))
11151115
{
1116-
uri = new Uri(emptyRepo.Info.Path);
1116+
uri = new Uri($"file://{emptyRepo.Info.Path}");
11171117
}
11181118

11191119
SelfCleaningDirectory scd2 = BuildSelfCleaningDirectory();

0 commit comments

Comments
 (0)