How can I tell SPM to just build a project from Github?
Specifically, I want to generate an Xcode file for Vapor, so I can include it as a dependency in a different Xcode project.
I've managed to generate the Xcode file by cloning the Vapor repo, and running "swift package generate-xcodeproj --output /path/to/xcode/file"
However, I'd actually prefer not to have to bother with cloning the Vapor repo in the first place. Can I somehow tell SPM to do the cloning of the project itself, just like it does for dependencies?
I've attempted to write a package.swift manifest that has only a single dependency (Vapor) and nothing else, but when I call "swift package generate-xcodeproj" it complains that it can't find the sources of my project.
Is there some way to tell the package manager that I just want it to build dependencies?
I tried to follow your description, no complains about the sources.
$ mkdir TestVapor
$ cd TestVapor/
$ swift package --init empty
$ vim Package.swift
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "TestVapor",
dependencies: [
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
]
)
$ swift package generate-xcodeproj
generated: ./TestVapor.xcodeproj
warning: dependency 'Vapor' is not used by any target