From ca0b8c59c965cbf5cefccf0e8548122d141142cb Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Fri, 28 Sep 2007 11:32:21 +0000 Subject: [PATCH] Drop the requirement for copying Tools.jar. This follows a suggestion by Vadim Nasardinov. --- umlgraph | 13 ++++++++----- umlgraph.bat | 10 ++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/umlgraph b/umlgraph index dcc390d..7afc8ec 100755 --- a/umlgraph +++ b/umlgraph @@ -1,9 +1,8 @@ #!/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. +# For this to work you must adjust the following defintion of +# UMLGRAPH_HOME to point to the directory where UmlGraph.jar is installed. # # $Id$ # @@ -15,6 +14,10 @@ then 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 + BASE=$1 + FILETYPE=$2 + shift 2 + java -classpath "$UMLGRAPH_HOME/UmlGraph.jar:$JAVA_HOME/lib/Tools.jar" \ + gr.spinellis.umlgraph.doclet.UmlGraph -package $* -output - $BASE.java | + dot -T$FILETYPE -o$BASE.$FILETYPE fi diff --git a/umlgraph.bat b/umlgraph.bat index 8c3b41f..1854d31 100755 --- a/umlgraph.bat +++ b/umlgraph.bat @@ -1,12 +1,13 @@ @echo off 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 For this to work you must adjust the following defintion of +rem UMLGRAPH_HOME to point to the directory where UmlGraph.jar is installed. rem $Id$ +set UMLGRAPH_HOME=lib + if not "%2" == "" goto ok echo usage: umlgraph base_file_name filetype [umlgraph arguments] 1>&2 echo example: umlgraph MyClass png 1>&2 @@ -14,6 +15,7 @@ echo (The above will convert MyClass.java into MyClass.png) 1>&2 goto end :ok -java -jar lib/UmlGraph.jar -package %3 %4 %5 %6 %7 %8 %9 -output - %1.java | dot -T%2 -o%1.%2 + +java -classpath "%UMLGRAPH_HOME%\UmlGraph.jar;%JAVA_HOME%\lib\Tools.jar" gr.spinellis.umlgraph.doclet.UmlGraph -package %3 %4 %5 %6 %7 %8 %9 -output - %1.java | dot -T%2 -o%1.%2 :end