@@ -38,15 +38,10 @@ public override string Solution(FileInfo file)
3838 Header ( file . Name ) ;
3939 var solutionFile = SolutionFile . Parse ( file . FullName ) ;
4040 var solutionName = Path . GetFileNameWithoutExtension ( file . Name ) ;
41- var solutionId = $ "{ solutionName } ";
42- Graph . AppendLine ( $$ """
43- class {{ solutionName }} {
44- type solution
45- }
46- """ ) ;
41+ var solutionId = $ "s{ solutionFile . GetHashCode ( ) } ({ solutionName } )";
4742
4843 using var projectCollection = new ProjectCollection ( ) ;
49-
44+
5045 foreach ( var project in solutionFile . ProjectsInOrder )
5146 {
5247 if ( project . ProjectType != SolutionProjectType . KnownToBeMSBuildFormat ) continue ;
@@ -72,34 +67,18 @@ type solution
7267 private void GraphProject ( Project project )
7368 {
7469 var projectName = Path . GetFileNameWithoutExtension ( project . FullPath ) ;
75- var type = project . GetPropertyValue ( "OutputType" ) ;
76- var targetFramework = project . GetPropertyValue ( "TargetFramework" ) ?? project . GetPropertyValue ( "TargetFrameworks" ) ;
77- Graph . AppendLine ( $$ """
78- class {{ projectName }} {
79- type {{ type }}
80- target {{ targetFramework }}
81- }
82- """ ) ;
8370
8471 foreach ( var item in project . GetItems ( "ProjectReference" ) )
8572 {
8673 var refPath = item . EvaluatedInclude ;
8774 var refName = Path . GetFileNameWithoutExtension ( refPath ) ;
88- Graph . AppendLine ( $ " { projectName } .. > { refName } ") ;
75+ Graph . AppendLine ( $ " { projectName } -- > { refName } ") ;
8976 }
9077
9178 foreach ( var item in project . GetItems ( "PackageReference" ) )
9279 {
9380 var packageName = item . EvaluatedInclude ;
94- var version = item . GetMetadataValue ( "Version" ) ;
95- Graph . AppendLine ( $$ """
96- class {{ packageName }} {
97- type NuGet
98- version {{ version }}
99- }
100- """ ) ;
101-
102- Graph . AppendLine ( $ " { projectName } ..> { packageName } ") ;
81+ Graph . AppendLine ( $ " { projectName } -->|NuGet| { packageName } ") ;
10382 }
10483 }
10584}
0 commit comments