refactor: use Package.swift to define executable task

This commit is contained in:
nuomi1
2023-01-02 21:48:32 +08:00
parent 6e8954672f
commit 377200a39a
7 changed files with 169 additions and 131 deletions

18
codes/swift/Package.swift Normal file
View File

@@ -0,0 +1,18 @@
// swift-tools-version: 5.7
import PackageDescription
let package = Package(
name: "HelloAlgo",
products: [
.executable(name: "time_complexity", targets: ["time_complexity"]),
.executable(name: "worst_best_time_complexity", targets: ["worst_best_time_complexity"]),
.executable(name: "space_complexity", targets: ["space_complexity"]),
],
targets: [
.target(name: "utils", path: "utils"),
.executableTarget(name: "time_complexity", path: "chapter_computational_complexity", sources: ["time_complexity.swift"]),
.executableTarget(name: "worst_best_time_complexity", path: "chapter_computational_complexity", sources: ["worst_best_time_complexity.swift"]),
.executableTarget(name: "space_complexity", dependencies: ["utils"], path: "chapter_computational_complexity", sources: ["space_complexity.swift"]),
]
)