Usage Example¶
In the root of your repository you will include a GitDepend.json
file
{
"name": "Lib2",
"build": {
"script": "make.bat"
},
"packages": {
"dir": "artifacts/NuGet/Debug"
},
"dependencies": [
{
"url": "https://github.com/GitDepend/Lib1.git",
"dir": "../Lib1",
"branch": "develop"
}
]
}
Normally if you are working in an upper level repository you should just be able to run the build script and rely on nuget packages. However, when you have changed code in a lower level repository you will need to have those changes cascade up the chain. This is where GitDepend shines. Run the following command
GitDepend.exe update
This will follow the chain of GitDepend.json
files. The following things will happen
- Check out the dependency if it has not been checked out.
- Ensure that the repository is on the correct branch.
- update all dependencies (this is a recursive step)
- consume the latest nuget packages produced by dependency repositories.
At this point the upper level repository should be all up to date, targetting the latest nuget packages and be ready to build.
Try it out!¶
Take a look at some example projects and try it out for yourself.
Lib2 depends on Lib1
Clone Lib2
git clone https://github.com/GitDepend/Lib2.git
from the root of Lib2 run
make.bat update
This will clone and build all dependencies
build it with
make.bat
Now, make a change in Lib1 and commit that change.
make.bat update