Dart使用PlantUML生成uml

安装了flutter,并且已经将bin文件添加到环境变量中

PlantUML Web Server

开源工具,使用简单的文字描述画UML图。 (plantuml.com)

1.下载工具

1
git clone https://hub.fastgit.org/glesica/dcdg.dart.git

2.安装

1
dart pub global activate -s path .

安装到C:\Users\<name>\AppData\Local\Pub\Cache\bin

3.运行

1
2
3
4
5
6
7
#Available builders:
# * plantuml - PlantUML builder that attempts to be feature-complete
# * dot - Graphviz builder that only handles inheritance
# * nomnoml - Nomnoml builder for embedding diagrams in web pages
#dart pub global run dcdg -o test.nomnoml -b nomnoml
#dart pub global run dcdg -o test.dot -b dot
dart pub global run dcdg -o test.puml -b plantuml

4.预览

4.1 在vscode中预览

安装PlantUML插件(使用该插件需要安装jdk) alt+d

4.2 在intellij IDEA中预览

生成.puml文件需要安装PlantUML integration插件