I'm trying to compile using swift build
Package.swift
// swift-tools-version:4.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version:x.x
import PackageDescription
let package = Package(
name: "MyKituraApp",
dependencies: [
.package(url: "https://github.com/IBM-Swift/Kitura", from: "2.7.0")
],
targets: [
.target(
name: "MyKituraApp",
dependencies: ["Kitura"],
path: "Sources"),
.testTarget(
name: "MyKituraAppTests",
dependencies: ["MyKituraApp"],
path: "Test")
]
)
But, I get the following error although I did add the path property.
'MyKituraApp' /src: error: could not find source files for target(s): MyKituraAppTests; use the 'path' property in the Swift 4 manifest to set a custom target path
Without knowing your project structure I can't give you a definite answer but I'll do my best!
I'm going to assume you've generated your project using the Swift Package Manager tool, something like this:
swift package init --type executableSo... Typically you shouldn't need to set the
pathproperty unless you've moved the tests for your application to another directory. The Swift Package Manager, by default, will create aTestsdirectory and when you do not provide a value for thepathproperty the Swift Package Manager will look for thatTestsdirectory by default when you runswift build. In yourpathproperty you are providing a value ofTestnotTestsSo my first solution to test would be: To remove the
pathproperty from the.testTargetsectionOR
Rename the
pathproperties value toTestsrather thanTest.I've provided an example Package.swift that I was able to run
swift buildwith:As you can see I've also removed an extra line from the top of the file:
// swift-tools-version:x.xYou've already provided a
swift-tools-versionat the top of your file, this line may end up confusing things later down the line.I hope this helps!