Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Automatic Build Dependencies (ABD) add-in for VC project in .NET 2003

0.00/5 (No votes)
3 May 2005 1  
Visual Studio .NET 2003 add-in to set automaticaly build dependencies of VC projects and to generate linked libraries dependency graphs.

Introduction

For quite sometime, I was looking for a way to automatically set the "Build Dependencies" in a given solution of VC projects in VS.NET. I didn't find any tools, add-ins, macro on the web, so, I decided to make my own tool for that.

Also, on CodeProject, I came across iLFis project ("Dependency Graph Generator") that gives the graph of existing Build Dependencies. So, I figured out that it should be nice to have the steps before that. Hence, this add-in automatically sets the Build Dependencies for each VC project in your solution.

Also, it can generate tree graphs of dependencies between VC projects in a solution, based on the linked library set in the properties of every VC project.

The graphs display only the dependencies between existing projects in your solution and not with external third party Libraries/Projects. But the graphs show for each project the entire dependencies tree (not just the first generation libraries it depends on, but the recursive dependencies). It also generates the full dependency tree of your entire solution.

Background

Like iLFis project, on which this project is based, it uses the excellent Graphviz tools to generate the graphs.

Here are the general basic ideas behind this project:

  • For each VC project in the solution, I create an array of the .lib it is linked to (from Additional Dependencies).
  • For each VC project, I keep only linked lib existing in the solution.
  • For each VC project, I recursively remove duplicate entry in a branch.

It has a very basic tree creation/management mechanism.

Restrictions

  • It doesn't detect if you have dependency loops (which is very bad anyway).

Installation

  • Install Graphviz from here.
  • Use the setup.exe installer to install the ABD add-in.

Usage

To use this tool, make the following:

  1. Run Visual Studio .NET.
  2. Open the solution (.sln) you want to work with.

A new pop-up menu is now available in your "Tools" menu: ABDAddin...

  1. Set Build Dependencies: Warning: the tool will update the Build Dependencies in your .sln file. So, if you are not sure of what you are doing, make a duplicate copy of your .sln before using this tool. I will not be responsible for any loss or damage.
  2. ABD Projects Graphs: generate all projects' theoretical Build Dependencies graphs.
  3. ABD Sln Graph: generate the entire solution's theoretical Build Dependencies graph.

You have access to these commands through the context menu in the Solution Explorer and the Class View.

The context menu for your solution now has an ABDAddin pop-up menu. And you can access the "ABD Project Graph" command on the context menu of the selected project. (This one will generate only the graph for the selected project.)

The ABDAddin has also an Options page in the "Tools-Options" form:

Points of Interest

This personal C# project was actually my first attempt with this language. I come from C++/MFC/OpenGL world. So for sure, this code will have multiple updates to enhance its performance since I have written basic C# code (as a C++ developer, the current code looks ugly for me).

For version 2.0, I didn't improve much on the core code Auto Build dependencies, but I mainly spent time on understanding the Command, CommandBars, and VS add-in capabilities.

History

  • Version 1.0 January 28th 2005 - Initial release.
  • Version 2.0 - February 16th 2005
    • Transform the tool to a Visual Studio .NET add-in.
    • Can generate graphs independently by setting the Build Dependencies.
    • Can generate graph of selected project from Class View and Solution Explorer context menu.
    • Add Add-in options in "Tools-Options" in order to choose output folder, configuration type.
    • Output graph in Visual Studio.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here