nik*_*ano 10 xcode swift swift-package-manager
该框架包在其 Package.swift 文件中具有以下依赖项:
.package(url: "https://github.com/marmelroy/PhoneNumberKit.git", .upToNextMajor(from: "3.3.0")),
Run Code Online (Sandbox Code Playgroud)
Package.resolved 引用此 PhoneNumberKit 的部分如下所示:
{
"identity" : "phonenumberkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/marmelroy/PhoneNumberKit.git",
"state" : {
"revision" : "6edd6e38a30aec087cb97f7377edf876c29a427e",
"version" : "3.5.9"
}
}
Run Code Online (Sandbox Code Playgroud)
但是,当我打开 Xcode 时,它会自动执行“解析包图”步骤,将 Package.resolved 修改为:
{
"identity" : "phonenumberkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/marmelroy/PhoneNumberKit.git",
"state" : {
"revision" : "56f612ea0178406b1ff57846401bd68a57d96a80",
"version" : "3.5.4"
}
}
Run Code Online (Sandbox Code Playgroud)
对我来说,这根本没有意义,拥有 Package.resolved 文件的目的应该是确保从事同一项目的所有开发人员对所有依赖项使用相同的版本。
为什么Xcode会自动修改这个依赖的版本?
注意:我已将此 PhoneNumberKit 包放在这里作为示例,但实际上其他包也发生在我身上