Skip to content

Commit 72b8411

Browse files
committed
Fix the Tuist project
1 parent a281070 commit 72b8411

File tree

1 file changed

+6
-42
lines changed

1 file changed

+6
-42
lines changed

Tuist/ProjectDescriptionHelpers/Module.swift

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ public enum Module: String, CaseIterable {
1818
targets.append(target(
1919
name: acceptanceTestsTargetName,
2020
product: .unitTests,
21-
dependencies: acceptanceTestDependencies,
22-
isTestingTarget: false
21+
dependencies: acceptanceTestDependencies
2322
))
2423
}
2524

@@ -34,8 +33,7 @@ public enum Module: String, CaseIterable {
3433
target(
3534
name: unitTestsTargetName,
3635
product: .unitTests,
37-
dependencies: unitTestDependencies,
38-
isTestingTarget: false
36+
dependencies: unitTestDependencies
3937
)
4038
)
4139
}
@@ -45,8 +43,7 @@ public enum Module: String, CaseIterable {
4543
target(
4644
name: integrationTestsTargetName,
4745
product: .unitTests,
48-
dependencies: integrationTestsDependencies,
49-
isTestingTarget: false
46+
dependencies: integrationTestsDependencies
5047
)
5148
)
5249
}
@@ -59,30 +56,15 @@ public enum Module: String, CaseIterable {
5956
}
6057

6158
public var targets: [Target] {
62-
var targets: [Target] = sourceTargets
63-
64-
if let testingTargetName {
65-
targets.append(
66-
target(
67-
name: testingTargetName,
68-
product: product,
69-
dependencies: testingDependencies,
70-
isTestingTarget: true
71-
)
72-
)
73-
}
74-
75-
return targets + testTargets
59+
return sourceTargets + testTargets
7660
}
7761

7862
public var sourceTargets: [Target] {
79-
let isStaticProduct = product == .staticLibrary || product == .staticFramework
8063
return [
8164
target(
8265
name: targetName,
8366
product: product,
84-
dependencies: dependencies,
85-
isTestingTarget: false
67+
dependencies: dependencies
8668
),
8769
]
8870
}
@@ -94,13 +76,6 @@ public enum Module: String, CaseIterable {
9476
}
9577
}
9678

97-
public var testingTargetName: String? {
98-
switch self {
99-
default:
100-
return "\(rawValue)Testing"
101-
}
102-
}
103-
10479
public var unitTestsTargetName: String? {
10580
switch self {
10681
default:
@@ -159,9 +134,6 @@ public enum Module: String, CaseIterable {
159134
]
160135
}
161136
dependencies = dependencies + [.target(name: targetName)]
162-
if let testingTargetName {
163-
dependencies.append(.target(name: testingTargetName))
164-
}
165137
return dependencies
166138
}
167139

@@ -180,17 +152,13 @@ public enum Module: String, CaseIterable {
180152
[]
181153
}
182154
dependencies.append(.target(name: targetName))
183-
if let testingTargetName {
184-
dependencies.append(contentsOf: [.target(name: testingTargetName)])
185-
}
186155
return dependencies
187156
}
188157

189158
fileprivate func target(
190159
name: String,
191160
product: Product,
192-
dependencies: [TargetDependency],
193-
isTestingTarget: Bool
161+
dependencies: [TargetDependency]
194162
) -> Target {
195163
let rootFolder: String
196164
switch product {
@@ -201,10 +169,6 @@ public enum Module: String, CaseIterable {
201169
}
202170
var debugSettings: ProjectDescription.SettingsDictionary = ["SWIFT_ACTIVE_COMPILATION_CONDITIONS": "$(inherited) MOCKING"]
203171
var releaseSettings: ProjectDescription.SettingsDictionary = [:]
204-
if isTestingTarget {
205-
debugSettings["ENABLE_TESTING_SEARCH_PATHS"] = "YES"
206-
releaseSettings["ENABLE_TESTING_SEARCH_PATHS"] = "YES"
207-
}
208172

209173
if let strictConcurrencySetting, product == .framework {
210174
debugSettings["SWIFT_STRICT_CONCURRENCY"] = .string(strictConcurrencySetting)

0 commit comments

Comments
 (0)