IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Engine.Services.ProjectLoaders.VSProject Class Reference

This class allows loading information about configurations and assemblies in a Visual Studio project file and inspecting them. Only the most common project types are supported and an exception is thrown if an attempt is made to load an invalid file or one of an unknown type. More...

+ Inheritance diagram for NUnit.Engine.Services.ProjectLoaders.VSProject:
+ Collaboration diagram for NUnit.Engine.Services.ProjectLoaders.VSProject:

Classes

class  ProjectConfig
 

Public Member Functions

 VSProject (string projectPath)
 
TestPackage GetTestPackage ()
 Gets a test package for the primary or active configuration within the project. The package includes all the assemblies and any settings specified in the project format. More...
 
TestPackage GetTestPackage (string configName)
 Gets a TestPackage for a specific configuration within the project. The package includes all the assemblies and any settings specified in the project format. More...
 

Static Public Member Functions

static bool IsProjectFile (string path)
 
static bool IsSolutionFile (string path)
 

Properties

string ProjectPath [get, private set]
 The path to the project More...
 
string ActiveConfigName [get]
 Gets the active configuration, as defined by the particular project. For a VS project, we use the first config found. More...
 
IList< string > ConfigNames [get]
 
string Name [get]
 The name of the project. More...
 
- Properties inherited from NUnit.Engine.Extensibility.IProject
string ProjectPath [get]
 Gets the path to the file storing this project, if any. If the project has not been saved, this is null. More...
 
string ActiveConfigName [get]
 Gets the active configuration, as defined by the particular project. More...
 
IList< string > ConfigNames [get]
 Gets a list of the configs for this project More...
 

Private Member Functions

void Load ()
 Load a project in various ways, depending on the extension. More...
 
bool TryLoadLegacyProject ()
 Load a project in the legacy VS2003 format. Note that this method is not called for C++ projects using the same format, because the details differ. More...
 
void LoadMSBuildProject ()
 Load a non-C++ project in the MsBuild format introduced with VS2005 More...
 
void LoadLegacyCppProject ()
 Load a C++ project in the legacy format, which was used for C++ much longer than it was used for the other languages supported. More...
 
void ThrowInvalidFileType (string projectPath)
 
void ThrowInvalidFormat (string projectPath, Exception e)
 
string SafeAttributeValue (XmlNode node, string attrName)
 
string RequiredAttributeValue (XmlNode node, string name)
 

Static Private Member Functions

static string GetConfigNameFromCondition (XmlElement configNode)
 

Private Attributes

const string SOLUTION_EXTENSION = ".sln"
 VS Solution extension More...
 
XmlDocument _doc
 The XML representation of the project More...
 
IDictionary< string,
ProjectConfig
_configs = new Dictionary<string, ProjectConfig>()
 The list of all our configs More...
 

Static Private Attributes

static readonly string[] PROJECT_EXTENSIONS = { ".csproj", ".vbproj", ".vjsproj", ".vcproj", ".fsproj" }
 VS Project extentions More...
 

Detailed Description

This class allows loading information about configurations and assemblies in a Visual Studio project file and inspecting them. Only the most common project types are supported and an exception is thrown if an attempt is made to load an invalid file or one of an unknown type.

Constructor & Destructor Documentation

NUnit.Engine.Services.ProjectLoaders.VSProject.VSProject ( string  projectPath)
inline

Member Function Documentation

TestPackage NUnit.Engine.Services.ProjectLoaders.VSProject.GetTestPackage ( )
inline

Gets a test package for the primary or active configuration within the project. The package includes all the assemblies and any settings specified in the project format.

Returns
A TestPackage

Implements NUnit.Engine.Extensibility.IProject.

TestPackage NUnit.Engine.Services.ProjectLoaders.VSProject.GetTestPackage ( string  configName)
inline

Gets a TestPackage for a specific configuration within the project. The package includes all the assemblies and any settings specified in the project format.

Parameters
configNameThe name of the config to use
Returns
A TestPackage for the named configuration.

Implements NUnit.Engine.Extensibility.IProject.

References NUnit.Engine.TestPackage.AddSubPackage().

static bool NUnit.Engine.Services.ProjectLoaders.VSProject.IsSolutionFile ( string  path)
inlinestatic
void NUnit.Engine.Services.ProjectLoaders.VSProject.Load ( )
inlineprivate

Load a project in various ways, depending on the extension.

bool NUnit.Engine.Services.ProjectLoaders.VSProject.TryLoadLegacyProject ( )
inlineprivate

Load a project in the legacy VS2003 format. Note that this method is not called for C++ projects using the same format, because the details differ.

Returns
True if this project is in the VS2003 format, otherwise false.
void NUnit.Engine.Services.ProjectLoaders.VSProject.LoadMSBuildProject ( )
inlineprivate

Load a non-C++ project in the MsBuild format introduced with VS2005

void NUnit.Engine.Services.ProjectLoaders.VSProject.LoadLegacyCppProject ( )
inlineprivate

Load a C++ project in the legacy format, which was used for C++ much longer than it was used for the other languages supported.

void NUnit.Engine.Services.ProjectLoaders.VSProject.ThrowInvalidFileType ( string  projectPath)
inlineprivate
void NUnit.Engine.Services.ProjectLoaders.VSProject.ThrowInvalidFormat ( string  projectPath,
Exception  e 
)
inlineprivate
string NUnit.Engine.Services.ProjectLoaders.VSProject.SafeAttributeValue ( XmlNode  node,
string  attrName 
)
inlineprivate
string NUnit.Engine.Services.ProjectLoaders.VSProject.RequiredAttributeValue ( XmlNode  node,
string  name 
)
inlineprivate
static string NUnit.Engine.Services.ProjectLoaders.VSProject.GetConfigNameFromCondition ( XmlElement  configNode)
inlinestaticprivate

Member Data Documentation

readonly string [] NUnit.Engine.Services.ProjectLoaders.VSProject.PROJECT_EXTENSIONS = { ".csproj", ".vbproj", ".vjsproj", ".vcproj", ".fsproj" }
staticprivate

VS Project extentions

const string NUnit.Engine.Services.ProjectLoaders.VSProject.SOLUTION_EXTENSION = ".sln"
private

VS Solution extension

XmlDocument NUnit.Engine.Services.ProjectLoaders.VSProject._doc
private

The XML representation of the project

IDictionary<string, ProjectConfig> NUnit.Engine.Services.ProjectLoaders.VSProject._configs = new Dictionary<string, ProjectConfig>()
private

The list of all our configs

Property Documentation

string NUnit.Engine.Services.ProjectLoaders.VSProject.ProjectPath
getprivate set

The path to the project

string NUnit.Engine.Services.ProjectLoaders.VSProject.ActiveConfigName
get

Gets the active configuration, as defined by the particular project. For a VS project, we use the first config found.

IList<string> NUnit.Engine.Services.ProjectLoaders.VSProject.ConfigNames
get
string NUnit.Engine.Services.ProjectLoaders.VSProject.Name
get

The name of the project.


The documentation for this class was generated from the following file: