13

I created a Swift Package Manager library, and deployed it on my GitLab with a tag number 0.1.0. I'm now trying to add this package to my new vapor project by adding:

.package(url: "http://mygit.git/", from: "0.1.0").

When I try to make a "vapor update" I get a backgroundExecute error saying that my SPM has no manifest for version 0.1.0…

Any ideas? Thanks in advance!

ThatsJustCheesy
  • 1,370
  • 14
  • 24
Silvering
  • 756
  • 1
  • 6
  • 33
  • 2
    Try to reach your project by branch or commit instead of tag. – imike Jun 24 '19 at 08:07
  • btw, does your library have `Package.swift`? wanna test you lib, if possible please find me in discord as `imike#3049` – imike Jun 24 '19 at 08:09
  • Hi @imike I tried .package(url: "http://myPackage.git", .branch("dev")) without success and yes the lib contains a package.swift. I tried to send you a friend request in discord but can't work.. mine is Mickaël#0137 – Silvering Jun 24 '19 at 08:16
  • 2
    Thanks for reaching me on Discord. The problem was just in `Package.swift` which should be in the root directory. – imike Jun 24 '19 at 08:42
  • Did you find a solution? I am facing the same error. – IgorGanapolsky Apr 22 '21 at 17:05

2 Answers2

14

The Package.swift file has to be in the root directory.

Oded Breiner
  • 28,523
  • 10
  • 105
  • 71
1

For me I was trying to add the package by right-clicking on a project and instead had to go to File->Add Packages.... No idea why this is different but there you go.

Jeff
  • 2,701
  • 2
  • 22
  • 35