-
Notifications
You must be signed in to change notification settings - Fork 655
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
Update version in project.json files #980
Conversation
…on in the original file.
…at is a VisualStudioism.
This capability would be really nice to have. I would love to see this in GitVersion because project.json's are currently a fact of life, even though they are expected to go away at some point in the future.. What are thoughts opinions around this? |
@dazinator I have started using this: https://github.com/sergeyzwezdin/magic-chunks/ As it integrates really nicely with Cake, which I am now using for all my builds. Here is an example of updating a project.json file with it: https://github.com/OctopusDeploy/CSProjToXProj/blob/master/build.cake#L110 |
@gep13 - thanks for that, I haven't looked at Cake in much depth yet, but I like the fact you can use c# syntax! Unfortunately switching to a Cake build isn't an option for us at present, so I am looking for alternatives like this PR.. @droyad I have noticed a bit of a problem with this PR in that it can break the build as it doesn't deal with updating version numbers in project references. For example, if you have ProjectA.json which references ProjectB.json, then ProjectA.json will have this dependency entry:
This functionality updates the Also I stood up a chocolatey package for this PR to make things a bit easier (hope you don;t mind) https://chocolatey.org/packages/GitVersion.Portable.ReachFork/4.0.0-ReachBeta1 |
@dazinator what are you currently using to run GitVersion? |
@dazinator I use just the wildcard to reference other projects, ie:
Are there any drawbacks to that approach? |
Gotcha. I was going to say that if you were using any other type of build script, i.e. psake, or something like that, then Magic Chunks has some plugins for there too. It isn't just limited to Cake usage. |
Fyi to reference other projects you can do:
|
Thoughts on https://github.com/ah-/dotnet-gitversion We could move this into a new project as done in that repo? |
Makes sense to me. |
@JakeGinnivan: That looks like a great effort from @ah-. Can't we just move his repository into the GitTools organization and make it official? |
I think his repo is a port to dotnet core. I am happy for someone else to take the lead on this feature :) |
If you need something specific from me let me know |
I'm not sure this is needed anymore. Instead, cross-compile the existing GitVersionTask for net4 and NetCoreApp. Then it can be used directly by csproj everywhere as I describe in #1118 |
Agreed. With the move back to msbuild system, the classic ;) approach can be used. |
Can this be closed, then? |
Does that require an upgrade from VS2015 to VS2017 in order to migrate from project.json back to msbuild? Just concerned that project.json files might remain for those stuck on vs2015 if so? (sadly, that includes me) |
|
hmm ok.. I'm going to enjoy explaining that cost to my manager haha. How about the cross plat story, for example Linux.. will there be new tooling on Linux to replace project.json as well? |
All of the tooling is going to be csproj only, including cross platform. The current preview4 CLI tooling already supports the csproj. |
Ok cool, thanks for explaining @onovotny - project.json shall be consigned to the dustbin of history, and anyone stuck on it will have a migration path... sounds very sensible to close this issue :-) |
@gep13 - I ended up moving from team city to appveyor and cake in the end and using Magic Chunks. I don't regret it. Team City is now dead to me. |
Added the
/updateprojectjson
switch to GitVersion.exe which replaces the version in Project.json files. Closes #647.