Skip to content

Commit 7c54627

Browse files
authored
Update git-dependencies.md
with #3756 and #3064 it is quite clear, that the documentation around adding git repositories as a (usable) dependency isn't all that clear. Which is a pity, because the actual process isn't all that hard and also quite sensible-ish. This change aims to slightly improve the docs and shed some light on this topic because - basically - all that is missing is some basic knowledge about how namespace/package resolution works in fsharp.
1 parent b4ce66f commit 7c54627

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

docs/content/git-dependencies.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ git https://uri/to/repo.git master build: "powershell build.ps1", OS: windows
7171

7272
## Using Git repositories as NuGet source
7373

74+
### With pre-built, checked-in nupgks
75+
7476
If you have NuGet packages inside a git repository you can easily use the
7577
repository as a NuGet source from the [`paket.dependencies`
7678
file](dependencies-file.html):
7779

7880
```paket
79-
git https://github.com/forki/nupkgtest.git master Packages: /source/
81+
git https://github.com/forki/nupkgtest.git master Packages: /bin/
8082
8183
nuget Argu
8284
```
@@ -85,16 +87,28 @@ The generated [`paket.lock` file](lock-file.html) will look like this:
8587

8688
```paket
8789
NUGET
88-
remote: paket-files/github.com/forki/nupkgtest/source
90+
remote: paket-files/github.com/forki/nupkgtest/bin
8991
Argu (1.1.3)
9092
GIT
9193
remote: https://github.com/forki/nupkgtest.git
9294
(05366e390e7552a569f3f328a0f3094249f3b93b)
9395
```
9496

97+
### Building nupkg on install
98+
9599
It's also possible to
96100
[run build scripts](git-dependencies.html#Running-a-build-in-git-repositories)
97-
to create the NuGet packages:
101+
to create the NuGet packages when installing/restoring with paket:
102+
103+
```paket
104+
git https://github.com/forki/nupkgtest.git master build: "dotnet pack", Packages: /bin/Debug
105+
106+
nuget Argu
107+
```
108+
109+
NOTE: this assumes that the name of the package is `Argu` which can't be inferred in this case since no `*.fsproj` or `.sln` file is present in the example repository
110+
111+
### Arbitrary build scripts
98112

99113
```paket
100114
git https://github.com/forki/nupkgtest.git master build: "build.cmd", Packages: /source/, OS: windows
@@ -103,4 +117,8 @@ git https://github.com/forki/nupkgtest.git master build: "build.sh", Packages: /
103117
nuget Argu
104118
```
105119

106-
In this sample we have different build scripts for Mono and Windows.
120+
In this sample we have different build scripts for Mono and Windows. Both of the specified scripts simply cody the prebuilt nupkgs from `/bin` to `/source`
121+
122+
### Actually using the package
123+
124+
Don't forget to also add your dependency to the `paket.references` file.

0 commit comments

Comments
 (0)