Skip to content

Commit

Permalink
Merge pull request #8 from lstrzepek/support-enums
Browse files Browse the repository at this point in the history
Added enum support
  • Loading branch information
lstrzepek authored Jan 13, 2023
2 parents 1bfd19f + 7813395 commit 8450831
Show file tree
Hide file tree
Showing 37 changed files with 563 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- published

env:
PROJECT_PATH: 'DomainModel.Generator.CLI/DomainModel.Generator.CLI.csproj'
PROJECT_PATH: 'src/DomainModel.Generator.CLI/DomainModel.Generator.CLI.csproj'
PACKAGE_OUTPUT_DIR: ${{ github.workspace }}/output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[Bb]in
[Oo]bj
nupkg
.DS_Store
23 changes: 0 additions & 23 deletions DomainModel.Generator.CLI.Tests/TestModel/Model.cs

This file was deleted.

37 changes: 0 additions & 37 deletions DomainModel.Generator.CLI/Program.cs

This file was deleted.

1 change: 0 additions & 1 deletion DomainModel.Generator.Mermaid.Tests/Usings.cs

This file was deleted.

20 changes: 16 additions & 4 deletions DomainModel.Generator.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.CLI", "DomainModel.Generator.CLI\DomainModel.Generator.CLI.csproj", "{B50FC0EA-051A-4327-9E1E-F9D0C78297A2}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.CLI", "src\DomainModel.Generator.CLI\DomainModel.Generator.CLI.csproj", "{B50FC0EA-051A-4327-9E1E-F9D0C78297A2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.CLI.Tests", "DomainModel.Generator.CLI.Tests\DomainModel.Generator.CLI.Tests.csproj", "{125E9D34-1FB4-4FAC-BA8B-1BC9F38A413B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.CLI.Tests", "src\DomainModel.Generator.CLI.Tests\DomainModel.Generator.CLI.Tests.csproj", "{125E9D34-1FB4-4FAC-BA8B-1BC9F38A413B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.Mermaid", "DomainModel.Generator.Mermaid\DomainModel.Generator.Mermaid.csproj", "{4A69AFE1-67A8-4C2C-B70D-53F087B15A9F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.Mermaid", "src\DomainModel.Generator.Mermaid\DomainModel.Generator.Mermaid.csproj", "{4A69AFE1-67A8-4C2C-B70D-53F087B15A9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.Mermaid.Tests", "DomainModel.Generator.Mermaid.Tests\DomainModel.Generator.Mermaid.Tests.csproj", "{EB154889-947E-46DC-AAE3-3CE724D79340}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.Mermaid.Tests", "src\DomainModel.Generator.Mermaid.Tests\DomainModel.Generator.Mermaid.Tests.csproj", "{EB154889-947E-46DC-AAE3-3CE724D79340}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.Types", "src\DomainModel.Generator.Types\DomainModel.Generator.Types.csproj", "{6F892B30-FB71-4586-AD42-0280B834B733}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomainModel.Generator.Types.Tests", "src\DomainModel.Generator.Types.Tests\DomainModel.Generator.Types.Tests.csproj", "{69E656CC-52B1-4CEA-BBE6-107C7881069B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -36,5 +40,13 @@ Global
{EB154889-947E-46DC-AAE3-3CE724D79340}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB154889-947E-46DC-AAE3-3CE724D79340}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB154889-947E-46DC-AAE3-3CE724D79340}.Release|Any CPU.Build.0 = Release|Any CPU
{6F892B30-FB71-4586-AD42-0280B834B733}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F892B30-FB71-4586-AD42-0280B834B733}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F892B30-FB71-4586-AD42-0280B834B733}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F892B30-FB71-4586-AD42-0280B834B733}.Release|Any CPU.Build.0 = Release|Any CPU
{69E656CC-52B1-4CEA-BBE6-107C7881069B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69E656CC-52B1-4CEA-BBE6-107C7881069B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69E656CC-52B1-4CEA-BBE6-107C7881069B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69E656CC-52B1-4CEA-BBE6-107C7881069B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ Options:
--format=<f> Markdown format. Supported values: mermaid, markdown [default: mermaid].
--diagram=<dt> Type of diagram to generate [default: class].
```

Example:
```
dotnet model generate -m ./MyCompany.AwesomeApp.Domain.dll -o ./AwesomeApp.mmd -n MyCompany.AwesomeApp.Domain
```

## Installation

```
dotnet tool install dotnet-model --global
```sh
dotnet tool install DomainModel.Generator --global
```

## Example

```sh
dotnet model generate -m ./DomainModel.Generator.CLI.Tests.dll -n TestModel --ignore-type TestModel.Program -o ~/Projects/DomainModel.Generate/model.mmd
```
25 changes: 25 additions & 0 deletions model.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
classDiagram
class Sale
Sale : +List~Guid~ CustomerId

class Customer
Customer : +Guid Id
Customer : +Int32 Age
Customer : +List~ContactDetails~ Contacts
Customer : +Address BusinessAddress
Customer : +DateTime CreateDate
Customer : +CustomerType Type

class Address
Address : +String City
Address : +String Street

class CustomerType
<<enumeration>> CustomerType
CustomerType : +Individual
CustomerType : +Company

Sale --> Customer
Customer --> ContactDetails
Customer --> Address
Customer --> CustomerType
Loading

0 comments on commit 8450831

Please sign in to comment.