Skip to content

Instantly share code, notes, and snippets.

@pcantrell
Last active December 6, 2016 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcantrell/10cf1cc2cc2d8f1b5011e0ea5f828402 to your computer and use it in GitHub Desktop.
Save pcantrell/10cf1cc2cc2d8f1b5011e0ea5f828402 to your computer and use it in GitHub Desktop.

Do away with --enable-autopin and --disable-autopin. The only new package manager commands are pin and unpin.

There are two pinfiles: a private one and a shared one. The shared one is adjacent to Package.swift, as in the existing proposal. The private one is stored in some quasi-hidden location not likely to be checked in, e.g. a dotfile, and is an implementation detail.

swift package pin foo 1.2.3 writes a dependency version to the shared pinfile; swift package unpin foo removes it from the shared one. Running swift package pin foo with no version number copies the entry from the private pinfile to the shared one, with its current version.

swift package update only searches for new versions of packages listed in the private pinfile; --repin is required to update packages in the shared one.

In the shared pinfile, there is a boolean setting that determines whether newly downloaded dependencies are added to the shared pinfile. Both swift package pin --all and swift package pin --new set it to true; the corresponding unpin commands both set it to false. It is true by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment