开发者

How do I programatically create an NDepend project file?

To start, this may be a useful link: http://www.ndepend.com/NDependConsole.aspx

As anyone who has used Visual NDepend may know, with NDepends you need to import project / solution files, and the corresponding output directories, namespaces, and assemblies are added to the NDepends project.

The problem I have, is I have TONS of these projects and solutions to add. It seems ridiculous to sit there for 45 minutes adding 300 solutions click by click. There must be a way to create an NDepend project file from a list of the paths to these solution / project files.

My first thought was to find the same information NDepends does (output directories, used namespaces and output executables dll's, etc) and programmatically create the NDepend project as a massive string. However, this seems like unnecessary work.

It would be nice if there was a way to invoke the command line and target specific projects, not output directories, as some of the projects have PostBu开发者_C百科ild tasks to copy assemblies to different directories, some projects specify the output directory as an upward relative path (ie ....), and so it isn't safe to assume that the output directory of a project is the same directory it is in.

Any ideas?


Stefan, I am the lead developer of NDepend. We recently released NDepend.API that can do exactly what you are asking for.

  • NDepend.API overview
  • NDepend.API introduction
  • NDepend.API getting started

In the getting started section you'll find code example about how to use NDepend.API to create a temporary NDepend project initialized with assemblies generated from a Visual Studio solution.

You can also dig into the source code of Power Tools to see how to create or modify NDepend porjects. This source code can be found in: $NDependInstallPath$\NDepend.PowerTools.SourceCode\NDepend.PowerTools.sln

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜