Last active
January 10, 2022 12:37
-
-
Save grigorye/f6dfaa9f7bd9dbb192fe25a6cdb419d4 to your computer and use it in GitHub Desktop.
Disable coverage for cocoapods (incl. Swift)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Append the block below to your Podfile | |
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
target.build_configurations.each do |configuration| | |
configuration.build_settings['CLANG_ENABLE_CODE_COVERAGE'] = 'NO' | |
configuration.build_settings['SWIFT_EXEC'] = '$(SRCROOT)/SWIFT_EXEC-no-coverage' | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl -w | |
use strict; | |
use Getopt::Long qw(:config pass_through); | |
my $profile_coverage_mapping; | |
GetOptions("profile-coverage-mapping" => \$profile_coverage_mapping); | |
# At this point @ARGV will have the above options filtered out. | |
exec( | |
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc", | |
@ARGV); |
@ppamorim Try renaming "SWIFT_EXEC-no-coverage" to "swiftc" (and adjust the value in Podfile). There seems to be an extra check in the current compiler: https://github.com/apple/swift-driver/blob/16111276386b8bad5e713e72d0f1c08130558171/Sources/SwiftDriver/Driver/Driver.swift#L1105
@grigorye Thank you. Could you please add this to my Stackoverflow question? https://stackoverflow.com/questions/70637768/unexpected-error-in-driver-invocation-invalid-driver-name-swift-exec-no-covera
Does it (renaming) work/help at all? If not, I feel a bit hesitant to add it to Stackoverflow...
Yes it does work.
👍 (Replied on Stackoverflow)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am getting the error
Unexpected error in driver invocation: invalid driver name: SWIFT_EXEC-no-coverage
on Xcode 13.2.1.