Skip to content

Commit 81473c9

Browse files
authored
Merge branch 'main' into main
2 parents 98f4cce + 3755557 commit 81473c9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

xcodeproj/internal/templates/generate_bazel_dependencies.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,14 @@ if [ "$ACTION" == "indexbuild" ]; then
121121
apply_sanitizers=0
122122
elif [ "${ENABLE_PREVIEWS:-}" == "YES" ]; then
123123
readonly config="${BAZEL_CONFIG}_swiftuipreviews"
124-
elif [ "${ENABLE_CODE_COVERAGE:-}" == "YES" ]; then
124+
elif [ "${CLANG_COVERAGE_MAPPING:-}" == YES ]; then
125+
# Code coverage build
126+
#
127+
# CLANG_COVERAGE_MAPPING is set to YES when the active scheme's test action has code coverage enabled. It is configured
128+
# irrespective of the value of ENABLE_CODE_COVERAGE, and of whether the current build action is for testing or not.
129+
#
130+
# We would rather use ENABLE_CODE_COVERAGE here, but the value of that setting is often YES even when code coverage is not
131+
# enabled in the active scheme.
125132
readonly config="${BAZEL_CONFIG}_coverage"
126133

127134
echo "warning: Code coverage is enabled. In order to maintain compatibility with Xcode, the instrumented build is not hermetic. Remote cache performance will be affected." >&2

0 commit comments

Comments
 (0)