pmd: merge all .sh scripts into one run.sh

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7454 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse committed 2011-11-17 15:12:16 +00:00
1 parent 659614ea7e
commit 17eb4b6957
5 files changed
+33 -277

No files matched your search

-84
View File
@@ -1,84 +0,0 @@
#!/bin/sh
readonly CLASSNAME="net.sourceforge.pmd.util.viewer.Viewer"
usage() {
echo "Usage:"
echo " $(basename $0) [-h]"
echo ""
echo "-h print this help"
}
is_cygwin() {
case "$(uname)" in
CYGWIN*)
readonly cygwin=true
;;
esac
# OS specific support. $var _must_ be set to either true or false.
if [ -z ${cygwin} ] ; then
readonly cygwin=false
fi
}
cygwin_paths() {
# For Cygwin, switch paths to Windows format before running java
if ${cygwin} ; then
JAVA_HOME=$(cygpath --windows "${JAVA_HOME}")
classpath=$(cygpath --path --windows "${classpath}")
DIRECTORY=$(cygpath --windows "${DIRECTORY}")
fi
}
convert_cygwin_vars() {
# If cygwin, convert to Unix form before manipulating
if $cygwin ; then
[ -n "${JAVA_HOME}" ] &&
JAVA_HOME=$(cygpath --unix "${JAVA_HOME}")
[ -n "${CLASSPATH}" ] &&
CLASSPATH=$(cygpath --path --unix "${CLASSPATH}")
fi
}
java_heapsize_settings() {
local heapsize=${HEAPSIZE:-512m}
case "${heapsize}" in
[1-9]*[mgMG])
readonly HEAPSIZE="-Xmx${heapsize}"
;;
'')
;;
*)
echo "HEAPSIZE '${HEAPSIZE}' unknown (try: 512m)"
exit 1
esac
}
# move to java
#if [ -z "$3" ]; then
# usage
# exit 1
#fi
is_cygwin
readonly SCRIPT_DIR=$(dirname ${0})
CWD="${PWD}"
cd "${SCRIPT_DIR}/../lib"
readonly LIB_DIR=$(pwd -P)
convert_cygwin_vars
classpath="${CLASSPATH}"
cd "${CWD}"
for jarfile in ${LIB_DIR}/*.jar; do
classpath=${classpath}:${jarfile}
done
cygwin_paths
java_heapsize_settings
java "${HEAPSIZE}" -cp "${classpath}" "${CLASSNAME}" ${@}
-84
View File
@@ -1,84 +0,0 @@
#!/bin/sh
readonly CLASSNAME="net.sourceforge.pmd.cpd.CPD"
usage() {
echo "Usage:"
echo " $(basename $0) [-h]"
echo ""
echo "-h print this help"
}
is_cygwin() {
case "$(uname)" in
CYGWIN*)
readonly cygwin=true
;;
esac
# OS specific support. $var _must_ be set to either true or false.
if [ -z ${cygwin} ] ; then
readonly cygwin=false
fi
}
cygwin_paths() {
# For Cygwin, switch paths to Windows format before running java
if ${cygwin} ; then
JAVA_HOME=$(cygpath --windows "${JAVA_HOME}")
classpath=$(cygpath --path --windows "${classpath}")
DIRECTORY=$(cygpath --windows "${DIRECTORY}")
fi
}
convert_cygwin_vars() {
# If cygwin, convert to Unix form before manipulating
if $cygwin ; then
[ -n "${JAVA_HOME}" ] &&
JAVA_HOME=$(cygpath --unix "${JAVA_HOME}")
[ -n "${CLASSPATH}" ] &&
CLASSPATH=$(cygpath --path --unix "${CLASSPATH}")
fi
}
java_heapsize_settings() {
local heapsize=${HEAPSIZE:-512m}
case "${heapsize}" in
[1-9]*[mgMG])
readonly HEAPSIZE="-Xmx${heapsize}"
;;
'')
;;
*)
echo "HEAPSIZE '${HEAPSIZE}' unknown (try: 512m)"
exit 1
esac
}
# move to java
#if [ -z "$3" ]; then
# usage
# exit 1
#fi
is_cygwin
readonly SCRIPT_DIR=$(dirname ${0})
CWD="${PWD}"
cd "${SCRIPT_DIR}/../lib"
readonly LIB_DIR=$(pwd -P)
convert_cygwin_vars
classpath="${CLASSPATH}"
cd "${CWD}"
for jarfile in ${LIB_DIR}/*.jar; do
classpath=${classpath}:${jarfile}
done
cygwin_paths
java_heapsize_settings
java "${HEAPSIZE}" -cp "${classpath}" "${CLASSNAME}" ${@}
-18
View File
@@ -1,18 +0,0 @@
#!/bin/sh
# Shell script to launch PMD's Copy Paste Detector GUI on a
# UNIX system, based on the cpdgui.bat file used to do the
# same on MS Windows systems. This requires that the "java"
# command be in your executable PATH.
# Version number for this PMD release
readonly VERSION=5.0
readonly BINDIR=$(dirname $0)
readonly ROOTDIR=${BINDIR}/..
readonly PMDJAR=${ROOTDIR}/lib/pmd-${VERSION}.jar
readonly JARPATH=${TOPDIR}/lib/asm-3.2.jar:${TOPDIR}/lib/jaxen-1.1.1.jar
readonly JVMOPTS=-Xmx512m
readonly MAIN_CLASS=net.sourceforge.pmd.cpd.GUI
java ${JVMOPTS} -cp "${PMDJAR}:${JARPATH}" "${MAIN_CLASS}" $*
-84
View File
@@ -1,84 +0,0 @@
#!/bin/bash
readonly CLASSNAME="net.sourceforge.pmd.util.designer.Designer"
usage() {
echo "Usage:"
echo " $(basename $0) [-h]"
echo ""
echo "-h print this help"
}
is_cygwin() {
case "$(uname)" in
CYGWIN*)
readonly cygwin=true
;;
esac
# OS specific support. $var _must_ be set to either true or false.
if [ -z ${cygwin} ] ; then
readonly cygwin=false
fi
}
cygwin_paths() {
# For Cygwin, switch paths to Windows format before running java
if ${cygwin} ; then
JAVA_HOME=$(cygpath --windows "${JAVA_HOME}")
classpath=$(cygpath --path --windows "${classpath}")
DIRECTORY=$(cygpath --windows "${DIRECTORY}")
fi
}
convert_cygwin_vars() {
# If cygwin, convert to Unix form before manipulating
if $cygwin ; then
[ -n "${JAVA_HOME}" ] &&
JAVA_HOME=$(cygpath --unix "${JAVA_HOME}")
[ -n "${CLASSPATH}" ] &&
CLASSPATH=$(cygpath --path --unix "${CLASSPATH}")
fi
}
java_heapsize_settings() {
local heapsize=${HEAPSIZE:-512m}
case "${heapsize}" in
[1-9]*[mgMG])
readonly HEAPSIZE="-Xmx${heapsize}"
;;
'')
;;
*)
echo "HEAPSIZE '${HEAPSIZE}' unknown (try: 512m)"
exit 1
esac
}
# move to java
#if [ -z "$3" ]; then
# usage
# exit 1
#fi
is_cygwin
readonly SCRIPT_DIR=$(dirname ${0})
CWD="${PWD}"
cd "${SCRIPT_DIR}/../lib"
readonly LIB_DIR=$(pwd -P)
convert_cygwin_vars
classpath="${CLASSPATH}"
cd "${CWD}"
for jarfile in ${LIB_DIR}/*.jar; do
classpath=${classpath}:${jarfile}
done
cygwin_paths
java_heapsize_settings
java "${HEAPSIZE}" -cp "${classpath}" "${CLASSNAME}" ${@}
+33 -7
View File
@@ -1,11 +1,16 @@
#!/bin/bash
readonly CLASSNAME="net.sourceforge.pmd.PMD"
usage() {
echo "Usage:"
echo " $(basename $0) [-h|-v] <java-src-file> html|xml|text|vbhtml rulesetfile1[,rulesetfile2[,..]]"
echo " $(basename $0) <application-name> [-h|-v] ..."
echo ""
echo "application-name: valid options are: $(valid_app_options)"
echo "-h print this help"
echo "-v display PMD's version"
}
valid_app_options () {
echo "pmd, cpd, cpdgui, designer,bgastviewer"
}
is_cygwin() {
@@ -53,11 +58,32 @@ java_heapsize_settings() {
esac
}
# move to java
#if [ -z "$3" ]; then
# usage
# exit 1
#fi
readonly APPNAME="${1}"
if [ -z "${APPNAME}" ]; then
usage
exit 1
fi
case "${APPNAME}" in
"pmd")
readonly CLASSNAME="net.sourceforge.pmd.PMD"
;;
"cpd")
readonly CLASSNAME="net.sourceforge.pmd.cpd.CPD"
;;
"designer")
readonly CLASSNAME="net.sourceforge.pmd.util.designer.Designer"
;;
"bgastviewer")
readonly CLASSNAME="net.sourceforge.pmd.util.viewer.Viewer"
;;
"cpdgui")
readonly CLASSNAME="net.sourceforge.pmd.cpd.GUI"
;;
*)
echo "${APPNAME} is NOT a valid application name, valid options are:$(valid_app_options)"
;;
esac
is_cygwin