Support selecting a specific Xcode project for `xcodebuild` through the SPI manifest
As reported by @groue in #1890 (thank you!), packages with multiple project files in the package root will not build as xcodebuild does not know which project file to use.
Passing the --project flag to xcodebuild fixes this. We should allow an Xcode project to be specified in the SPI manifest, just like we do for projects where we can not automatically detect the scheme.
For example, for GRDB:
env DEVELOPER_DIR="/Applications/Xcode-13.4.1.app" xcrun xcodebuild -IDEClonedSourcePackagesDirPathOverride="$PWD/.dependencies" -derivedDataPath "$PWD/.derivedData" build -project "GRDB.xcodeproj" -scheme "GRDBiOS" -destination "generic/platform=ios"
It would seem logical for this to be defined at the same level we currently define the scheme configuration inside the manifest, but that may change as we come to implement it.
Could you instead (or by default?) run xcodebuild for every project that you find (by filtering the directory contents with the xcodeproj extension)?
The problem with that is aggregating build success. We could require them all to succeed. However, say one is a sample project, we wouldn't want to mark the build as incompatible if that fails (easy to imagine as it's probably not part of CI).
You could still have a manifest flag for ultimate control. I was just thinking that the default of running all Xcode projects might reduce the number of interventions required.
I guess it's a relatively rare occurrence in the first place, however, so perhaps requiring intervention is not a problem.