-
Notifications
You must be signed in to change notification settings - Fork 652
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
#1175 - NetStandard #1269
#1175 - NetStandard #1269
Conversation
Haven't been able to resolve some compilation errors yet due to lack of replacemnt API's on netstandard.
@dazinator: I would love to review this, but I have no experience with .NET Core and can thus provide very little guidance. Sorry. 😕 |
Why does it need access to the registry? It should just check if environment variables are registered, same as on Cake: |
Just a discussion in general: .NET standard 2.0 is around the corner. That will add a lot of API's to .NET standard that are being worked around in this PR. I think it's wiser to wait for .NET standard 2.0 to be available (or work against the prerelease versions for the meantime). |
Given .NET Core 2.0 has now been released, is the plan to update to 2.0, or to continue with this work? As I've mentioned to @JakeGinnivan the current non-Core GitVersion doesn't work on a huge number of Linux platforms with no workaround available.. |
My own personal view is that:
All of the issues mentioned at top of this PR point to things we probably want to tidy up regardless:
I feel gitversion core should atleast be able to match the netstandard level targeted by libgit2sharp. If anyone wants to aim for netstandard2 as a first step though - nothing stopping you and its better than nothing. Many of the dependencies are now all compatible so its just waiting for someone to do this work! Feel free to base / cherry pick from this branch if it helps. |
@GeertvanHorrik - have raised #1278 for the continua ci registry issue |
_masterfix_ and _fixmaster_ now behave the same way (i.e. in a different way to _master_, but in the same way as other branches)
Octopus Deploy states that they use GitVersion here https://octopus.com/docs/packaging-applications/versioning-in-octopus-deploy#VersioninginOctopusDeploy-HowweversionOctopusDeploy
Going to replace Thread.Sleep with Task.Delay. Thread.Sleep isn't available in desired netstandard version. |
And Task.Delay is much better (doesn't block CPU). |
Yup exactly. Sadly
So we call I have taken another look at the
Do you think that would be acceptable? |
UPDATE: Using https://www.nuget.org/packages/AsyncBridge/ seems to work. |
…h to `Task.Delay` instead of Thread.Sleep but task's won't compile for net40 for some reason, even with the bcl.async nuget package.
@JakeGinnivan I'm planning to remove ILMerge in favour of Fody weaving of the msbuild task - think that will simplify things. I'll upgrade the project to vs2017 multitargeting, and remove pepita as well as that should no longer be required. |
Seperate PR submitted that removes System.Web! |
Brought in my last PR to remove system.web.
…tched to gittools warning exceptions.
@kll Sorry to hear of your docker struggles. I am eager to see this PR merged really, without expanding it any further. It delivers what it set out to do. I think it would be good to get this merged and then add support for the 2.1-sdk docker image as a separate issue. |
@JakeGinnivan I am the wrong person to ask about Mac. I thought in theory it should work - can anyone offer any advice to Jake on this? |
I'll start on a new PR based on this one but will keep it distinct so this one can be merged first. In theory at least re-targeting everything including the test projects to just netstandard2.0/netcoreapp2.0 should allow it to work on a mac. |
@kll ok sounds good. Is there anyway you could add netstandard2.0 as an additional target rather than retarget everything to 2.0 as a new baseline? I'd love to keep support for 1.1 if possible |
@dazinator Unfortunately not since LibGit2Sharp only targets netstandard2.0. We are limited by what the libraries we consume target. I got a good start yesterday and I think its a positive change because a lot of the extra complexity that was added in to work around the missing APIs in netstandard1.3 can go back away now since they are present in netstandard2.0. |
Yeah.. the official release does you are right. This PR though uses a beta package which I think supports
However that is a lot of build complexity and just an idea. If this PR gets merged I think most people (inlcuding me) would be perfectly fine with moving the baseline to netstandard20 as of a following release :-) |
Thoughts on just bringing GitTools.Core into this repo, I don't think it's being used by anything else properly? May simplify things going forward |
Any plans for release? |
@JakeGinnivan - probs a good idea to bring gittools in if its not being consumed independently anywhere else - but can we get this PR merged first and track that as a seperate issue if necessary? Also what are your thoughts about this PR - can it be merged now? Or are there any specific things that need to be addressed? From my perspective its just the tfs task and gem package assets are no longer being produced, but we can extend the cake script to handle that after this is merged, so not sure if that should be a blocker. |
I prefer not to merge my own PRs (just a policy of mine) but in order to get this moving: Unless there are any objections / concerns raised then in two weeks I will merge this myself. That is unless someone else wants to do the honours :-) |
2 weeks? Geesh! I say, by the power granted to me by Mr. Internet himself, you have until Monday of next week to raise your concerns. Or forever hold your peace! |
@dazinator just merge, release a alpha. The world shall go forth and break from there. |
I am fine with you merging @dazinator. Lets just merge, release, and the community can help us straighten it out Lets get back on the releasing train. |
So if I understand correctly in order to use |
@LeCoque that's presently correct, however I have just merged this PR, hopefully an official nuget.org release will occur soon - will update back here once that has happened. |
Any update on this? |
@pauldotknopf - This needs sorting: #1445 |
Is this the package we should be using? |
@pauldotknopf: That depends on how you're using GitVersion. If you use it as a library, that's the right reference. If you use it as a command line executable, GitVersion.CommandLine.DotNetCore is the right one. If you use it as an MSBuild Task, GitVersionTask is the right one. |
There is also now the dotnet cli global tool which is probably easier to consume if you want the command line usage (on any platform): install instructions here: https://www.nuget.org/packages/GitVersion.Tool |
Current Status
GitVersionTask
is working ondotnet core
.Also there is a new nuget package called:
GitVersion.CommandLine.DotNetCore
which contains the GitVersion commandline, except built fordotnet core
, so you can runGitVersion
viadotnet GitVersion.dll
.And there is a new dotnetcore based docker image.
To try out the build task:
dotnet core sdk
. (Need a minimum of version1.1
installed).Here is a sample consumer project building on appveyor with dotnet sdk
Be aware when building or restoring using
dotnet
commands you need to use the --disable-parallel flag (#1381)To try GitVersion DotNetCore CLI
dotnet core runtime
. (Need a minimum of version2.0
installed).GitVersion.CommandLine.DotNetCore
nuget package./tools
folder of the nuget package and run:dotnet gitversion.dll
Also there are a couple of artifacts in this PR not yet being built / uploaded to appveyor:
This is because since converting the projects to sdk style, the
AfterTargets
logic in some of the csproj files doesn't seem to run. I have moved most of the logic (for all of the other artifacts) out of the csproj files and into the cake script instead - but haven't yet done the TFS or the Gem package. If someone has some time to contribute, please start there..Remaining Tasks
Completed Tasks
GitTools.Core
,GitTools.Testing
and a few others to newer versions that that supportnetstandard
.GitVersion
command line now builds fornetcoreapp20
in addition to justnet40
and the additional nuget package is uploaded to appveyor.Fody
dotnet core
sdk, so this might pave the way to building under alinux/dotnet core image, as opposed to linux/mono image.
UtilPack
and therefore doesn't need to worry about embedding them (which is fortunate because ILMerge and Costura do not work with netcore assemblies so I know no way of embedding assemblies with netcore anyway).ContinuaCI
build server support had on registry (I fixed this separately in master and merged that into this pr)Other Notes
Encoding.GetEncodings()
isn't available on NETStandard1.3. (it's in netstandard2 I am manually populating a collection of common encodings for netstandard.Web Requests look different in netstandard api. (had to use compilation directives and alternative methods in many places to get to compile)
I am using AsyncBridge nuget package for async / await support in net40 of GitVersionCore. I have replaced Thread.Sleep with Task.Delay - as the former not available under netstandard and the latter is better practice anyway.
-System.ComponentModel.WarningException --> GitTools.WarningException
I have moved a lot of the packaging logic out of csproj files, and into the cake script.
I added a
Directory.Build.props
file to control some common dependency versions at a global level.