Snapshot Dependency Question
Answered
Hi - We have a large .Net repository with a number of applications. We are looking for a way to only trigger the build of certain applications based on the files within different projects being changed.
Here is an example:
Library1/
Library2/
App1/
App2/
If library 1 changes, build app 1/2 with same build number
If library 2 changes, build app 1 with same build number
If library 1 & 2 changes, build app 1/2 with same build number
Thank you in advance for your help!
Please sign in to leave a comment.
Hello!
I believe VCS Checkout Rules feature could come handy to you here. Suppose you have a single VCS root which is tied to the repository in question, and two build configurations - A and B. Let`s say A checkout rules do cover ASource folder, and B checkout rules include BSource folder. This way, the configurations would trigger automatically only if their corresponding sources are changed.
Your case is a bit more complex because you need to build App 1 every time the changes in either library are detected, and App 2 only when Library 1 is changed (so the App 1, apparently, could have no checkout rules defined). You also want to ensure builds in both apps have the same build number; this can be done, for example, by adding a snapshot dependency of App 2 on App 1 and using the dependency parameter from App 1 like below:
I hope this helps.