The way that we specify dependencies in Package.swift, with URLs to a git repository (frequently Github) or paths to a local file, work great when the specified resource is available. But what happens when the network goes down?
When I was working with an entirely Java ecosystem, we addressed this with a caching proxy for artifacts, so that when a road crew accidentally cut our network cable and our whole office was without internet for a day, we didn't lose a day's work -- clean builds could still happen, since our builds didn't go to maven central but to our local artifact repository.
It seems to me that this approach wouldn't work with SPM, since each dependency is specified by a fully qualified URL, and of course our direct dependencies may pull in transitive dependencies which are themselves specified with fully qualified URLs.
But it also seems to me that I'm far from the smartest guy in the room, so someone else must have noticed this already. What's the answer? Is there some tool that you can point at a Package.swift and have it pull in the full dependency tree and store it somewhere locally, so that if you then delete your project's .build
directory and run swift build
the dependencies will be fetched again, but from the local directory?