Skip to content

Instantly share code, notes, and snippets.

@jpmartha
Last active March 29, 2016 20:54
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 jpmartha/349ae1625d95ed442511989aa005c97b to your computer and use it in GitHub Desktop.
Save jpmartha/349ae1625d95ed442511989aa005c97b to your computer and use it in GitHub Desktop.
How to use `$ swift build --fetch`

#Overview

I had seen the following:

https://github.com/apple/swift-package-manager/blob/swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a/Sources/Get/Fetcher.swift#L78-L86

so I tried to run the $ swift build --fetch command.

  • The first $ swift build --fetch has succeeded.
  • The second $ swift build --fetch has failed without running $ swift build --clean=dist.

Questions

  • Am I using it the wrong way?
  • By any chance, hasn't $ swift build --fetch supported in these situation yet?

Environments

  • OS X 10.11.4
  • swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a

The Manifest File

import PackageDescription

let package = Package(
    name: "MyProject",
    dependencies: [
        .Package(url: "../Pokemon", versions: Version(1,0,0)..<Version(2,0,0)),
    ]
)

The lasted tag of Pokemon is 1.7.0.

Operations

  1. Run $ swift build --clean=dist.
  2. Run $ swift build --fetch , then Pokemon is updated to 1.7.0.
  3. Run $ git tag 1.8.0 against Pokemon , then the lasted tag of Pokemon is 1.8.0.
  4. Run $ swift build --fetch , then Pokemon is not updated.
  5. Run $ swift build --clean=dist.
  6. Run $ swift build --fetch , then Pokemon is updated to 1.8.0.

I expected Pokemon had updated to 1.8.0 with the 4th operation.

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