Git dependencies
Paket allows you to automatically manage the linking of files from any Git repository.
This feature assumes that you have git installed. If you don't have git installed then Paket still allows you to reference files from GitHub.
Referencing a Git repository
You can reference a complete Git repository by specifying the clone URL in the
paket.dependencies
file:
1: 2: |
|
This will clone the repository, checkout the latest version of the default
branch and put it into your paket-files
directory.
If you want to restrict Paket to a special branch, tag or a concrete commit then this is also possible:
1: 2: 3: 4: 5: |
|
Referencing Git tags
Paket allows you to specify version ranges for Git tags similar to NuGet version ranges:
1: 2: 3: 4: 5: 6: |
|
You can read more about the version range details in the corresponding NuGet reference section.
Running a build in Git repositories
If your referenced Git repository contains a build script then Paket can execute this script after restore:
1: 2: |
|
This allows you to execute arbitrary commands after restore.
NOTE: This functionality uses the .NET Process
API, with UseShellExecute
set
to true
. This means that on Windows your command will execute in a cmd.exe
context. If your build is not a .bat
file, you will need to fully qualify the
command with the shell program to run as well, like this:
1:
|
|
Using Git repositories as NuGet source
If you have NuGet packages inside a git repository you can easily use the
repository as a NuGet source from the paket.dependencies
file:
1: 2: 3: |
|
The generated paket.lock
file will look like this:
1: 2: 3: 4: 5: 6: |
|
It's also possible to run build scripts to create the NuGet packages:
1: 2: 3: 4: |
|
In this sample we have different build scripts for Mono and Windows.