Skip to content

Commit bab8d5d

Browse files
committed
fixed replace include path root
1 parent 91097db commit bab8d5d

File tree

7 files changed

+24
-19
lines changed

7 files changed

+24
-19
lines changed

src/PlantUmlClassDiagramGenerator/Generator/PlantUmlFromDirGenerator.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;
@@ -106,8 +106,9 @@ public bool GeneratePlantUml(Dictionary<string, string> parameters)
106106
}
107107
else
108108
{
109-
var newRoot = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @".\" : @".";
110-
includeRefs.AppendLine("!include " + outputFile.Replace(outputRoot, newRoot));
109+
//var newRoot = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @".\" : @".";
110+
var root = outputRoot.EndsWith(Path.DirectorySeparatorChar) ? outputRoot.TrimEnd(Path.DirectorySeparatorChar) : outputRoot;
111+
includeRefs.AppendLine("!include " + outputFile.Replace(root, "."));
111112
}
112113
}
113114
catch (Exception e)

test/PlantUmlClassDiagramGeneratorTest/PlantUmlClassDiagramGeneratorTest.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@
4040

4141
<ItemGroup>
4242
<Compile Remove="uml\20250517_151031\**" />
43+
<Compile Remove="uml\20250517_165357\**" />
4344
<Content Remove="uml\20250517_151031\**" />
45+
<Content Remove="uml\20250517_165357\**" />
4446
<EmbeddedResource Remove="uml\20250517_151031\**" />
47+
<EmbeddedResource Remove="uml\20250517_165357\**" />
4548
<None Remove="uml\20250517_151031\**" />
49+
<None Remove="uml\20250517_165357\**" />
4650
</ItemGroup>
4751

4852
<ItemGroup>

test/PlantUmlClassDiagramGeneratorTest/UnitTests/PlantUmlFromDirGeneratorTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ public void Generate(int testNum, bool allInOne, bool createAssociation, bool ad
5252

5353
public void Dispose()
5454
{
55-
if (Directory.Exists(outputDir))
56-
{
57-
Directory.Delete(outputDir, true);
58-
}
55+
//if (Directory.Exists(outputDir))
56+
//{
57+
// Directory.Delete(outputDir, true);
58+
//}
5959
}
6060

6161

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@startuml
2-
!include .\\Earth.puml
3-
!include .\\Moon.puml
4-
!include .\\BaseTypes\PlanetBase.puml
2+
!include .\Earth.puml
3+
!include .\Moon.puml
4+
!include .\BaseTypes\PlanetBase.puml
55
@enduml
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@startuml
2-
!include .\\Earth.puml
3-
!include .\\Moon.puml
4-
!include .\\BaseTypes\PlanetBase.puml
2+
!include .\Earth.puml
3+
!include .\Moon.puml
4+
!include .\BaseTypes\PlanetBase.puml
55
@enduml
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@startuml
2-
!include .\\Earth.puml
3-
!include .\\Moon.puml
4-
!include .\\BaseTypes\PlanetBase.puml
2+
!include .\Earth.puml
3+
!include .\Moon.puml
4+
!include .\BaseTypes\PlanetBase.puml
55
PlanetBase <|-- Earth
66
@enduml
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@startuml
2-
!include .\\Earth.puml
3-
!include .\\Moon.puml
4-
!include .\\BaseTypes\PlanetBase.puml
2+
!include .\Earth.puml
3+
!include .\Moon.puml
4+
!include .\BaseTypes\PlanetBase.puml
55
PlanetBase <|-- Earth
66
PlanetBase o-> "Moons<Moon>" "IList`1"
77
@enduml

0 commit comments

Comments
 (0)