swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.76k stars 1.35k forks source link

Ability to "check in" swift packages. #7514

Open scott-lydon opened 7 months ago

scott-lydon commented 7 months ago

Description

With Cocoapods we have the ability to track dependencies with git and so we can "Check in" the dependencies into our own project. This saves developers from frequently updating dependencies, or face "bugs" for forgetting to update their dependencies.

Expected behavior

I want to be able to track swift package dependencies, and see them when I open up programs like terminal and sourcetree.

Actual behavior

I don't see swift package manager dependencies available to "check-in"

Steps to reproduce

  1. Clone a repo
  2. Import any swift package.
  3. Open up source tree, and observe the changes are not tracked.

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version && uname -a)

No response

My StackOVerflow inquiry

rauhul commented 6 months ago

+1 I would like to a see a swift package vendor command. @DougGregor is this something we could build with the new package manifest editing support, e.g. a CLI and LSP action to vendor a dependency? (There's probably a bit more to it with for still being able to update the vendored package)

DougGregor commented 6 months ago

It's fairly easy to introduce new packages manifest editing commands with the infrastructure we have. I don't quite know what you want out of "swift package vendor" in terms of other changes (copying in sources? Changing target dependencies?) that might be tricky.