Skip to content

Commit

Permalink
release 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre3 committed Feb 23, 2023
1 parent 7d1f5fa commit e73b4fe
Show file tree
Hide file tree
Showing 18 changed files with 420 additions and 126 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ puml-gen InputPath [OutputPath] [-dir] [-public | -ignore IgnoreAccessibilities]
- -createAssociation: (Optional) Create object associations from references of fields and properites.
- -allInOne: (Optional) Only if -dir is set: copy the output of all diagrams to file include.puml (this allows a PlanUMLServer to render it).
- -attributeRequired: (Optional) When this switch is enabled, only types with "PlantUmlDiagramAttribute" in the type declaration will be output.
- excludeUmlBeginEndTags: (Optional) When this switch is enabled, it will exclude the \"@startuml\" and \"@enduml\" tags from the puml file.

examples
```bat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
<PackAsTool>true</PackAsTool>
<ToolCommandName>puml-gen</ToolCommandName>
<Description>This is a generator to create a class-diagram of PlantUML from the C# source code.</Description>
<Copyright>© 2015-2022 pierre3</Copyright>
<Copyright>© 2015-2023 pierre3</Copyright>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>https://github.com/pierre3/PlantUmlClassDiagramGenerator</PackageProjectUrl>
<RepositoryUrl>https://github.com/pierre3/PlantUmlClassDiagramGenerator</RepositoryUrl>
<RepositoryType></RepositoryType>
<PackageTags>plantuml</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.3.1.0</Version>
<Version>1.3.2.0</Version>
<Authors>pierre3</Authors>
<Company />
<Product />
<PackageReleaseNotes>
[V1.3.1.0]
- Fix an issue in which escape characters set in attribute parameters were not handled correctly
[V1.3.2.0]
- Add a switch to exclude "@startuml" and "@enduml" tags from the puml file.
- Fixed to add "- "(private) as default modifier when access modifier is omitted.
</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@startuml
class "@ClassA" {
}
class "@Type1" {
}
class "@Type2" {
}
class "@IList`1"<T> {
}
"@ClassA" o-> "@Strings<@string>" "@IList`1"
"@ClassA" --> "@Prop1" "@Type1"
"@ClassA" --> "@field1" "@Type2"
"@Type1" --> "@value1" "@int"
"@Type2" --> "@string1" "@string"
"@Type2" --> "@Prop2" "@ExternalType"
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@startuml
class ClassA {
}
class ClassB {
}
interface IInterfaceA {
Num2 : double <<get>>
}
interface IInterfaceB {
Num2 : double <<get>>
}
class RecordA <<record>> {
+ Prop1 : string <<get>>
+ Prop2 : string <<get>>
+ RecordA(prop1:string, prop2:string)
}
class RecordB <<record>> {
+ Prop1 : string <<get>>
+ Prop2 : string <<get>>
+ RecordB(prop1:string, prop2:string)
}
class StructA <<struct>> {
+ StructA(field1:RecordA)
}
class StructB <<struct>> {
+ StructB(field1:RecordB)
}
class RecordStructA <<record>> <<struct>> {
+ X : int <<get>> <<init>>
+ Y : int <<get>> <<init>>
}
class RecordStructB <<record>> <<struct>> {
+ X : int <<get>> <<init>>
+ Y : int <<get>> <<init>>
}
enum EnumA {
A,
B,
C,
}
enum EnumB {
A,
B,
C,
}
StructA --> RecordA : "use"
StructB --> RecordB : "use"
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@startuml
class Parameters {
+ A : string <<get>> <<set>>
+ B : string <<get>> <<set>>
}
class MyClass {
+ ReadOnlyItems : IReadOnlyCollection<Item> <<get>>
+ Run(p:Parameters) : void
+ MyClass(logger:ILogger)
}
class MyStruct <<struct>> {
+ MyStruct(p:Parameters)
}
class MyRecord <<record>> {
+ name : string <<get>> <<init>>
}
class MyStructRecord <<record>> <<struct>> {
}
class ClassA {
+ ClassA(logger:ILogger)
}
MyClass o-- "0..*" Item : "Items"
MyClass "1" *-- "0..*" IItem : "ItemDictionary"
MyClass ..> Parameters : "use"
MyClass ..> ILogger : "Injection"
MyStruct o-- "0..*" int : "intCollection:List<int>"
MyRecord o-- Settings
MyStructRecord o-- "Name" string
ClassA --> "ILogger<ClassA>" : ""\escape ""
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@startuml
class CurlyBrackets {
+ openingBracket : string = @"
{
"
+ openingBrackets : string = @"
&#123;{
"
+ closingBracket : string = @"
&#125;
"
+ closingBrackets : string = @"
}}
"
+ bothBrackets : string = @"
&#123;{
}}
"
}
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@startuml
class ClassA {
- PropA : int <<get>>
+ PropB : int <<get>>
- MethodA() : void
}
class StructA <<struct>> {
- PropA : string <<get>>
{static} - PropB : string <<get>>
{static} - MethodA() : void
}
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@startuml
class GenericsType {
+ Value : object <<get>>
}
class "GenericsType`1"<T> {
+ Value : T <<get>>
}
class "GenericsType`2"<T1,T2> {
+ Value1 : T1 <<get>>
+ Value2 : T2
}
class SubClass {
+ Value1 : string <<get>>
+ Value2 : int
}
class "SubClass`1"<T> {
+ Value2 : T <<get>>
}
class SubClassX {
}
class "BaseClass`1"<Tx> {
+ X : Tx <<get>> <<set>>
}
class GenericsType <<partial>> {
+ Number : int <<get>> <<set>>
}
"GenericsType`2" "<string,int>" <|-- SubClass
"GenericsType`2" "<GenericsType<int>,T>" <|-- "SubClass`1"
"SubClass`1" --> "Value1<int>" "GenericsType`1"
"BaseClass`1" "<int>" <|-- SubClassX
SubClassX --> "Gt" GenericsType
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
@startuml
class ClassA {
+ PropD : string <<get>>
+ ClassA()
{static} ClassA()
+ <<override>> ToString() : string
+ {static} StaticMethod() : string
+ ExpressonBodiedMethod(x:int) : void
}
abstract class ClassB {
+ {abstract} PropA : int <<get>> <<protected set>>
+ {abstract} AbstractMethod(arg1:int, arg2:double) : string
}
class ClassC <<sealed>> {
+ <<override>> PropA : int <<get>> <<protected set>> = 100
+ <<event>> PropertyChanged : PropertyChangedEventHandler
+ <<override>> AbstractMethod(arg1:int, arg2:double) : string
}
class Vector <<struct>> {
+ X : double <<get>>
+ Y : double <<get>>
+ Z : double <<get>>
+ Vector(x:double, y:double, z:double)
+ Vector(source:Vector)
}
enum EnumA {
AA= 0x0001,
BB= 0x0002,
CC= 0x0004,
DD= 0x0008,
EE= 0x0010,
}
class NestedClass {
+ A : int <<get>>
}
class "IList`1"<T> {
}
class InnerClass {
+ X : string <<get>> = "xx"
+ MethodX() : void
}
class InnerStruct <<struct>> {
+ A : int <<get>>
+ InnerStruct(a:int)
}
ClassB --> "publicA" ClassA
ClassB o-> "listOfA<ClassA>" "IList`1"
ClassB <|-- ClassC
INotifyPropertyChanged <|-- ClassC
ClassC --> "PropB" ClassB
NestedClass --> "B" InnerClass
NestedClass +-- InnerClass
InnerClass +-- InnerStruct
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@startuml
class NullableType1 {
+ NullableLong : long?
}
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@startuml
class MyRecord <<record>> {
+ A : string <<get>>
+ B : int <<get>>
+ MyRecord(a:string, b:int)
}
class MyStructRecord <<record>> <<struct>> {
+ A : string <<get>> <<init>>
+ B : int <<get>> <<init>>
}
class MyRecord2 <<record>> {
+ A : string <<get>> <<init>>
+ B : int <<get>> <<init>>
}
class MyStructRecord2 <<record>> <<struct>> {
+ A : string <<get>> <<init>>
+ B : int <<get>> <<init>>
}
class "MyGenericRecord`2"<T1,T2> <<record>> {
+ Type1 : T1 <<get>> <<init>>
+ Type2 : T2 <<get>> <<init>>
}
class "MyGenericStructRecord`2"<T1,T2> <<record>> <<struct>> {
+ Type1 : T1 <<get>>
+ Type2 : T2 <<get>>
+ MyGenericStructRecord(type1:T1, type2:T2)
}
class MyRecord3 <<record>> {
}
MyRecord3 --> "p1<long,bool>" "MyGenericRecord`2"
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@startuml
!include .\\AtPrefixType.puml
!include .\\AttributeRequierd.puml
!include .\\Attributes.puml
!include .\\CurlyBrackets.puml
!include .\\DefaultModifierType.puml
!include .\\GenericsType.puml
!include .\\InputClasses.puml
!include .\\NullableType.puml
!include .\\RecordType.puml
@enduml
6 changes: 6 additions & 0 deletions tools/csharp-to-plantuml/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to the "csharp-to-plantuml" extension will be documented in

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [1.3.2]
### Fixed
- Fixed to add "- "(private) as default modifier when access modifier is omitted.
### Added
- Add a switch to exclude "@startuml" and "@enduml" tags from the puml file.

## [1.3.1]
### Fixed
- Fix an issue in which escape characters set in attribute parameters were not handled correctly
Expand Down
2 changes: 1 addition & 1 deletion tools/csharp-to-plantuml/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2022 pierre3
Copyright (c) 2015-2023 pierre3

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 6 additions & 0 deletions tools/csharp-to-plantuml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ Create class diagrams of PlantUML from C# source code.
Copy the output of all diagrams to file include.puml (this allows a PlanUMLServer to render it).
- __csharp2plantuml.attributeRequired__
When this switch is enabled, only types with "PlantUmlDiagramAttribute" in the type declaration will be output.
- __csharp2plantuml.excludeUmlBeginEndTags__
When this switch is enabled, it will exclude the \"@startuml\" and \"@enduml\" tags from the puml file.

## Known Issues


## Release Notes
## 1.3.2
- Add a switch to exclude "@startuml" and "@enduml" tags from the puml file.
- Fixed to add "- "(private) as default modifier when access modifier is omitted.

## 1.3.1
- Fix an issue in which escape characters set in attribute parameters were not handled correctly
https://github.com/pierre3/PlantUmlClassDiagramGenerator/issues/62
Expand Down
Loading

0 comments on commit e73b4fe

Please sign in to comment.