#!/bin/bash
usage() {
echo "Usage:"
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, cpd-gui, designer, bgastviewer, designerold, ast-dump"
}
is_cygwin() {
case "$(uname)" in
CYGWIN*|MINGW*)
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
[ -n "${JAVA_HOME}" ] && JAVA_HOME=$(cygpath --windows "${JAVA_HOME}")
[ -n "${JAVAFX_HOME}" ] && JAVAFX_HOME=$(cygpath --windows "${JAVAFX_HOME}")
[ -n "${DIRECTORY}" ] && DIRECTORY=$(cygpath --windows "${DIRECTORY}")
classpath=$(cygpath --path --windows "${classpath}")
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 "${JAVAFX_HOME}" ] && JAVAFX_HOME=$(cygpath --unix "${JAVAFX_HOME}")
[ -n "${CLASSPATH}" ] && CLASSPATH=$(cygpath --path --unix "${CLASSPATH}")
fi
}
java_heapsize_settings() {
local heapsize=${HEAPSIZE}
case "${heapsize}" in
[1-9]*[mgMG])
readonly HEAPSIZE="-Xmx${heapsize}"
;;
'')
;;
*)
echo "HEAPSIZE '${HEAPSIZE}' unknown (try: 1024m)"
exit 1
esac
}
set_lib_dir() {
if [ -z "${LIB_DIR}" ]; then
# Allow for symlinks to this script
if [ -L "$0" ]; then
local script_real_loc=$(readlink "$0")
else
local script_real_loc=$0
fi
local script_dir=$(dirname "${script_real_loc}")
local cwd="${PWD}"
cd "${script_dir}/../lib"
readonly LIB_DIR=$(pwd -P)
cd "${cwd}"
fi
}
check_lib_dir() {
if [ ! -e "${LIB_DIR}" ]; then
echo "The jar directory [${LIB_DIR}] does not exist"
fi
}
function script_exit() {
echo "$1" >&2
exit 1
}
determine_java_version() {
local full_ver=$(java -version 2>&1)
# java_ver is eg "80" for java 1.8, "90" for java 9.0, "100" for java 10.0.x
readonly java_ver=$(echo "$full_ver" | sed -n '{
# replace early access versions, e.g. 11-ea with 11.0.0
s/-ea/.0.0/
# replace versions such as 10 with 10.0.0
s/version "\([0-9]\{1,\}\)"/version "\1.0.0"/
# replace old java versions 1.x.* (java 1.7, java 1.8) with x.*
s/version "1\.\(.*\)"/version "\1"/
# extract the major and minor parts of the version
s/^.* version "\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*".*$/\1\2/p
}')
# java_vendor is either java (oracle) or openjdk
readonly java_vendor=$(echo "$full_ver" | sed -n -e 's/^\(.*\) version .*$/\1/p')
}
jre_specific_vm_options() {
if [ "${APPNAME}" = "designer" ]
then
options=""
if [ "$java_ver" -ge 80 ] && [ "$java_ver" -lt 90 ]
then
# no options needed for java8.
options=""
elif [ "$java_ver" -ge 90 ] && [ "$java_ver" -lt 110 ] && [ "$java_vendor" = "java" ]
then
# java9 and java10 from oracle contain javafx as a module
# open internal module of javafx to reflection (for our TreeViewWrapper)
options="--add-opens javafx.controls/javafx.scene.control.skin=ALL-UNNAMED"
# The rest here is for RichtextFX
options+=" --add-opens javafx.graphics/javafx.scene.text=ALL-UNNAMED"
options+=" --add-opens javafx.graphics/com.sun.javafx.scene.text=ALL-UNNAMED"
options+=" --add-opens javafx.graphics/com.sun.javafx.text=ALL-UNNAMED"
options+=" --add-opens javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED"
# Warn of remaining illegal accesses
options+=" --illegal-access=warn"
elif [ "$java_vendor" = "openjdk" ] || ( [ "$java_vendor" = "java" ] && [ "$java_ver" -ge 110 ] )
then
# openjdk and java11 from oracle onwards do not contain javafx directly
# there are no extra options either - javafx will be added to the classpath without modules
options=""
fi
echo $options
else
echo ""
fi
}
function add_pmd_classpath() {
if [ -n "$classpath" ]; then
classpath="$classpath:${LIB_DIR}/*"
else
classpath="${LIB_DIR}/*"
fi
}
function add_openjfx_classpath() {
if [ "${APPNAME}" = "designer" ]
then
if [ "$java_vendor" = "openjdk" ] && [ "$java_ver" -lt 100 ]
then
script_exit "For openjfx at least java 10 is required"
elif [ "$java_vendor" = "openjdk" ] || ( [ "$java_vendor" = "java" ] && [ "$java_ver" -ge 110 ] )
then
# openjfx is required for openjdk builds and oracle java 11 or later
if [ -z "${JAVAFX_HOME}" ]
then
script_exit "The environment variable JAVAFX_HOME is missing."
else
# The wildcard will include only jar files, but we need to access also
# property files such as javafx.properties that lay bare in the dir
if [ -n "$classpath" ]; then
classpath="$classpath:${JAVAFX_HOME}/lib/*:${JAVAFX_HOME}/lib/"
else
classpath="${JAVAFX_HOME}/lib/*:${JAVAFX_HOME}/lib/"
fi
fi
fi
fi
}
readonly APPNAME="${1}"
if [ -z "${APPNAME}" ]; then
usage
exit 1
fi
shift
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.fxdesigner.DesignerStarter"
;;
"designerold")
echo "'designerold' is deprecated and will be removed in PMD 7.0.0, try the new 'designer' instead."
readonly CLASSNAME="net.sourceforge.pmd.util.designer.Designer"
;;
"bgastviewer")
echo "'bgastviewer' is deprecated and will be removed in PMD 7.0.0, try the new 'designer' instead."
readonly CLASSNAME="net.sourceforge.pmd.util.viewer.Viewer"
;;
"cpdgui")
echo "'cpdgui' is deprecated and will be removed in PMD 7.0.0, use 'cpd-gui' instead."
readonly CLASSNAME="net.sourceforge.pmd.cpd.GUI"
;;
"cpd-gui")
readonly CLASSNAME="net.sourceforge.pmd.cpd.GUI"
;;
"ast-dump")
readonly CLASSNAME="net.sourceforge.pmd.util.treeexport.TreeExportCli"
;;
*)
echo "${APPNAME} is NOT a valid application name, valid options are: $(valid_app_options)"
;;
esac
is_cygwin
set_lib_dir
check_lib_dir
convert_cygwin_vars
classpath=$CLASSPATH
add_pmd_classpath
determine_java_version
add_openjfx_classpath
cygwin_paths
java_heapsize_settings
java ${HEAPSIZE} ${PMD_JAVA_OPTS} $(jre_specific_vm_options) -cp "${classpath}" "${CLASSNAME}" "$@"
没有合适的资源?快使用搜索试试~ 我知道了~
代码审计pmd 代码审计工具最新
共76个文件
jar:66个
bat:7个
license:1个
需积分: 5 1 下载量 179 浏览量
2023-07-06
11:01:52
上传
评论
收藏 42.43MB ZIP 举报
温馨提示
代码审计pmd 代码审计工具最新
资源推荐
资源详情
资源评论
收起资源包目录
pmd-bin-6.55.0.zip (76个子文件)
pmd-bin-6.55.0
lib
j2objc-annotations-1.1.jar 9KB
stringtemplate-3.2.1.jar 145KB
pmd-kotlin-6.55.0.jar 38KB
scalapb-runtime_2.13-0.11.11.jar 2.31MB
javax.inject-1.jar 2KB
scala-library-2.13.9.jar 5.66MB
saxon-9.1.0.8.jar 4.81MB
cglib-3.3.0.jar 300KB
pmd-cpp-6.55.0.jar 34KB
geny_2.13-0.6.5.jar 83KB
slf4j-api-1.7.32.jar 41KB
pmd-ruby-6.55.0.jar 5KB
pmd-html-6.55.0.jar 29KB
pmd-xml-6.55.0.jar 63KB
lenses_2.13-0.11.11.jar 34KB
groovy-2.4.21.jar 4.49MB
pmd-dart-6.55.0.jar 266KB
pmd-java-6.55.0.jar 1.16MB
gson-2.8.9.jar 252KB
pmd-plsql-6.55.0.jar 549KB
pmd-swift-6.55.0.jar 429KB
rhino-1.7.14.jar 1.32MB
error_prone_annotations-2.1.3.jar 13KB
parsers_2.13-4.6.0.jar 1.16MB
pmd-apex-6.55.0.jar 352KB
pmd-visualforce-6.55.0.jar 136KB
sourcecode_2.13-0.3.0.jar 116KB
pmd-gherkin-6.55.0.jar 47KB
pmd-fortran-6.55.0.jar 5KB
commons-lang3-3.8.1.jar 490KB
scala-collection-compat_2.13-2.7.0.jar 5KB
pmd-core-6.55.0.jar 1.33MB
pmd-jsp-6.55.0.jar 98KB
pmd-ui-6.49.0.jar 5.49MB
pmd-matlab-6.55.0.jar 24KB
common_2.13-4.6.0.jar 2.27MB
jsr305-3.0.2.jar 19KB
logback-classic-1.2.9.jar 228KB
pmd-tsql-6.55.0.jar 133KB
fastparse-v2_2.13-2.3.1.jar 313KB
protobuf-java-3.16.3.jar 1.58MB
jol-core-0.4.jar 87KB
pmd-groovy-6.55.0.jar 5KB
pmd-scala_2.13-6.55.0.jar 186KB
trees_2.13-4.6.0.jar 4.31MB
antlr-runtime-3.5.2.jar 164KB
pmd-perl-6.55.0.jar 3KB
aopalliance-1.0.jar 4KB
pmd-python-6.55.0.jar 35KB
pmd-javascript-6.55.0.jar 141KB
pmd-objectivec-6.55.0.jar 52KB
pmd-apex-jorje-6.55.0.pom 5KB
pmd-cs-6.55.0.jar 36KB
saxon-9.1.0.8-dom.jar 126KB
antlr-2.7.7.jar 435KB
logback-core-1.2.9.jar 444KB
pmd-vm-6.55.0.jar 151KB
pmd-apex-jorje-6.55.0-lib.jar 6.46MB
pmd-modelica-6.55.0.jar 282KB
jsoup-1.15.3.jar 428KB
asm-9.4.jar 120KB
jcommander-1.48.jar 62KB
antlr4-runtime-4.7.2.jar 330KB
pmd-go-6.55.0.jar 156KB
animal-sniffer-annotations-1.14.jar 3KB
pmd-php-6.55.0.jar 5KB
pmd-lua-6.55.0.jar 106KB
LICENSE 13KB
bin
cpd.bat 161B
pmd.bat 275B
designer.bat 1KB
designerold.bat 176B
cpdgui.bat 161B
bgastviewer.bat 172B
run.sh 7KB
ast-dump.bat 183B
共 76 条
- 1
资源评论
smile_@定格
- 粉丝: 1
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- DHCP+NAPT+RIP+ACL
- Qt实战Qt项目(7)Qt实现网页浏览器
- Unity-WebGL配置系统教程(含iis本地部署)
- GIS图幅号计算工具,用于计算图幅号
- Python中Hadoop MapReduce的一个简单示例.zip
- Panoply软件是大名鼎鼎的NASA下属的GISS研究所开发的可视化软件,该软件可以实现对地学常用数据的读取,其中包括netC
- 一些高质量的学习Ruby的资源清单.zip
- 基于STM32智能家居(智能云)
- 适合江苏地带的别墅小院子图纸D038-两层-11.04&11.94米-施工图.dwg
- 农村小别墅图纸四合院图纸D037-两层-13.20&12.90米-施工图.dwg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功