Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CLI parameter to activate/skip design analysis

  • Loading branch information...
commit 12383156b6fcce7c37acbb2c0f2c3382d7910b35 1 parent 4fbc1a8
@alexvictoor alexvictoor authored
View
6 DependencyParser.Test/DependencyParserTest.cs
@@ -14,15 +14,11 @@ public class DependencyParserTest {
public void Should_Create_An_XML_Report()
{
File.Delete("test.xml");
- string assemblyPath = @"C:\work\temp\springdotnet\trunk\build\VS.Net.2010\Spring.Core\Debug\Spring.Core.dll";
- //Program.Main(new string[] { "-a=testdata/Example.Core.dll", "-o=test.xml" });
- Program.Main(new string[] { "-a="+assemblyPath, "-o=test-spring.xml" });
+ Program.Main(new string[] { "-a=testdata/Example.Core.dll", "-o=test.xml", "-d=yes" });
string expected = File.ReadAllText("testdata/test.xml");
string result = File.ReadAllText("test.xml");
Assert.AreEqual(expected, result);
-
-
}
}
}
View
11 DependencyParser/Program.cs
@@ -23,17 +23,20 @@ public class Program
private static readonly DethOfInheritanceTreeAnalyzer ditAnalyzer = new DethOfInheritanceTreeAnalyzer();
+ private static bool designAnalysis = false;
+
public static void Main(string[] args)
{
bool showHelp = false;
string assemblyName = "ASSEMBLY.DLL";
string outputPath = "output.xml";
-
+
var p = new OptionSet()
{
{ "a|assembly=", "the name of the assembly to scan", v => assemblyName = v },
{ "o|output=", "the path to the output XML", v => outputPath = v },
{ "h|help", "show this message and exit", v => showHelp = v != null },
+ { "d|design", "flag that enables design analysis", d => designAnalysis = d != null }
};
try
@@ -171,8 +174,10 @@ static void Analysis(XmlTextWriter writer, ModuleDefinition module, string fullP
writer.WriteEndElement();
- GenerateTypeDesignMeasures(writer, module);
-
+ if (designAnalysis)
+ {
+ GenerateTypeDesignMeasures(writer, module);
+ }
}
writer.WriteEndElement();
Please sign in to comment.
Something went wrong with that request. Please try again.