Skip to content

Target .NET Standard 1.3 #1318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 143 commits into from
Jun 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
442f626
Move most source into a Shared Project
AArnott Mar 29, 2016
d7ef5f3
Add portable project
AArnott Mar 29, 2016
68ee9b7
Fix default namespace in portable project
AArnott Mar 29, 2016
e08f9e5
Consistently apply NET40 compiler constant to all configs
AArnott Mar 30, 2016
ef51bef
Suppress serializable exceptions for portable
AArnott Mar 30, 2016
61176b8
Fix build break in test project
AArnott Mar 30, 2016
6704b7d
Add #if around ReliabilityContractAttribute
AArnott Mar 30, 2016
b6aa86d
Fix some reflection code for portable
AArnott Mar 30, 2016
2e32bb0
Fix GetType() instance invocations
AArnott Mar 30, 2016
4cc6acd
Fix build warnings and remove project.lock.json
AArnott Mar 31, 2016
6a2fb6b
Use Nerdbank.GitVersioning
AArnott Mar 31, 2016
e94a7b2
Add code generation functionality
AArnott Mar 31, 2016
9067041
Activate code generation for many methods
AArnott Mar 31, 2016
3c8ab4b
Apply code generator to more signatures
AArnott Mar 31, 2016
370cdfa
Replace CustomMarshaler use on return values and out parameters
AArnott Apr 1, 2016
2557d8c
Get code generation working in portable project
AArnott Apr 1, 2016
9abdff2
Add X509Certificates reference
AArnott Apr 2, 2016
250599c
Fix a couple minor compile breaks in portable
AArnott Apr 2, 2016
a4a2383
Fix decoding compiler breaks
AArnott Apr 2, 2016
476e4be
Merge remote-tracking branch 'upstream/master' into portable
AArnott Apr 18, 2016
da5e55c
Fix a couple new compiler errors in portable
AArnott Apr 18, 2016
bf7ad91
Avoid Trace and Console use in portable
AArnott Apr 18, 2016
e7d9457
Add SecureString type
AArnott Apr 18, 2016
5d58dfa
Skipping initializing nativeLibraryPath on portable
AArnott Apr 18, 2016
7971833
Add portable BufferedStream
AArnott Apr 18, 2016
12253be
Fix compile error around exporting SecureString
AArnott Apr 18, 2016
41ee5d3
Avoid CriticalFinalizerObject on portable
AArnott Apr 18, 2016
fe10951
Portable project builds!
AArnott Apr 18, 2016
aceef06
Merge upstream/master into portable
AArnott May 1, 2016
0bae5e3
Enable tracing on portable
AArnott May 1, 2016
555940f
Fix refs to generate source files
AArnott May 1, 2016
2900cf5
Update test to accept enriched AssemblyInformationalVersion
AArnott May 2, 2016
b30f625
Apply all unit tests to portable library as well
AArnott May 2, 2016
f5caa81
Tests of portable library pass on Windows!
AArnott May 3, 2016
1315693
Remove remaining project use of packages.config
AArnott May 3, 2016
02a4e53
Merge remote-tracking branch 'upstream/master' into portable
AArnott May 8, 2016
b44040d
Fix build error
AArnott May 8, 2016
e6c3696
Update to latest NB.GV
AArnott May 8, 2016
682273a
Fix some build warnings about double imports
AArnott Jun 22, 2016
14555f3
Update bundled nuget to 3.4.4
Jun 27, 2016
ebd3b1f
Add `portable` branch to travis
Jun 27, 2016
9a94aa9
Add `portable` branch to appveyor
Jun 27, 2016
2d1f183
Inspect nuget version during build
Jun 27, 2016
a85fc40
appveyor: use bundled nuget
Jun 27, 2016
2146e59
travis: use bundled nuget
Jun 27, 2016
9539829
Merge remote-tracking branch 'upstream/portable' into portable
AArnott Jul 2, 2016
8566e31
Merge remote-tracking branch 'upstream/master' into portable
AArnott Jul 2, 2016
d225524
Update to netstandard1.3
ah- Jul 3, 2016
3f95f3c
Add missing NET40 define for release build
ah- Jul 3, 2016
61aaf28
Update nerdbank.gitversioning
AArnott Jul 4, 2016
da0adef
Use NuGet 3.5.0 beta 2
AArnott Jul 4, 2016
a07390c
Fix line ending
AArnott Jul 4, 2016
ba8c334
Fix package restore error
AArnott Jul 4, 2016
fed0ecf
Target netstandard1.3
AArnott Jul 4, 2016
d5d6c38
Touch ups on packaging scripts
AArnott Jul 4, 2016
dfb9129
tweaks to appveyor.yml to get it building
shiftkey Jul 4, 2016
403971f
disabling coverity rather than wasting more time looking for docs
shiftkey Jul 4, 2016
e876ff8
fix capitalization
AArnott Jul 4, 2016
3129cc7
Use mono patched nuget
ah- Sep 18, 2016
61372a7
Update Nerdbank.GitVersioning to 1.5.51
AArnott Sep 18, 2016
c0cf832
Merge remote-tracking branch 'upstream/master' into portable
AArnott Sep 18, 2016
803e499
Replace magic strings with nameof
AArnott Sep 19, 2016
e710875
Merge upstream/master into portable
AArnott Jan 21, 2017
09c71e0
Make portable library share assembly name with desktop
AArnott Jan 21, 2017
4998f1b
Update portable dependency on native
AArnott Jan 21, 2017
38cfbcc
Ignore nupkg files
AArnott Jan 21, 2017
5610f27
Fix packaging to include portable assembly
AArnott Jan 21, 2017
f2543ec
Fix nuget package to include native binaries
AArnott Jan 22, 2017
9fca61f
Merge remote-tracking branch 'upstream/master' into portable
AArnott Feb 11, 2017
4ca2bbb
Merge remote-tracking branch 'upstream/master' into portable
AArnott Mar 12, 2017
d851767
Update code generation to use .NET SDK projects
AArnott Mar 12, 2017
a6f4cd6
All projects rewritten as .NET SDK projects
AArnott Mar 12, 2017
fe1533a
Make 'dotnet pack' work
AArnott Mar 12, 2017
64a07e2
Bring back ExtraDefine
AArnott Mar 12, 2017
920e596
Fix build breaks on appveyor
AArnott Mar 12, 2017
48f73d0
Get build working on linux via dotnet CLI
AArnott Mar 21, 2017
4b2be46
fix comment typo
AArnott Mar 22, 2017
8eefe0a
Reduce console build log verbosity in appveyor
AArnott Mar 22, 2017
d235f8a
Consolidate path calculations
AArnott Mar 22, 2017
a240072
Build to top-level bin, obj folders
AArnott Mar 22, 2017
bbf0096
Fix unit test discovery of test assets
AArnott Mar 22, 2017
58a537f
Merge remote-tracking branch 'upstream/master' into portable
AArnott Apr 2, 2017
847ad24
Compile tests for netcoreapp1.0 as well
AArnott Apr 2, 2017
c0171a4
Use MSBuild instead of dotnet build on appveyor
AArnott Apr 2, 2017
17741a6
Stop trying to sign code generation assembly
AArnott Apr 3, 2017
fca8128
build with dotnetcore
Mar 31, 2017
9ad39f9
use .net core sdk 1.0.1
Mar 31, 2017
c1541e9
no more nuget
Mar 31, 2017
7d87fc2
build with netstandard1.3
ethomson Apr 8, 2017
f2bf103
Disable mono for now
bording Apr 8, 2017
e3888f8
Remove automatic nuget restore and build steps
bording Apr 8, 2017
028aeb3
Update build steps
bording Apr 8, 2017
9bf4fd8
Add ExtraDefine back for LEAKS_IDENTIFYING
bording Apr 8, 2017
2604004
Build Release configuration
bording Apr 8, 2017
8e690f9
Replace GenerateNativeDllNameTask with .targets code
AArnott Apr 8, 2017
c358bc3
Replace GenerateUniqueIdentifierTask with .targets equivalent
AArnott Apr 8, 2017
1f4f58b
Use properties instead of items for .targets tasks
AArnott Apr 8, 2017
3f9b0f9
Override shallow clone
bording Apr 8, 2017
bef8217
Special case workaround for macOS temp folder
bording Apr 8, 2017
b856f9b
Ensure Uri format can be determined
bording Apr 9, 2017
ea00328
Fix code generation so it works everywhere
AArnott Apr 9, 2017
40832ff
Merge remote-tracking branch 'upstream/dotnetcore' into portable2
AArnott Apr 9, 2017
8e785fc
Remove legacy version handling from appveyor.yml
AArnott Apr 10, 2017
aaec99c
Remove commented empty targets
AArnott Apr 10, 2017
b43c6ed
Let VS add a service tag to test project
AArnott Apr 11, 2017
131dec0
Replace CodeGeneration project reference with an alternative build or…
AArnott Apr 11, 2017
f37bf43
Update to code generation that may work better in VS
AArnott Apr 10, 2017
cc219fd
Build on TravisCI for portable2
AArnott Apr 11, 2017
514282c
Fix chmod
AArnott Apr 11, 2017
6a106f7
Check in codegen as LKG
AArnott Apr 11, 2017
9eb4cde
Clean up hiding dependency
AArnott Apr 11, 2017
e418992
Restore LibGit2Sharp explicitly
AArnott Apr 15, 2017
f29c7a8
Simplify restore command
AArnott Apr 15, 2017
3a01c5c
Improve build perf
AArnott Apr 15, 2017
eb6c84e
Work around .NET Core execute permission behavior
bording Apr 16, 2017
6c82177
Work around .NET Core handling trailing slashes differently
bording Apr 16, 2017
a5d59d0
Handle .NET Core AggregateException text differences
bording Apr 16, 2017
9828971
Run tests on CoreCLR on Windows
AArnott Apr 16, 2017
808c17b
Work around macOS File.Move problem
bording Apr 16, 2017
480db0b
Build and test w/ and w/o LEAKS_IDENTIFYING
AArnott Apr 16, 2017
2e039e1
Remove portable dev branches from Travis and Appveyor
AArnott Apr 16, 2017
4e6b2c2
Remove obsolete CodeGeneratorConfiguration env var
AArnott Apr 16, 2017
a64efe5
Trim .gitignore of unnecessary entries
AArnott Apr 24, 2017
a60c102
Remove unused debugging project file
AArnott Apr 24, 2017
400cb37
Several small CR comment fixups
AArnott Apr 24, 2017
75823e8
Remove leftovers of custom marshaler cookies
AArnott Apr 25, 2017
b42c92d
Remove MonoDevelop properties from sln
AArnott Apr 25, 2017
c60b162
Update build script and add cmd script
AArnott Apr 25, 2017
c503a0c
Ensure LibGit2Sharp.NativeBinaries' build authoring propagates to con…
AArnott Apr 25, 2017
dd6de03
Add appveyor msbuild logger back
AArnott Apr 25, 2017
5bdd563
Bring back cov-build.exe
AArnott Apr 25, 2017
7067eb5
Update test comments and remove unnecessary check
AArnott Apr 25, 2017
77b6fa4
Remove extranneous zero in version
AArnott Apr 25, 2017
c38e696
Update AssemblyInformationalVersion and tests
AArnott Apr 26, 2017
0620c68
Revise macOS File.Move workaround
bording Apr 26, 2017
fee5414
Revise test workaround comments
bording Apr 26, 2017
fee9a1f
Improve PublicSign condition
bording Apr 29, 2017
7c361f7
Fix build script comments to match new name
bording Apr 29, 2017
b8d08c7
Update to latest xUnit VS Runner beta
bording Apr 29, 2017
8ca086e
Revert xUnit VS Test Runner change
bording Apr 29, 2017
d22ab08
Adjust native binaries PrivateAssets
bording Apr 30, 2017
4d13ef7
Merge remote-tracking branch 'upstream/master' into portable
AArnott Jun 21, 2017
dc8e4a3
Bump version to 0.25
AArnott Jun 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,5 @@ _ReSharper*/
*.userprefs
*.swp
*.DotSettings
#Ignore custom generated files
LibGit2Sharp/Core/UniqueIdentifier.cs
LibGit2Sharp/Core/NativeDllName.cs

!nuget.package/build/
_NCrunch_LibGit2Sharp/
packages/
5 changes: 0 additions & 5 deletions .nuget/packages.config

This file was deleted.

18 changes: 6 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,25 @@
# see travis-ci.org for details

language: csharp
mono:
- 4.8.0
dist: trusty
dotnet: 1.0.1
mono: none

os:
- osx
- linux

env:
global:
- MONO_OPTIONS=--debug

install:
- curl -L -o nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
- mono nuget.exe restore LibGit2Sharp.sln

before_install:
- date -u
- uname -a
- env | sort

solution: LibGit2Sharp.sln
install:
- git fetch --unshallow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the git "height" can be calculated during the build, as it makes up part of the version number of the nuget package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, that's clever.

Apparently Travis doesn't have an option to just do a regular clone, which is a pity, since a shallow clone followed by unshallowing it is crazy expensive compared to just doing a regular clone in the first place.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I couldn't find a way to disable their shallow fetching, so this seemed like the best workaround.


# Build libgit2, LibGit2Sharp and run the tests
script:
- ./build.libgit2sharp.sh 'LEAKS_IDENTIFYING'
- ./buildandtest.sh 'LEAKS_IDENTIFYING'

# Only watch the development branch
branches:
Expand Down
58 changes: 0 additions & 58 deletions CI/build.msbuild

This file was deleted.

12 changes: 12 additions & 0 deletions CodeGeneration/CodeGeneration.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the workaround to get this working properly was to commit the assembly directly vs building it, would it be worth including in the VS solution so it shows up at least?

Also, why is the folder where the assembly is saved called lkg?

Copy link
Contributor Author

@AArnott AArnott Apr 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's in the solution file, it will build (unless I do rather unusual things that will likely confuse folks). And if I leave it building, folks will expect that is meaningful for something in the product, and it isn't. Also, if it's in the solution, then package restore has to bring down more packages as this project has unique ones. So it will slow down package restore and builds on CIs and dev machines with no value.

As it stands alone, it can be built as a lone project without an sln. So in the rare event we may actually need to update the code gen project, we can still do that -- and possibly add it to its own temporary solution at that time.

lkg = Last Known Good. In my work experience lkg is used to refer to a checked in toolset, which is exactly what this is. We build the toolset (or at least this small part of it), then we check it in so we can use it next time without building it first. If we were to update the toolset, we'd test it, then we'd check it in as the 'last known good' version has updated. I'm not passionate about the name. I'm happy to rename it if you'd prefer something else.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's in the solution file, it will build (unless I do rather unusual things that will likely confuse folks). And if I leave it building, folks will expect that is meaningful for something in the product, and it isn't. Also, if it's in the solution, then package restore has to bring down more packages as this project has unique ones. So it will slow down package restore and builds on CIs and dev machines with no value.

That makes sense. No reason to add it, then.

lkg = Last Known Good. In my work experience lkg is used to refer to a checked in toolset, which is exactly what this is. We build the toolset (or at least this small part of it), then we check it in so we can use it next time without building it first. If we were to update the toolset, we'd test it, then we'd check it in as the 'last known good' version has updated. I'm not passionate about the name. I'm happy to rename it if you'd prefer something else.

I don't recall ever coming across that acronym before, so thanks for the explanation. I can't immediately think of something else I'd prefer, so seems OK to stick with lkg.

<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
<IsPackable>false</IsPackable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CodeGeneration.Roslyn" Version="$(CodeGenerationRoslynVersion)" />
</ItemGroup>
</Project>
310 changes: 310 additions & 0 deletions CodeGeneration/OfferFriendlyInteropOverloadsGenerator.cs

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions CodeGenerationAttributes/CodeGenerationAttributes.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net40;netstandard1.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\libgit2sharp.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CodeGeneration.Roslyn.Attributes" Version="$(CodeGenerationRoslynVersion)" />
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions CodeGenerationAttributes/CustomMarshalerAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;

namespace LibGit2Sharp
{
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false)]
[Conditional("CodeGeneration")]
public class CustomMarshalerAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="CustomMarshalerAttribute"/> class.
/// </summary>
/// <param name="customMarshaler">The type that derives from ICustomMarshaler.</param>
/// <param name="friendlyType">The type to expose in the generated overload.</param>
public CustomMarshalerAttribute(Type customMarshaler, Type friendlyType)
{
}
}
}
16 changes: 16 additions & 0 deletions CodeGenerationAttributes/OfferFriendlyInteropOverloadsAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Diagnostics;
using CodeGeneration.Roslyn;

namespace LibGit2Sharp
{
/// <summary>
/// Causes generation of an overload of a P/Invoke method that has a more friendly signature.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
[CodeGenerationAttribute("CodeGeneration.OfferFriendlyInteropOverloadsGenerator, CodeGeneration, Version=" + ThisAssembly.AssemblyVersion + ", Culture=neutral, PublicKeyToken=null")]
[Conditional("CodeGeneration")]
public class OfferFriendlyInteropOverloadsAttribute : Attribute
{
}
}
12 changes: 12 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<OutputPath>$(MSBuildThisFileDirectory)bin\$(MSBuildProjectName)\$(Configuration)\</OutputPath>
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>

<CodeGenerationRoslynVersion>0.3.13-gfce1c8ba1e</CodeGenerationRoslynVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="1.6.25" PrivateAssets="all" />
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<PublicSign Condition=" '$(AssemblyOriginatorKeyFile)' != '' and '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>
</Project>
3 changes: 0 additions & 3 deletions Lib/.gitattributes

This file was deleted.

43 changes: 0 additions & 43 deletions Lib/CustomBuildTasks/CustomBuildTasks.csproj

This file was deleted.

Binary file removed Lib/CustomBuildTasks/CustomBuildTasks.dll
Binary file not shown.
41 changes: 0 additions & 41 deletions Lib/CustomBuildTasks/GenerateNativeDllNameTask.cs

This file was deleted.

36 changes: 0 additions & 36 deletions Lib/CustomBuildTasks/GenerateUniqueIdentifierTask.cs

This file was deleted.

Binary file removed Lib/NuGet/NuGet.exe
Binary file not shown.
29 changes: 0 additions & 29 deletions Lib/NuGet/NuGet.license.txt

This file was deleted.

4 changes: 2 additions & 2 deletions LibGit2Sharp.Tests/ArchiveTarFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public void CanArchiveACommitWithDirectoryAsTar()

repo.ObjectDatabase.Archive(commit, archivePath);

using (var expectedStream = new StreamReader(Path.Combine(ResourcesDirectory.FullName, "expected_archives/commit_with_directory.tar")))
using (var actualStream = new StreamReader(archivePath))
using (var expectedStream = new StreamReader(File.OpenRead(Path.Combine(ResourcesDirectory.FullName, "expected_archives/commit_with_directory.tar"))))
using (var actualStream = new StreamReader(File.OpenRead(archivePath)))
{
string expected = expectedStream.ReadToEnd();
string actual = actualStream.ReadToEnd();
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp.Tests/BranchFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ public void TrackedBranchExistsFromDefaultConfigInEmptyClone()

using (var emptyRepo = new Repository(repoPath))
{
uri = new Uri(emptyRepo.Info.Path);
uri = new Uri($"file://{emptyRepo.Info.Path}");
}

SelfCleaningDirectory scd2 = BuildSelfCleaningDirectory();
Expand Down
Loading