| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
set -u |
| 10 |
cd "$(dirname "$0")/.." |
| 11 |
status=0 |
| 12 |
gradle --offline --no-daemon --continue \ |
| 13 |
:app:createDebugUnitTestCoverageReport \ |
| 14 |
:app:assembleDebug || status=$? |
| 15 |
|
| 16 |
{ |
| 17 |
echo '<?xml version="1.0" encoding="UTF-8"?>' |
| 18 |
echo '<testsuites>' |
| 19 |
for f in app/build/test-results/testDebugUnitTest/TEST-*.xml; do |
| 20 |
[ -f "$f" ] && sed '/^<?xml /d' "$f" |
| 21 |
done |
| 22 |
echo '</testsuites>' |
| 23 |
} > junit.xml |
| 24 |
report=app/build/reports/coverage/test/debug/report.xml |
| 25 |
if [ -f "$report" ]; then |
| 26 |
cp "$report" coverage.xml |
| 27 |
else |
| 28 |
echo "ci: no coverage report at $report" >&2 |
| 29 |
[ "$status" -ne 0 ] || status=1 |
| 30 |
fi |
| 31 |
exit "$status" |