bignerdranch / Freddy

A reusable framework for parsing JSON in Swift.
MIT License
1.09k stars 120 forks source link

Swift Package Manager installation is failing. #224

Closed zorn closed 7 years ago

zorn commented 7 years ago

I tried to add Freddy to a simple Hello World Swift Package Manager app (first time playing with it). My Package.swift file:

import PackageDescription

let package = Package(
    name: "Hello",
    targets: [],
    dependencies: [
        .Package(url: "https://github.com/bignerdranch/Freddy.git", majorVersion: 3),
    ]
)

When I ran swift build I got:

$ swift build
Cloning https://github.com/bignerdranch/Freddy.git
HEAD is now at c2780e5 Merge pull request #218 from bignerdranch/swift3
Resolved version: 3.0.0
Empty manifest file is not supported anymore. Use `swift package init` to autogenerate.
error: The package at `/Users/zorn/Desktop/Hello/Packages/Freddy.git' has no Package.swift for the specific version: 3.0.0

Looks like we need to populate Package.swift with info now.

zorn commented 7 years ago

Seems like this is fixed in PR #223. Sadly I don't see a way to request a specific branch in an actual dependency so I don't know how to help verify this fixes the issue without merging into master.

https://github.com/apple/swift-package-manager/blob/master/Documentation/Reference.md#package-dependency

mdmathias commented 7 years ago

For the sake of documentation:

There is a now a release tagged as 3.0.1. Your Package.swift should like this to make use of it:

import PackageDescription

let package = Package(
    name: "Hello",
    dependencies: [
        .Package(url: "https://github.com/bignerdranch/Freddy.git", Version(3,0,1)),
    ]
)