theabstractdev
theabstractdev

Reputation: 71

Generate Package.swift from Xcode

I've added some dependencies to my project using Xcode and I need to generate a Package.swift file for Travis-CI.

Is there a solution other than manually add all my dependencies to this file?

Upvotes: 0

Views: 2496

Answers (1)

David Pasztor
David Pasztor

Reputation: 54706

You are looking at the problem the wrong way.

Package.swift should be the basis of your framework, not the Xcode project. You can generate an Xcode project from a Package file, but you cannot generate a package file from an Xcode project.

The main reason behind this is that Xcode projects support many things that Swift Package Manager (and hence Package.swift files) do not support - such as mixed language targets or signing & capabilities.

So if your project setup is fully supported by SPM, you should simply throw away the Xcode project and rely on the Package.swift file completely, otherwise you'll need to keep using Xcode projects and shouldn't use SPM until it supports your requirements.

Upvotes: 2

Related Questions