Skip to content
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

Feature Request: paket.local override nuget package with csproj. #1803

Closed
gertjvr opened this issue Jul 13, 2016 · 18 comments
Closed

Feature Request: paket.local override nuget package with csproj. #1803

gertjvr opened this issue Jul 13, 2016 · 18 comments

Comments

@gertjvr
Copy link

gertjvr commented Jul 13, 2016

Description

Feature request, what I am after is the ability to use paket.local file to override a nuget package reference with the csproj file that was used to produce to nuget package.

I have two example repositories ServiceA and ServiceB, ServiceB has a nuget package reference to ServiceA.MessageContract a sub project of ServiceA repository.

Repro steps

  1. Create a paket.local file with content as below
nuget ServiceA.MessageContracts -> project c:\github\ServiceA\src\ServiceA.MessageContracts\ServiceA.MessageContracts.csproj
  1. Run .paket\paket restore

Expected behavior

The nuget reference in ServiceB is replaced with csproj reference of ServiceA.MessageContracts

Known workarounds

The main issue is that our nuget package version number isn't stored in the git repository so have to customise the build script to pass a build number to recreate a nuget package so that paket.local can successfully override them locally.

cc @theimowski

@gertjvr gertjvr changed the title paket.local override nuget package with csproj. Feature Request: paket.local override nuget package with csproj. Jul 13, 2016
@gertjvr
Copy link
Author

gertjvr commented Jul 13, 2016

Think #724 is a related issue

@theimowski
Copy link
Member

This could be interesting however much effort would be required - AFAIK there's currently no utility in Paket to build xprojs

@mterwoord
Copy link

After a gitter discussion on a wish/question I had, this issue was mentioned. We discussed the following option:

How about giving the option to specify a .dll (/.exe) file in the .local file? Then the only thing paket has to do is replace the hint path in the project file. The difficult paths (finding the outpt filename of the project, taking into account solution settings, etc, etc is then up to the user)

@theimowski
Copy link
Member

As of now there's a possibility to give path to a nupkg file.
If you had nuget packaging as a part of your referenced project build process, you could use that.

The workflow would then look like this:

  1. for referenced project, specify override in .local file giving a path to where the nupkg is created
  2. make changes in referenced project
  3. build the referenced project, creating a nupkg in result
  4. restore packages in referencing project to consume new changes
  5. if necessary repeat from 2.

You might consider the additional step in build process (creating a nupkg) redundant when the package is really just a single dll, however such solution was the easiest way to incorporate paket.local into existing Paket restore process.

@gertjvr
Copy link
Author

gertjvr commented Jul 26, 2016

The only issue we have is that the nupkg version number isn't discoverable from the local build process, in our case a locally build version is 0.0.0 and paket restore = local override, fails because it looking the nupkg with the exact reference version number.

@mterwoord
Copy link

One remaining "issue" for me is that if i have to make a nupkg file, i have spent 90% of the time of the build already...

@theimowski
Copy link
Member

@gertjvr what we could do then is to allow for optional version param in the paket.local file, but it'd have to be pinned to specific verison (which should be fine for your case).
@mterwoord You mean the additional time of packaging is an issue?

@mterwoord
Copy link

In my situation, I'm building a package using a script, that consumes most of the time. If I still have to build the package every time, I won't be using the paket.local to override, i'd just push them to a server and pull from there

@gertjvr
Copy link
Author

gertjvr commented Aug 1, 2016

issue with pinned is paket restore fails to restore with version 0.0.0 if paket.dependencies has a specific version / range.

@theimowski
Copy link
Member

I mean pinned version in the local file

@gertjvr
Copy link
Author

gertjvr commented Aug 1, 2016

sry for my ignorance is that currently implemented?

@theimowski
Copy link
Member

No not yet. But should be doable with little effort, hence my suggestion

@theimowski
Copy link
Member

I'll give it a go soon and keep you updated

@gertjvr
Copy link
Author

gertjvr commented Aug 1, 2016

That would be amazing

On 1 Aug 2016 7:05 PM, "Tomasz Heimowski" [email protected] wrote:

I'll give it a go soon and keep you updated


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@theimowski
Copy link
Member

PR submitted - #1843

@gertjvr
Copy link
Author

gertjvr commented Aug 3, 2016

Worked!!! 😀 now to blog how to develop microservices locally using this feature

@gertjvr gertjvr closed this as completed Aug 3, 2016
@forki
Copy link
Member

forki commented Aug 3, 2016

Awesome. Post link when you are ready ;-)

@theimowski
Copy link
Member

@gertjvr glad it helped! you might have a look at my blog entry on similar topic - I based on "Git override" though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants