- Notifications
You must be signed in to change notification settings - Fork18
Generates UML class diagrams, from source code. Command line tool to convert from a Exuberant-ctags tags file to a UML class diagram, through Graphviz DOT, for all object oriented languages supported by ctags
License
Apache-2.0, Unknown licenses found
Licenses found
ruben2020/tags2uml
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Generates UML class diagrams, from source code
Command line tool to convert from aExuberant-ctags tags file to aUML class diagram, throughGraphviz, for all object oriented languages supported by ctags
The input file is a tags file, generated by Exuberant-ctags using--fields==+latinK
.
The output file is a GraphvizDOT file whose name is specified through the program options, or to stdout. The DOT file should then be passed to the Graphvizdot
program to be converted into an image file (e.g. PNG, SVG etc.).
Windows and Linux binaries can be downloaded attags2uml@SourceForge. The instructions on how to build from source code can be found below.
So far, it has been tested on Linux and Windows 7. It has been tested on C++, Java, Python and C# source code. Work in progress. But it should theoritically work on other object oriented languages supported by ctags and on other platforms supported byGo.
- Supports C++, Java, Python, Ruby and C# (not all tested yet)
- Can build and run on any platform supported byGo i.e. Windows, Linux, Mac (Mac not yet tested)
- Whitebox (with methods and members of classes) or blackbox (just class names)
- Ability to show only public methods, only public and protected methods, all methods or no methods
- Ability to show only public members, only public and protected members, all members or no members
- Class inheritance is optionally shown
- Relationship optionally shown, based on the data type of members of a class (only for C++, Java and C#)
- Data type of members and return types of methods of a class (only for C++, Java and C#)
The DOT file for this was generated using these options:tags2uml --members=1 --methods=1 --infile tags --outfile guava-eventbus.dot
.
This is a whitebox UML class diagram of theGoogle Guava EventBus, which is set to show all members and methods as well as have inheritance and relationship enabled. This was theinput tags file that was used and this was theoutput DOT file that was generated using tags2uml.
First, install theGo toolchain.
Please seethese instructions on how to setup thesrc
,pkg
andbin
directories. Thetags2uml
repository should be belowsrc
TheGOPATH
environment variable also needs to be setup according tothese instructions to point to the root directory of the Go projects like this:export GOPATH=$HOME/goprojects
in Linux, orset GOPATH=c:/goprojects
in Windows.
Then, run these commands to clone the git repository and then build the source code:
git clone https://github.com/ruben2020/tags2uml.git$GOPATH/src/tags2umlgo install tags2uml
After doing the above, the executable binarytags2uml
should appear in$GOPATH/bin
in Linux. In Windows, thetags2uml.exe
executable binary should appear inc:\goprojects\bin
.
In order to use it directly, you could add it toPATH
like this:export PATH=$PATH:$GOPATH/bin
in Linux, orset PATH=%PATH%;c:\goprojects\bin
in Windows.
In Windows, you may also want to set theGOROOT
environment variable like this:set GOROOT=C:/go
to point to the Go tools installation path, and add Go to PATH like this:set PATH=%PATH%;c:\go
. The method to set the environment variables permanently in Windows can befound here.
The method to set the environment variables permanently in Linux is to place the aboveexport
commands into the~/.bashrc
file.
There are no build dependencies, but to use it, you would also needExuberant-ctags andGraphviz.
To get more information on how to use this tool, please usetags2uml --help
.
Basic use with default options (with automatic selection of files to be scanned):
cd~/MySourceCodectags --fields=+latinK -Rtags2uml --infile tags --outfile MySourceCode.dotdot -Tpng -oMySourceCode.png MySourceCode.dot
If you want to manually build a list of files to be scanned in Linux:
cd~/MySourceCodefind -iname"*.java"> ./myfiles.txtctags --fields=+latinK -L ./myfiles.txttags2uml --infile tags --outfile MySourceCode.dotdot -Tpng -oMySourceCode.png MySourceCode.dot
If you want to manually build a list of files to be scanned in Windows:
cd c:\MySourceCodedir /b/a/s *.java > myfiles.txt ctags --fields=+latinK -L myfiles.txttags2uml --infile tags --outfile MySourceCode.dotdot -Tpng -oMySourceCode.png MySourceCode.dot
Replace*.java
with relevant extensions.
You may also want to editmyfiles.txt
to exclude files that you do not wish to be scanned.
It's free open source software.
It is licensed under theApache License 2.0.
All DOT files generated using this tool are not subject to this license.
Yes. However, donations are welcomed.
For C++,inline assembly code is not supported by ctags. This mainly affects embedded software, OS and driver code.
Please exclude files with inline assembly code from the list of files to be scanned by ctags.
- Report bugs
- Provide feedback, new ideas, suggestions etc. What would you like to see?
- Tell your friends, propose it on StackOverflow, write about it, tweet it
- Fix bugs (see Issues tab)
ruben2020
(More welcomed)
We thank the people behind the following projects:
Exuberant-ctags
Graphviz
Go
About
Generates UML class diagrams, from source code. Command line tool to convert from a Exuberant-ctags tags file to a UML class diagram, through Graphviz DOT, for all object oriented languages supported by ctags