Skip to content

Commit fe57da8

Browse files
Update envcov.sh to allow for CocoaPods use.
1 parent a530cb1 commit fe57da8

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

‎envcov.sh‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,36 @@
55
#
66

77
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8-
source ${DIR}/env.sh
8+
ENV_DIR="${DIR}"
9+
10+
if [[ $DIR == *Pods/XcodeCoverage* ]]
11+
then
12+
echo "Using Cocoapods!"
13+
cd ..
14+
cd ..
15+
16+
#The env.sh file will be in the project root.
17+
ENV_DIR="$(pwd)"
18+
fi
19+
20+
source ${ENV_DIR}/env.sh
921

1022
# Change the report name if you like:
1123
LCOV_INFO=Coverage.info
1224

1325
XCODECOVERAGE_PATH="${SRCROOT}/XcodeCoverage"
26+
27+
if [[ $DIR == *Pods/XcodeCoverage* ]]
28+
then
29+
echo "Using Cocoapods!"
30+
#The current directory will be where XcodeCoverage is living, not in SRCROOT
31+
XCODECOVERAGE_PATH="${DIR}"
32+
fi
33+
1434
LCOV_PATH="${XCODECOVERAGE_PATH}/lcov-1.11/bin"
1535
OBJ_DIR=${OBJECT_FILE_DIR_normal}/${CURRENT_ARCH}
1636

1737
# Fix for the new LLVM-COV that requires gcov to have a -v paramter
1838
LCOV() {
1939
${LCOV_PATH}/lcov "$@" --gcov-tool ${XCODECOVERAGE_PATH}/llvm-cov-wrapper.sh
20-
}
40+
}

0 commit comments

Comments
 (0)