-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild
executable file
·110 lines (94 loc) · 2.82 KB
/
build
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/ksh
#
# SPDX-License-Identifier: CDDL-1.0
#
# build illuminate
#
SVDIR=${0%/*}
LIBDIR=${SVDIR}/lib
JARLIBDIR=${LIBDIR}/java
XFLAGS="-Xlint -Xlint:-rawtypes"
SVJAR=${JARLIBDIR}/illuminate.jar
JINGLEJAR=${JARLIBDIR}/jingle.jar
JUMBLEJAR=${JARLIBDIR}/jumble.jar
JKJAR=${JARLIBDIR}/jkstat.jar
JPJAR=${JARLIBDIR}/jproc.jar
BUILDJARS=${JINGLEJAR}:${JUMBLEJAR}:${JKJAR}:${JPJAR}
PATH=/usr/jdk/instances/jdk1.8.0/bin:$PATH
export PATH
#
# run
# ./build pmd
# to use this, you must have pmd in your path
#
# new PMD version 7 only has categories, configured in pmd-ruleset.xml
#
PMDRULES="./pmd-ruleset.xml"
PMDCACHE="${HOME}/.pmd/cache.illuminate"
case $# in
0)
javac ${XFLAGS} -classpath .:"${BUILDJARS}" $(find org/tribblix -name '*.java')
jar -cmf illuminate.manifest "${SVJAR}" images/*.png pixmaps/* properties/*.properties help/*.html help/CDDL.txt $(find org/tribblix -name '*.class')
exit 0
;;
esac
case $1 in
doc|-doc)
rm -fr javadoc
mkdir javadoc
env CLASSPATH=.:"${JKJAR}":"${JPJAR}" javadoc -Xdoclint:all -Xmaxwarns 300 -d javadoc org.tribblix.illuminate org.tribblix.illuminate.helpers org.tribblix.illuminate.explorer org.tribblix.illuminate.pkgview
;;
clean|-clean)
rm -f $(find org/tribblix -type f -name '*.class')
rm -f $(find . -type f -name '*~')
rm -fr javadoc
;;
pmd|-pmd)
if [ ! -d "${HOME}/.pmd" ]; then
mkdir -p "${HOME}/.pmd"
fi
pmd check --cache "${PMDCACHE}" -d org -R ${PMDRULES} --use-version java-1.8 --aux-classpath $(echo lib/java/* | sed 's= =:=g') 2>/dev/null
pmd check --cache "${PMDCACHE}".html -d help/*.html -R category/html/bestpractices.xml 2>/dev/null
exit 0
;;
spotbugs)
#
# spotbugs works on the class files, so those need to be available
#
./build
spotbugs -auxclasspath $(echo lib/java/* | sed 's= =:=g') org
exit 0
;;
packages)
echo "Use the tribblix-package or standalone-packages arguments"
exit 0
;;
tribblix-package)
sed s:INSTALLED=false:INSTALLED=true: illuminate > illuminate.installed
./mkproto any deps > prototype.any
pkgmk -d /tmp -f prototype.any -r "$(pwd)" TRIBilluminate
pkgtrans -s /tmp /tmp/TRIBilluminate.pkg TRIBilluminate
rm -fr /tmp/TRIBilluminate
ls -l /tmp/TRIBilluminate.pkg
rm prototype.any
rm illuminate.installed
rm -f depend
exit 0
;;
standalone-packages)
sed s:INSTALLED=false:INSTALLED=true: illuminate > illuminate.installed
./mkproto i386 > prototype.i386
./mkproto sparc > prototype.sparc
pkgmk -d /tmp -f prototype.i386 -r "$(pwd)" TRIBilluminate
pkgtrans -s /tmp /tmp/TRIBilluminate-i386.pkg TRIBilluminate
rm -fr /tmp/TRIBilluminate
pkgmk -d /tmp -f prototype.sparc -r "$(pwd)" TRIBilluminate
pkgtrans -s /tmp /tmp/TRIBilluminate-sparc.pkg TRIBilluminate
rm -fr /tmp/TRIBilluminate
ls -l /tmp/TRIBilluminate-sparc.pkg /tmp/TRIBilluminate-i386.pkg
rm prototype.i386 prototype.sparc
rm illuminate.installed
rm -f depend
exit 0
;;
esac