Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reference in paket.references a file from a git repository?

Tags:

f#

paket

I have a TFS git repository in my paket.dependencies file:

git http://mytfs1server:8080/tfs/2015Projects/_git/DEV-Commons

Withing that repository, there is a file "src/Tools.fs"

In the paket.references file, how do I tell Paket to add a reference to a file within that git repository so that Paket can add it to the fsproj file?

like image 795
Juan Tarquino Avatar asked Oct 30 '22 11:10

Juan Tarquino


1 Answers

Paket seems not to support this at the moment. There is single file dependency functionality for GitHub, but general git dependencies are handled differently.

You can achieve the same semi-manually though. The way it works for GitHub is that it adds the referenced file as a link to the project. As long as you have the repo dependency in paket.dependencies, Paket will clone it under paket-files folder and you can link to the file stored there (Paket will need to clone the whole repo, but you'll find your file there).

This way you will get the same behavior in VS and other IDEs. You will lose some Paket support as there will be no information in paket.references that the project depends on the linked file. But for this kind of dependencies there usually is no problem with this being a transitive dependency for something else, which would require version conflict resolution. You can pin specific commit in paket.dependencies for git dependencies anyway.

like image 100
Honza Brestan Avatar answered Jan 12 '23 18:01

Honza Brestan