We’re trying to use xcov in Danger to enforce a minimal coverage percentage in our pull requests. Xcov analyses the *.xccoverage files that are in the
DerivedData/AppNam-somerandomstring/Logs/Test/ directory. The problem is, it cannot determine this location automatically when run on Bitrise.io.
By default, xcov gets this location using the grandparent directory of
SYMROOT from the Xcode build settings (
xcodebuild -showBuildSettings). However, this setting seems to change after the Xcode Test step, causing xcov to fail.
We could set the location in the Danger config, but there’s no way to find it using the available environment variables. For now our only option seems to be getting the location by scanning
/Users/vagrant/Library/Developer/Xcode/DerivedData/ in a custom Script step.
Do you have any advice on how to get xcov working automatically? Or any better way to find the exact DerivedData location?
Update: I was able to get the correct DerivedData location by using the
OBJROOT value from the
xcodebuild -showBuildSettings in a custom script step. This is an ugly workaround, so I’d still appreciate some help here.