2

I am using a NAnt build script to call NDepend with the required command line arguments.

<exec program="NDepend.Console.exe" basedir="${NDependPath}">
  <arg line="${NDependProjectFilePath} /indirs ${NDependInDirs} /outdir ${NDependOutputDir}" />
</exec>

But what I am looking for is to get NDepend to recurse through all subdirectories of the specified 'input directory' for the assemblies listed in my NDepend project file.

I used NAnt to copy all assemblies recursively to a specified folder and then pointed NDepend to this as its input. But this method results in many missing metrics relating to the code itself.

Any ideas how without listing the explicit path of all of my assemblies (it is a large project); I can get metrics across the whole solution by specifying the top level directory?

Charles
  • 50,943
  • 13
  • 104
  • 142
tomahawk
  • 249
  • 2
  • 9
  • For anyone else looking to achieve something similar. I ended up writing a custom NAnt task, which allows creation of an .ndproj file for any given solution. This is achieved by passing the solution name, folder and filter; recursing through the folder structure pulling all asm that match. Then writing this out to the xml document as child nodes of the parent. – tomahawk Oct 19 '10 at 10:31

1 Answers1

0

Recursive through an input directory to find all assemblies accross multiple project is now a feature available from: NDepend Start Page >>> Analyze .NET assemblies in folders >>> direct/recursive child folders

Thanks to NDepend.API you can also programatically search for assemblies on your disk, fill a NDepend project with these assemblies, and run an analysis to create a report. See:

Getting started with NDepend.API

NDepend.DotNet.IDotNetManager members

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92
  • I'm now going to go down the console app route. This will allow dynamic creation of the .ndproj with the assembly listing for a given project. Thanks for the reply! – tomahawk Oct 11 '10 at 10:20