yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
7.01k stars 818 forks source link

Generates Project with Extra Schemes (SPM Dependencies) #1356

Closed OmranK closed 7 months ago

OmranK commented 1 year ago

Not sure why (sometimes they are there, sometimes not) but xcodegen command creates a project with extra schemes that correlate to some of my Swift package dependencies. See lines 1 & 3:

Screenshot 2023-05-08 at 6 34 09 PM

yonaskolb commented 1 year ago

This is Xcode deciding you would like those schemes 🤷‍♂️
You can disable it in the scheme management window.

Screenshot 2023-05-09 at 6 39 35 pm

This writes a file to Project.xcodeproj/project.xcworkspace/xcshareddata/WorkSpaceSettings.xcsettings

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
    <false/>
</dict>
</plist>

You can check this file into git without checking other parts of the project in, or write it in a post gen script. Last I remember XcodeProj didn't have support for writing that file, and I'm not sure if that has changed since