|
1 |
| -// swift-tools-version:4.0 |
| 1 | +// swift-tools-version:4.2 |
2 | 2 |
|
3 | 3 | import PackageDescription
|
4 | 4 | import Foundation
|
@@ -39,50 +39,57 @@ let multiSourceLibraries: [String] = {
|
39 | 39 | }
|
40 | 40 | }()
|
41 | 41 |
|
42 |
| -let p = Package( |
43 |
| - name: "swiftbench", |
44 |
| - products: [ |
45 |
| - .library(name: "TestsUtils", type: .static, targets: ["TestsUtils"]), |
46 |
| - .library(name: "DriverUtils", type: .static, targets: ["DriverUtils"]), |
47 |
| - .library(name: "ObjectiveCTests", type: .static, targets: ["ObjectiveCTests"]), |
48 |
| - .executable(name: "SwiftBench", targets: ["SwiftBench"]), |
49 |
| - .library(name: "PrimsSplit", type: .static, targets: ["PrimsSplit"]) |
50 |
| - ] + singleSourceLibraries.map { .library(name: $0, type: .static, targets: [$0]) } |
51 |
| - + multiSourceLibraries.map { .library(name: $0, type: .static, targets: [$0]) }, |
52 |
| - targets: [ |
53 |
| - .target(name: "TestsUtils", |
54 |
| - path: "utils", |
55 |
| - sources: ["TestsUtils.swift"]), |
56 |
| - .target(name: "DriverUtils", |
57 |
| - dependencies: [.target(name: "TestsUtils")], |
58 |
| - path: "utils", |
59 |
| - sources: ["DriverUtils.swift", "ArgParse.swift"]), |
| 42 | +var products: [Product] = [] |
| 43 | +products.append(.library(name: "TestsUtils", type: .static, targets: ["TestsUtils"])) |
| 44 | +products.append(.library(name: "DriverUtils", type: .static, targets: ["DriverUtils"])) |
| 45 | +products.append(.library(name: "ObjectiveCTests", type: .static, targets: ["ObjectiveCTests"])) |
| 46 | +products.append(.executable(name: "SwiftBench", targets: ["SwiftBench"])) |
| 47 | +products.append(.library(name: "PrimsSplit", type: .static, targets: ["PrimsSplit"])) |
| 48 | +products += singleSourceLibraries.map { .library(name: $0, type: .static, targets: [$0]) } |
| 49 | +products += multiSourceLibraries.map { .library(name: $0, type: .static, targets: [$0]) } |
| 50 | + |
| 51 | +var targets: [Target] = [] |
| 52 | +targets.append(.target(name: "TestsUtils", path: "utils", sources: ["TestsUtils.swift"])) |
| 53 | +targets.append(.systemLibrary(name: "LibProc", path: "utils/LibProc")) |
| 54 | +targets.append( |
| 55 | + .target(name: "DriverUtils", |
| 56 | + dependencies: [.target(name: "TestsUtils"), "LibProc"], |
| 57 | + path: "utils", |
| 58 | + sources: ["DriverUtils.swift", "ArgParse.swift"])) |
| 59 | +targets.append( |
60 | 60 | .target(name: "SwiftBench",
|
61 |
| - dependencies: [ |
62 |
| - .target(name: "TestsUtils"), |
63 |
| - .target(name: "ObjectiveCTests"), |
64 |
| - .target(name: "DriverUtils"), |
65 |
| - ] + singleSourceLibraries.map { .target(name: $0) } |
66 |
| - + multiSourceLibraries.map { .target(name: $0) }, |
67 |
| - path: "utils", |
68 |
| - sources: ["main.swift"]), |
69 |
| - .target(name: "ObjectiveCTests", |
70 |
| - path: "utils/ObjectiveCTests", |
71 |
| - publicHeadersPath: "."), |
72 |
| - ] + singleSourceLibraries.map { x in |
| 61 | + dependencies: [ |
| 62 | + .target(name: "TestsUtils"), |
| 63 | + .target(name: "ObjectiveCTests"), |
| 64 | + .target(name: "DriverUtils"), |
| 65 | + ] + singleSourceLibraries.map { .target(name: $0) } |
| 66 | + + multiSourceLibraries.map { .target(name: $0) }, |
| 67 | + path: "utils", |
| 68 | + sources: ["main.swift"])) |
| 69 | +targets.append( |
| 70 | + .target(name: "ObjectiveCTests", |
| 71 | + path: "utils/ObjectiveCTests", |
| 72 | + publicHeadersPath: ".")) |
| 73 | +targets += singleSourceLibraries.map { x in |
73 | 74 | return .target(name: x,
|
74 | 75 | dependencies: [
|
75 | 76 | .target(name: "TestsUtils"),
|
76 | 77 | .target(name: "ObjectiveCTests"),
|
77 | 78 | ],
|
78 | 79 | path: "single-source",
|
79 | 80 | sources: ["\(x).swift"])
|
80 |
| - } + multiSourceLibraries.map { x in |
81 |
| - return .target(name: x, |
82 |
| - dependencies: [ |
83 |
| - .target(name: "TestsUtils") |
84 |
| - ], |
85 |
| - path: "multi-source/\(x)") |
86 |
| - }, |
87 |
| - swiftLanguageVersions: [4] |
| 81 | +} |
| 82 | +targets += multiSourceLibraries.map { x in |
| 83 | + return .target(name: x, |
| 84 | + dependencies: [ |
| 85 | + .target(name: "TestsUtils") |
| 86 | + ], |
| 87 | + path: "multi-source/\(x)") |
| 88 | +} |
| 89 | + |
| 90 | +let p = Package( |
| 91 | + name: "swiftbench", |
| 92 | + products: products, |
| 93 | + targets: targets, |
| 94 | + swiftLanguageVersions: [.v4] |
88 | 95 | )
|
0 commit comments