Skip to content

Commit cecf4c0

Browse files
committed
icu4j + coverity!
1 parent 10092b4 commit cecf4c0

File tree

4 files changed

+69
-8
lines changed

4 files changed

+69
-8
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ src/tmp
1212
/Makefile.local
1313
/local-*
1414
/src/bin/cov-analysis-linux64*
15-
/src/bin/local-coverity.sh
15+
/src/bin/local-*

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,18 @@ this will make error messages work
4848
checking for ICU version numbers...
4949
```
5050

51+
## ICU4J
52+
53+
- the following will build (in-source!) using adoptopenjdk9
54+
55+
```shell
56+
docker-compose run fedora-j ant jar check
57+
```
58+
5159
## Coverity Scan
5260

61+
### ICU4C
62+
5363
https://scan.coverity.com/
5464

5565
- download the scanning tools and install them as `src/bin/cov-analysis-linux64/`
@@ -59,23 +69,21 @@ https://scan.coverity.com/
5969
the following contents: (see the coverity page for the project for more details)
6070

6171
```shell
62-
export PROJ=icu4c
6372
export COVERITY_TOKEN=yourtoken
6473
6574
```
6675

76+
6777
- Kick it off: `docker-compose run ubuntu /src/bin/cov-icu4c.sh`
6878

6979
Note: you may want to do `docker-compose run ubuntu` and then run the script from the command line
7080
if there are problems.
7181

72-
## ICU4J
73-
74-
- the following will build (in-source!) using adoptopenjdk9
82+
### ICU4J
7583

76-
```shell
77-
docker-compose run fedora-j ant jar check
78-
```
84+
- For J, create a similar `src/bin/local-coverity-j.sh`
85+
- Then run:
86+
`docker-compose -f local-docker-compose.yml run fedora-j /src/bin/cov-icu4j.sh`
7987

8088
## Author
8189

dockerfiles/fedora-j/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RUN dnf -q -y upgrade $RPMOPTZ
1313
ADD adoptopenjdk.repo /etc/yum.repos.d
1414
RUN dnf -q -y install adoptopenjdk-8-openj9 $RPMOPTZ
1515
RUN dnf -q -y install ant $RPMOPTZ
16+
RUN dnf -q -y install git curl $RPMOPTZ
1617
#extra
1718
# editing
1819
#RUN apt-get -q -y install emacs24-nox

src/bin/cov-icu4j.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/sh
2+
3+
PROJ=icu4j
4+
COVDIR=/src/bin/cov-analysis-linux64/
5+
# much of the rest is common to C and J - except build and auth
6+
if [ ! -x /src/bin/local-coverity.sh ];
7+
then
8+
echo missing /src/bin/local-coverity-j.sh
9+
exit 1
10+
fi
11+
. /src/bin/local-coverity.sh
12+
if [ ! -d ${COVDIR} ];
13+
then
14+
echo missing coverity dir ${COVDIR}
15+
exit 1
16+
fi
17+
18+
export PATH=${COVDIR}/bin:${PATH}
19+
# export WORKSPACE=$(pwd)
20+
export SRCDIR=/src/icu/icu4j
21+
# BLDDIR=${HOME}/${PROJ}.build.cov
22+
# echo building ${SRCDIR} in ${BLDDIR}
23+
# rm -rf ${BLDDIR} ; mkdir -p ${BLDDIR}
24+
# assume we can use C's ver!
25+
VERFILE=${SRCDIR}/../icu4c/source/common/unicode/uvernum.h
26+
# Get the ICU version from uversion.h or other headers
27+
geticuversion() {
28+
sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"
29+
}
30+
ICUVER=`geticuversion ${VERFILE}`
31+
SVN_REVISION=$(cd ${SRCDIR} >/dev/null && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD) || echo 'unknown')
32+
echo $ICUVER $SVN_REVISION
33+
cd ${SRCDIR}
34+
# C specific build
35+
# ${SRCDIR}/source/configure --disable-renaming --disable-extras --with-data-packaging=archive
36+
ant clean
37+
env COVERITY_UNSUPPORTED=1 ${COVDIR}/bin/cov-build --dir ${HOME}/cov-int ant || exit 1
38+
fgrep '[WARNING] No files were emitted' ${HOME}/cov-int/build-log.txt && exit 1
39+
cd ${HOME} && tar cfpz ${PROJ}.tgz ./cov-int &&
40+
ls -lh ${PROJ}.tgz &&
41+
curl --form token=${COVERITY_TOKEN} \
42+
--form email=${COVERITY_EMAIL} \
43+
--form file=@${PROJ}.tgz \
44+
--form version="${ICUVER}" \
45+
--form description="Manual submit from ${COVERITY_EMAIL} ${SVN_REVISION}" \
46+
https://scan.coverity.com/builds?project=${PROJ} -o form-submit.$$
47+
cat form-submit.$$ || exit 1
48+
echo uploaded r${SVN_REVISION} ${PROJ} ${ICUVER} as ${PROJ}.tgz
49+
echo done
50+
exit 0
51+
52+

0 commit comments

Comments
 (0)