From 0a3d86a0d0d64d529abba5b69bc441fe9089df3f Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Sun, 27 May 2007 20:17:55 +0000 Subject: [PATCH] Use pipes. --- umlgraph | 20 ++++++++++++++++++++ umlgraph.bat | 12 ++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100755 umlgraph diff --git a/umlgraph b/umlgraph new file mode 100755 index 0000000..dcc390d --- /dev/null +++ b/umlgraph @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Unix shell script to run UMLGraph on the specified base file name +# For this to work the JDK tools.jar file must be located in the +# same directory as UmlGraph.jar. You also need to adjust the path +# of UmlGraph.jar to the actual path where the jar file is installed. +# +# $Id$ +# + +if [ x$2 = x ] +then + echo usage: umlgraph base_file_name filetype [umlgraph arguments] 1>&2 + echo example: umlgraph MyClass png 1>&2 + echo '(The above will convert MyClass.java into MyClass.png)' 1>&2 + exit 1 +else + java -jar lib/UmlGraph.jar -package $* -output - $1.java | + dot -T$2 -o$1.$2 +fi diff --git a/umlgraph.bat b/umlgraph.bat index 00485e7..8c3b41f 100755 --- a/umlgraph.bat +++ b/umlgraph.bat @@ -1,15 +1,19 @@ @echo off -rem Run UMLGraph on the specified base file name +rem Windows batch file to run UMLGraph on the specified base file name +rem For this to work the JDK tools.jar file must be located in the +rem same directory as UmlGraph.jar. You also need to adjust the path +rem of UmlGraph.jar to the actual path where the jar file is installed. rem $Id$ if not "%2" == "" goto ok -echo usage: umlgraph base_file_name filetype [umlgraph arguments] +echo usage: umlgraph base_file_name filetype [umlgraph arguments] 1>&2 +echo example: umlgraph MyClass png 1>&2 +echo (The above will convert MyClass.java into MyClass.png) 1>&2 goto end :ok -javadoc -docletpath lib/UmlGraph.jar -package -doclet gr.spinellis.umlgraph.doclet.UmlGraph %3 %4 %5 %6 %7 %8 %9 -output %1.dot %1.java -dot -T%2 -o%1.%2 %1.dot +java -jar lib/UmlGraph.jar -package %3 %4 %5 %6 %7 %8 %9 -output - %1.java | dot -T%2 -o%1.%2 :end