Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error adding target dependencies with Swift Package Manager

When trying to include a target dependency I get the error: The manifest describes a target that cannot be found in your source tree: parser

Here is my Package.swift file:

import PackageDescription

let package = Package(
    name: "Phoenix",
          targets: [
            Target(
                name: "Phoenix",
                dependencies: [.Target(name: "parser")]),
            Target(
                name: "parser")
    ]
)

I am following the format described here: https://github.com/apple/swift-package-manager/blob/master/Documentation/Package.swift.md

like image 258
Daniel Firsht Avatar asked Dec 14 '15 18:12

Daniel Firsht


2 Answers

Do you have a parser directory?

You should have a layout something like:

     .
     └── Sources
         └── Phoenix
         │   └── File1.swift
         └── parser
             └── File2.swift

Or:

     .
     └── Phoenix
     │   └── File1.swift
     └── parser
         └── File2.swift

This instructs SwiftPM to create two modules, one called Phoenix and one called "parser".

like image 57
mxcl Avatar answered Sep 28 '22 12:09

mxcl


While you're both right, my actual problem was that my subdirectory didn't contain any swift code so a module wasn't being generated

like image 23
Daniel Firsht Avatar answered Sep 28 '22 11:09

Daniel Firsht