SwiftPackageIndex-Server icon indicating copy to clipboard operation
SwiftPackageIndex-Server copied to clipboard

Support selecting a specific Xcode project for `xcodebuild` through the SPI manifest

Open daveverwer opened this issue 3 years ago • 3 comments

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.

daveverwer avatar Jul 21 '22 13:07 daveverwer

Could you instead (or by default?) run xcodebuild for every project that you find (by filtering the directory contents with the xcodeproj extension)?

samdeane avatar Jul 22 '22 17:07 samdeane

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).

finestructure avatar Jul 23 '22 06:07 finestructure

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.

samdeane avatar Jul 25 '22 08:07 samdeane