@@ -83,6 +83,33 @@ common:rules_xcodeproj_indexbuild --config=rules_xcodeproj
8383# Disable BES for Index Builds, as it runs a lot, and isn't user invoked
8484common:rules_xcodeproj_indexbuild --bes_backend= --bes_results_url=
8585
86+ ### `--config=rules_xcodeproj_coverage`
87+ #
88+ # Used when doing building for code coverage.
89+
90+ common:rules_xcodeproj_coverage --config=rules_xcodeproj
91+
92+ # Enable features that allow for building for instrumentation.
93+ #
94+ # Of particular note are the (swift./)coverage_prefix_map_canonical_non_hermetic
95+ # features, which remap the execroot during the build as the absolute, canonical path
96+ # to the source root.
97+ #
98+ # This approach breaks remote caching when building for testing and codeCoverageEnabled
99+ # is set to YES, but does not affect other builds (for running, or for testing without
100+ # coverage).
101+ common:rules_xcodeproj_coverage --features=coverage
102+ common:rules_xcodeproj_coverage --features=llvm_coverage_map_format
103+ common:rules_xcodeproj_coverage --features=coverage_prefix_map_canonical_non_hermetic
104+ common:rules_xcodeproj_coverage --features=swift.coverage
105+ common:rules_xcodeproj_coverage --features=swift.coverage_prefix_map_canonical_non_hermetic
106+
107+ # Disable features that interfere with (swift./)coverage_prefix_map_canonical_non_hermetic
108+ common:rules_xcodeproj_coverage --features=-coverage_prefix_map
109+ common:rules_xcodeproj_coverage --features=-file_prefix_map
110+ common:rules_xcodeproj_coverage --features=-swift.coverage_prefix_map
111+ common:rules_xcodeproj_coverage --features=-swift.file_prefix_map
112+
86113### `--config=rules_xcodeproj_swiftuipreviews`
87114#
88115# Used when doing a Xcode Previews build.
0 commit comments