This open source project uses java code to resolve all dependencies between existing .NET projects and solutions. This can have any number of usage scenarios. We at Picscout developed it to help us calculate what jobs in Jenkins should run as a result of pushed changes in git. Currently supports c# projects and solutions created in VS2010 forward
The main project is : dependency. It is divided into a few packages, the main class located here: com.picscout.depend.dependency.main.Runner
The Runner class can be used in one of two basic modes:
-
Get prjects/solutions that depend on the given projects/solutions. There are some overloaded methods to support this.
-
Calculate dependencies - When calling
CalculateDependencies(), then Runner will build a dependency map and save it.
If there is already a saved state , than when calling one of the methods to find dependent projects/solutions they will use the already saved state. Otherwise they will calculate the state themselves (but will not save it).
The idea here is to give the option to pre-calculate the dependency map,in order to save time when querying for dependencies.
The project uses log4j and apache commons configuration frameworks. Both should be configured in order for it to work properly. this can be done by setting the following environment variables:
log4j.config= path to log4j.xml file
config_file_path= path to config.xml file
Or you can pass them directly to the Runner class via a specilaized constructor that accepts them.
The configuration file is used to define what folders should be scanned, where to save persisted state and if to use it, and what class implements Guice injector (see next session). An example config file can be found under the test/resources folder here.
Netdepend uses Guice to inject dependencies between classes. All the plumbing is done in: com.picscout.depend.dependency.main.AppInjector
But you can use beans technology to inject a your own class that does the bindings. This will allow you to change implentation of any class you wish to.
This project was originaly created to be used along side Jenkins and git to detect what jobs should run as a result of pushed changes. This can be done like this:
-
Use git hooks to understand what projects/solutions changed as a result of a push.
-
Use a groovy system script with the Groovy plugin to transltate between Projects/Solutions and Jobs , run the Dependency Project and translate the results back to Jenkins changed Jobs.
an Example of such a script is given at: FindDependencies.groovy.
Another more advanced script we wrote can run in parallel jobs that do not depend on each other: ParallelFindDependencies.groovy
The artifact is deployed in maven repo.
The source can be downloaded from Github.
when you use the source code, you can use:
mvn package assembly:single
to create a JAR with dependencies.
You can also create an executalble JAR by running the same command on project: com.picscout.depend.console
Javadocs can be found here
This project was developed as an open source project by: