Xcode 14 bug for local dependency.
-
Checkout this repository
-
Open
ZooModule/Package.swift
via Xcode -
Select
zoo
schema -
Run (Cmd + R)
-
It prints
not nya
-
Right click
AnimalModule/Sources/AnimalModule
directory in navigator -
Select
New File... > Swift File
-
Edit new
File.swift
as below
extension Cat: Nya {
public func nya() -> String { "nya" }
}
-
Run (Cmd + R)
-
It still prints
not nya
This is a problem
-
Select
File > Packages > Resolve Package Versions
-
Run (Cmd + R)
-
Finally it prints
nya
If you write extension Cat: Nya { ... }
after struct Cat
in Cat.swift
instead of new File.swift
,
it rebuild correctly without resolving package.
-
The new file
File.swift
can't delete from right click menus which is gray out. -
Delete
File.swift
from finder and xcode tracks it. SoFile.swift
is removed from navigator. -
Run (Cmd + R)
-
Build error happens.
Build input file cannot be found: '/Users/omochi/github/omochi/xcode-local-deps-bug/AnimalModule/Sources/AnimalModule/File.swift'.
Did you forget to declare this file as an output of a script phase or custom build rule which produces it?