Xcode 16 seems to „forget“ a swift package within a subfolder of a root package after restart or shut-down.
I have the following project structure, which also resembles the directory structure on disc:
MyPackage
- Package.swift
- README.md
- Sources
- MyPackage
- Tests
- MyPackageTests
- Tools
- MyGenerator // <- after restart this folder is not visible in the Xcode project navigator
- Package.swift
- Sources
- main.swift
- Tests
MyGenerator is a standalone package which is used during development of MyPackage to generate source code files for MyPackage based on text file input. Essentially an executable target script which I can run within its folder with:
swift run MyGenerator someInputFile.txt
MyPackage does NOT use MyGenerator as a dependency, nor do I want this tool listed as a dependency in MyPackage Package.swift
file.
Yet MyGenerator is part of the same Git repo, as it documents the changes to the tool on how to generate source code for MyPackage. Both packages are developed in tandem.
MyGenerator itself defines dependencies in its Package.swift
file, which are unrelated to the functionality of MyPackage.
After restart of Xcode or even just a longer shut-down period the MyGenerator subfolder is not visible in the Xcode project navigator, the /Tools
folder is empty. I have to manually add the sub package via Add files to "MyPackage"
-> Move files to destination
every time.
How can I solve that Xcode remembers the sub package unter /Tools
?
Edit: I am using Xcode 16.2