Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

Apache-2.0
LICENSE
Unknown
LICENSE.md
NotificationsYou must be signed in to change notification settings

ruben2020/tags2uml

Repository files navigation

Generates UML class diagrams, from source code

Build Status

Overview

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.).

Latest version is v0.01

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.

Features

  • 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#)

Example of generated UML class diagram

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.

screenshot

How to build and install?

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.

What are the dependencies?

There are no build dependencies, but to use it, you would also needExuberant-ctags andGraphviz.

How to use it?

To get more information on how to use this tool, please usetags2uml --help.

The workflow looks like this:
workflow

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.

How is it licensed?

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.

Can I use it in a commercial environment without purchasing, for an unlimited time?

Yes. However, donations are welcomed.

Are there any known limitations?

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.

How can I contribute?

  • 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)

List of Contributors

ruben2020
(More welcomed)

Credits

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

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp