-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBeautifulJava
executable file
·65 lines (54 loc) · 1.12 KB
/
BeautifulJava
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
#!/bin/bash
set -e
[[ "${@}" == *"--javadoc"* ]] && GENERATE_JAVADOC='yes'
[[ "${@}" == *"--format-input"* ]] && FORMAT_INPUT='yes'
[[ "${@}" == *"--format-output"* ]] && FORMAT_OUTPUT='yes'
for ARG; do
[[ ! "${ARG}" == '--javadoc' ]] && \
[[ ! "${ARG}" == '--format-input' ]] && \
[[ ! "${ARG}" == '--format-output' ]] && ARGS+=("${ARG}")
done
set -- "${ARGS[@]}"
#
# Check Zomboid version
#
echo "* Checking Zomboid version..."
. "$(dirname "${0}")/scripts/config.sh" --clean
echo "* Found version ${VERSION}"
#
# Copy zomboid files
#
echo "* Copying Zomboid files..."
copyfiles
#
# Run IntelliJ decompiler
#
echo "* Decompiling class files..."
decompile
#
# Run BeautifulJava
#
echo
echo "* Fixing symbols..."
beautiful "${SOURCEDIR}" ${@}
#
# Run IntelliJ code formatter
#
if [ "${FORMAT_INPUT}" = "yes" ]; then
echo
echo "* Formatting decompiled files..."
formatter "${DECOMPDIR}"
fi
if [ "${FORMAT_OUTPUT}" = "yes" ]; then
echo
echo "* Formatting source files..."
formatter "${SOURCEDIR}"
fi
#
# Generate Javadoc
#
if ! [ -z "${GENERATE_JAVADOC}" ]; then
echo
echo "* Generating Javadoc..."
javadoc
fi