NAnt + NDepend.Console.exe and relative paths

5 Gen

If you read the documentation of NDepend.Console.exe you learn that relative paths are not supported. These remarks also apply to paths provided with options /InDirs /OutDir and /XslForReport.

Here you can see the result of a wrong line command

image

and here the result of a right line command

image

Unfortunately this is a problem for my solutions cause I need always relative path. My solution are continuous integrated using TeamCity and in my setup the build agent checks out sources in a random folder on the build agent machine (for eg. C:\BuildAgent\work\12724a65ddd4c6d0).

Here the Version Control Settings page of my project inside my TeamCity server where you can set the checkout directory.

image

Using relative path for me is a plus cause allow developers to freely decise the checkout project folder. For some of our customer this has been a project requirement.

Ok now you know why I need relative paths. Now I want to explain how I use NAnt + NDepend inside my continuous integrated solution. 

This is the target I use to run NDepend.Console.exe.

image

As you can see using the directory::get-current-directory I can build an absolute path at run-time. Maybe this result can be obtained using the built-in property  ${nant.project.basedir} but this is marked as deprecated so I prefer to use the directory::get-current-directory function.

Lascia un commento

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...

%d blogger cliccano Mi Piace per questo: