Open svanimpe opened 1 year ago
same issue.
I use this way to setting Package.swift
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "test-swift",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(name: "library-test-swift", targets: ["library-test-swift"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "2.2.4")
],
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 this package depends on.
.target(name: "library-test-swift", dependencies: [.product(name: "Crypto", package: "swift-crypto")]),
.executableTarget(name: "test-swift", dependencies: ["library-test-swift"]),
.testTarget(name: "test-swiftTests", dependencies: [
"library-test-swift",
// "test-swift"
]),
]
)
I use this way to setting Package.swift
// swift-tools-version: 5.7 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "test-swift", products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library(name: "library-test-swift", targets: ["library-test-swift"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), .package(url: "https://github.com/apple/swift-crypto.git", from: "2.2.4") ], 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 this package depends on. .target(name: "library-test-swift", dependencies: [.product(name: "Crypto", package: "swift-crypto")]), .executableTarget(name: "test-swift", dependencies: ["library-test-swift"]), .testTarget(name: "test-swiftTests", dependencies: [ "library-test-swift", // "test-swift" ]), ] )
is there any working example repository? @agrozyme
is there any working example repository? @agrozyme
I don't have Mac device, and I only use Windows 10 for work. You can put all logic function in "library" and write some nomal test case for test "library". in "executableTarget" only put simple flow logic, use this way we can do unit testing, but can't do integration testing.
I have some screen shot but I don't know how to put them in this replay.
is there any working example repository? @agrozyme
I don't have Mac device, and I only use Windows 10 for work.
Same here...
I have some screen shot but I don't know how to put them in this replay.
Just drag & drop the files to the writing area, it will automatically upload & attached to the comment.
Steps To Reproduce
In an empty directory named hello:
This outputs:
This is with Swift 5.7 on Windows 11.
This does work on macOS.