Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2021 Developer ToolsSwift

WWDC21 · 14 min · Developer Tools / Swift

Discover and curate Swift Packages using Collections

Whether you’re curating packages for your team, for education purposes, or to share with other developers, Swift Package Collections can help you discover, explore and import new packages into your project. Discover improvements in the Swift Package workflow using Collections, and learn how you can curate, create, sign, and share your own Swift Package Collections.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 8 snippets

Simple collection json · at 7:00 ↗
{
  "name": "WWDC21 Demo Collection",
  "overview": "Packages to be used in our demo app",
  "keywords": ["wwdc21"],
  "author": {
    "name": "Boris Buegling"
  }
  "packages": [
    { "url": "https://github.com/apple/swift-format" },
    { "url": "https://github.com/Alamofire/Alamofire" }
  ],
}
Complex collection json · at 7:17 ↗
{
  "name": "WWDC21 Demo Collection",
  "overview": "Packages to be used in our demo app",
  "keywords": ["wwdc21"],
  "packages": [
    {
      "url": "https://github.com/apple/swift-format",
      "summary": "Formatting technology for Swift source code.",
      "keywords": [“formatting”, "swift"],
      "versions": ["0.50400.0", "0.50300.0"],
      "excludedProducts": ["SwiftFormatConfiguration"],
      "readmeURL": "https://github.com/apple/swift-format/blob/main/README.md"
    },
    { "url": "https://github.com/Alamofire/Alamofire" }
  ],
  "author": {
    "name": "Boris Buegling"
  }
}
Generating a collection bash · at 8:46 ↗
package-collection-generate --verbose input.json collection.json --auth-token
Signing a collection bash · at 9:30 ↗
package-collection-sign collection.json collection-signed.json developer-key.pem developer-cert.cer
Adding a collection bash · at 10:15 ↗
swift package-collection add
Inspecting an entire collection bash · at 10:34 ↗
swift package-collection describe
Viewing metadata of the swift-format package bash · at 11:11 ↗
swift package-collection describe https://github.com/apple/swift-format
ReadMe Request swift · at 13:07 ↗
import Alamofire

struct ContentView: View {
  let readMeURL = "https://raw.githubusercontent.com/apple/swift/main/README.md"
  
  var body: some View {
    Button("Click me!") {
      AF.request(readMeURL).response { response in
        debugPrint(response)
      }
    }
  }
}

Resources