summaryrefslogtreecommitdiff
path: root/dev-util/findbugs/files/launchers/fb
blob: 79d44a41681d593d42f164f542613b81e7414cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
escape_arg() {
	echo "$1" | sed -e "s,\\([\\\"'         ]\\),\\\\\\1,g"
}

# Set defaults
fb_mainclass="edu.umd.cs.findbugs.workflow.FB"
user_jvmargs=''
ea_arg=''
debug_arg=''
conservespace_arg=''
user_props=''

# Handle command line arguments.
while [ $# -gt 0 ]; do
	case $1 in
	-textui)
		fb_mainclass="edu.umd.cs.findbugs.FindBugs2"
		;;

	-jvmArgs)
		shift
		user_jvmargs="$1"
		;;
		
	-ea)
		ea_arg='-ea'
		;;

	-maxHeap)
		shift
		fb_maxheap="-Xmx$1m"
		;;

	-debug)
		debug_arg="-Dfindbugs.debug=true"
		;;

	-conserveSpace)
		conservespace_arg="-Dfindbugs.conserveSpace=true"
		;;

	-property)
		shift
		user_props="-D$1 $user_props"
		;;
	
	-D*=*)
		user_props="$1 $user_props"
		;;

	-version)
		fb_mainclass=edu.umd.cs.findbugs.Version
		fb_appargs="-release"
		while [ $# -gt 0 ]; do
			shift
		done
		;;

	-help)
		fb_mainclass="edu.umd.cs.findbugs.ShowHelp"
		;;

	# All unrecognized arguments will be accumulated and
	# passed to the application.
	*)
		fb_appargs="$fb_appargs `escape_arg "$1"`"
		;;
	esac

	shift
done

fb_maxheap=${fb_maxheap:-"-Xmx768m"}
fb_jvmargs="$fb_maxheap $user_jvmargs $debug_arg $conservespace_arg $user_props $ea_arg"
gjl_pkg_args="$fb_appargs"