Paket: Feature Request: paket.local override nuget package with csproj.

Created on 13 Jul 2016  Â·  18Comments  Â·  Source: fsprojects/Paket

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

Most helpful comment

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

All 18 comments

Think #724 is a related issue

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

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)

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.

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.

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...

@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?

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

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

I mean pinned version in the local file

sry for my ignorance is that currently implemented?

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

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

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.

PR submitted - #1843

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

Awesome. Post link when you are ready ;-)

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

Was this page helpful?
0 / 5 - 0 ratings