From 3a69e82384ff5a1af0424276da3bff2d3867e3bc Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Thu, 28 Mar 2019 12:07:41 +0100 Subject: [PATCH] coverage.sh: Adapt to new source directories and plugins Copy the source files to where they are expected. Signed-off-by: Edwin Kempin Change-Id: I4b514a71b65515f8287d19472a16c367e8955306 --- tools/coverage.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/coverage.sh b/tools/coverage.sh index 7c491fa2bb..11e50e62f9 100755 --- a/tools/coverage.sh +++ b/tools/coverage.sh @@ -29,8 +29,20 @@ bazel coverage -k --jobs=${COVERAGE_CPUS:-2} -- ... # limitation by running genhtml in a directory with the files in the # right place. Also -inexplicably- genhtml wants to have the source # files relative to the output directory. -mkdir -p ${destdir}/ -cp -a */src/{main,test}/java/* ${destdir}/ +mkdir -p ${destdir}/java +cp -r {java,javatests}/* ${destdir}/java + +mkdir -p ${destdir}/plugins +for plugin in `find plugins/ -type d` -maxdepth 1 +do + mkdir -p ${destdir}/${plugin}/java + cp -r plugins/*/{java,javatests}/* ${destdir}/${plugin}/java + + # for backwards compatibility support plugins with old file structure + mkdir -p ${destdir}/${plugin}/src/{main,test}/java + cp -r plugins/*/src/main/java/* ${destdir}/${plugin}/src/main/java + cp -r plugins/*/src/test/java/* ${destdir}/${plugin}/src/test/java +done base=$(bazel info bazel-testlogs) for f in $(find ${base} -name 'coverage.dat') ; do