From 0e6f36bd7f0b6ebc006b1684b40198fdb99eea3f Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Thu, 4 Sep 2003 14:43:47 +0000 Subject: [PATCH] Applied run.sh cleanup patch; thanks to Vadim Nasardinov git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2237 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/run.sh | 43 ++++++++++++++++++++++++++++++++++++++++--- pmd/xdocs/credits.xml | 1 + 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/pmd/etc/run.sh b/pmd/etc/run.sh index d33bb8005d..7454c89ff5 100755 --- a/pmd/etc/run.sh +++ b/pmd/etc/run.sh @@ -1,4 +1,41 @@ +#!/bin/bash + +if [ -z "$3" ]; then + script=`basename $0` + echo "Usage:" + echo " $script html|xml rulesetfile1[,rulesetfile2[,..]]" + exit 1 +fi + +SCRIPT_DIR=`dirname $0` +CWD="$PWD" + +cd "$SCRIPT_DIR/../lib" +LIB_DIR=`pwd -P` + +classpath=$CLASSPATH + +build_dir="$SCRIPT_DIR/../build" + +if [ -d "$build_dir" ]; then + cd "$build_dir" + build_dir=`pwd -P` + classpath=$classpath:$build_dir +fi + +cd "$CWD" + +for jarfile in `ls $LIB_DIR/*.jar`; do + classpath=$classpath:$jarfile +done + + FILE=$1 -FORMAT=$2 -RULESETFILES=$3 -java -cp ../lib/pmd-1.2.1.jar:../lib/jaxen-core-1.0-fcs.jar:../lib/saxpath-1.0-fcs.jar net.sourceforge.pmd.PMD $FILE $FORMAT $RULESETFILES +shift +FORMAT=$1 +shift +RULESETFILES="$@" + +# echo "CLASSPATH: $classpath" + +java -cp $classpath net.sourceforge.pmd.PMD $FILE $FORMAT $RULESETFILES diff --git a/pmd/xdocs/credits.xml b/pmd/xdocs/credits.xml index 9006f8e3c6..c04d0bebc9 100644 --- a/pmd/xdocs/credits.xml +++ b/pmd/xdocs/credits.xml @@ -38,6 +38,7 @@
    +
  • Vadim Nasardinov - run.sh cleanup
  • Sreenivasa Viswanadha - grammar cleanup for Ctrl-Z problem
  • Sigiswald Madou - bug report
  • Dan Tullis - bug report