standard unix scripts can be used with cygwin
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5995 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -20,6 +20,11 @@ if [ -z "$1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
esac
|
||||
|
||||
SCRIPT_DIR=`dirname $0`
|
||||
CWD="$PWD"
|
||||
@ -27,6 +32,14 @@ CWD="$PWD"
|
||||
cd "$SCRIPT_DIR/../lib"
|
||||
LIB_DIR=`pwd -P`
|
||||
|
||||
# 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
|
||||
|
||||
classpath=$CLASSPATH
|
||||
|
||||
build_dir="$SCRIPT_DIR/../build"
|
||||
@ -62,4 +75,11 @@ esac
|
||||
|
||||
# echo "CLASSPATH: $classpath"
|
||||
|
||||
# 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
|
||||
|
||||
java $HEAPSIZE -cp $classpath net.sourceforge.pmd.cpd.CPD --minimum-tokens $MINIMUM_TOKENS --files $DIRECTORY --language $LANGUAGE
|
||||
|
19
pmd/bin/designer.sh
Executable file → Normal file
19
pmd/bin/designer.sh
Executable file → Normal file
@ -1,11 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
esac
|
||||
|
||||
SCRIPT_DIR=`dirname $0`
|
||||
CWD="$PWD"
|
||||
|
||||
cd "$SCRIPT_DIR/../lib"
|
||||
LIB_DIR=`pwd -P`
|
||||
|
||||
# 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
|
||||
|
||||
classpath=$CLASSPATH
|
||||
|
||||
build_dir="$SCRIPT_DIR/../build"
|
||||
@ -31,4 +45,9 @@ RULESETFILES="$@"
|
||||
|
||||
# echo "CLASSPATH: $classpath"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
classpath=`cygpath --path --windows "$classpath"`
|
||||
fi
|
||||
|
||||
java -cp $classpath net.sourceforge.pmd.util.designer.Designer
|
||||
|
21
pmd/bin/pmd.sh
Executable file → Normal file
21
pmd/bin/pmd.sh
Executable file → Normal file
@ -7,12 +7,26 @@ if [ -z "$3" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
esac
|
||||
|
||||
SCRIPT_DIR=`dirname $0`
|
||||
CWD="$PWD"
|
||||
|
||||
cd "$SCRIPT_DIR/../lib"
|
||||
LIB_DIR=`pwd -P`
|
||||
|
||||
# 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
|
||||
|
||||
classpath=$CLASSPATH
|
||||
|
||||
build_dir="$SCRIPT_DIR/../build"
|
||||
@ -38,4 +52,11 @@ RULESETFILES="$@"
|
||||
|
||||
# echo "CLASSPATH: $classpath"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
|
||||
classpath=`cygpath --path --windows "$classpath"`
|
||||
FILE=`cygpath --windows "$FILE"`
|
||||
fi
|
||||
|
||||
java -Xmx512m -cp $classpath net.sourceforge.pmd.PMD $FILE $FORMAT $RULESETFILES
|
||||
|
@ -8,6 +8,7 @@ Update RuleSetWriter to handle non-Apache TRAX implementations, add an option to
|
||||
bin and java14/bin scripts:
|
||||
retroweaver version was not correct in java14/bin scripts
|
||||
support for extra languages in cpd.sh
|
||||
standard unix scripts can be used with cygwin
|
||||
|
||||
March 25, 2008 - 4.2:
|
||||
|
||||
|
@ -24,6 +24,12 @@ fi
|
||||
SCRIPT_DIR=`dirname $0`
|
||||
CWD="$PWD"
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
esac
|
||||
|
||||
cd "$SCRIPT_DIR/../../lib"
|
||||
LIB_DIR=`pwd -P`
|
||||
|
||||
@ -31,6 +37,14 @@ cd "$CWD"
|
||||
cd "$SCRIPT_DIR/../lib"
|
||||
RW_LIB_DIR=`pwd -P`
|
||||
|
||||
# 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
|
||||
|
||||
classpath=$CLASSPATH
|
||||
|
||||
for jarfile in `ls $RW_LIB_DIR/*.jar`; do
|
||||
@ -70,4 +84,11 @@ esac
|
||||
|
||||
# echo "CLASSPATH: $classpath"
|
||||
|
||||
# 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
|
||||
|
||||
java $HEAPSIZE -cp $classpath net.sourceforge.pmd.cpd.CPD --minimum-tokens $MINIMUM_TOKENS --files $DIRECTORY --language $LANGUAGE
|
||||
|
@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
esac
|
||||
|
||||
SCRIPT_DIR=`dirname $0`
|
||||
CWD="$PWD"
|
||||
|
||||
@ -10,6 +16,14 @@ cd "$CWD"
|
||||
cd "$SCRIPT_DIR/../lib"
|
||||
RW_LIB_DIR=`pwd -P`
|
||||
|
||||
# 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
|
||||
|
||||
classpath=$CLASSPATH
|
||||
|
||||
for jarfile in `ls $RW_LIB_DIR/*.jar`; do
|
||||
@ -39,4 +53,9 @@ RULESETFILES="$@"
|
||||
|
||||
# echo "CLASSPATH: $classpath"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
classpath=`cygpath --path --windows "$classpath"`
|
||||
fi
|
||||
|
||||
java -cp $classpath net.sourceforge.pmd.util.designer.Designer
|
||||
|
@ -7,6 +7,12 @@ if [ -z "$3" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
esac
|
||||
|
||||
SCRIPT_DIR=`dirname $0`
|
||||
CWD="$PWD"
|
||||
|
||||
@ -17,6 +23,14 @@ cd "$CWD"
|
||||
cd "$SCRIPT_DIR/../lib"
|
||||
RW_LIB_DIR=`pwd -P`
|
||||
|
||||
# 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
|
||||
|
||||
classpath=$CLASSPATH
|
||||
|
||||
for jarfile in `ls $RW_LIB_DIR/*.jar`; do
|
||||
@ -46,4 +60,11 @@ RULESETFILES="$@"
|
||||
|
||||
# echo "CLASSPATH: $classpath"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
|
||||
classpath=`cygpath --path --windows "$classpath"`
|
||||
FILE=`cygpath --windows "$FILE"`
|
||||
fi
|
||||
|
||||
java -Xmx512m -cp $classpath net.sourceforge.pmd.PMD $FILE $FORMAT $RULESETFILES
|
||||
|
Reference in New Issue
Block a user