Comments (4)
.target(dependencies[.product(name: "Path", package: "Path")])
Is not valid Swift, nor is it the correct syntax, I suggest letting Xcode do the completion for you.
.target(name: "Foo:", dependencies: [.product(name: "Path", package: "Path")])
from path.swift.
This is exactly what I have in my Package.swift (among other things):
.target(
name: "SwiftMLExample",
dependencies: [
"Just",
.product(name: "Path", package: "Path"),
.product(name: "ArgumentParser", package: "swift-argument-parser")
])
and, swift build throws this error:
/Users/vk/Work/Languages/Swift/SwiftMLExample: error: unknown package 'Path' in dependencies of target 'SwiftMLExample'
And, XCode is not universally available, e.g. there is no Xcode on Linux. So, I want to learn how to do it by hand. All other packages I used are working and Path some how does not.
Here is how to reproduce the problem with fresh environment:
- create new package with
swift package init --type executable
Creating executable package: TestPathVanila
Creating Package.swift
Creating README.md
Creating .gitignore
Creating Sources/
Creating Sources/TestPathVanila/main.swift
Creating Tests/
Creating Tests/LinuxMain.swift
Creating Tests/TestPathVanilaTests/
Creating Tests/TestPathVanilaTests/TestPathVanilaTests.swift
Creating Tests/TestPathVanilaTests/XCTestManifests.swift
- Add Path to dependencies, see my Package.swift
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "TestPathVanila",
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/mxcl/Path.swift", from: "1.2.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "TestPathVanila",
dependencies: [.product(name: "Path", package: "Path")]),
.testTarget(
name: "TestPathVanilaTests",
dependencies: ["TestPathVanila"]),
]
)
- build package
swift build
/Users/vk/Work/Languages/Swift/tmp/TestPathVanila: error: unknown package 'Path' in dependencies of target 'TestPathVanila'
from path.swift.
.product(name: "Path", package: "Path.swift")
from path.swift.
This works!
Thanks.
from path.swift.
Related Issues (20)
- tiny typo
- suggestion: Entry.files(withExtension) could make the extension optional HOT 13
- Consider making TemporaryDirectory public? HOT 3
- [Swift 5] `swift build` fails because it has a minimum platform requirement HOT 5
- Refactor HOT 3
- Drop `@dynamicMember` HOT 1
- Add `mimeType` property? HOT 1
- Issue with CLion. HOT 1
- Incorrect framework name when using CocoaPods HOT 1
- [Feature request] Add .read_text() and read_bytes() HOT 3
- suggestion: Additional convenience on Entries HOT 2
- error: 'Path' is not a member type of 'Path' HOT 4
- Path.home.find(): Value of type 'Any' has no member 'extension' HOT 5
- Output for ls() is unsorted, but ls in the command line is sorted alphabetically by default
- import Path // mxcl/Path.swift ~> 1.0.0 not working with Xcode 11.4 HOT 6
- suggestion: check out the swift proposal
- Suggestion: Add option for .find() to ignore hidden files HOT 2
- Add conformances to support Swift ArgumentParser? HOT 2
- Path conflicts with SwiftUI.Path, no way to disambiguate HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from path.swift.