Skip to content

Commit 3b9b3ab

Browse files
author
Michalis Karagiorgos
committed
ExclusivesProcessor replace vPrint with non verbose print
1 parent e6458e1 commit 3b9b3ab

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

Sources/CompositionRoot.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct CompositionRoot {
9898
// Check that they are not included in other targets.
9999
// Create new targets that don't have excluded files
100100
// Check if rest of files are common for all fileMembershipSets
101-
let exclusivesProcessor = ExclusivesProcessor(vPrint: vPrint)
101+
let exclusivesProcessor = ExclusivesProcessor(print: print)
102102
try exclusivesProcessor.process(
103103
configuration: configuration,
104104
originalTargetsIndex: targetsIndex

Sources/Exclusives/ExclusivesProcessor.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ import Foundation
55
/// Phase 1: Prunes any entries declared as exclusive for a target.
66
/// Phase 2: Validates that after pruning, no residual exclusive differences remain among grouped targets. If differences are still present it throws `ExclusivesError.exclusiveEntriesFound`.
77
///
8-
/// Verbose diagnostic lines are emitted through the injected `vPrint` closure when residual exclusives are detected.
8+
/// Verbose diagnostic lines are emitted through the injected `print` closure when residual exclusives are detected.
99
struct ExclusivesProcessor {
1010
/// Result of processing exclusive entries containing the pruned concrete `Target` models indexed by target name.
1111
struct Result {
1212
let prunedTargets: [String: Target]
1313
}
1414

1515
/// Closure used for verbose logging of exclusive entry diagnostics.
16-
let vPrint: (String) -> Void
16+
let print: (String) -> Void
1717

1818
/// Initializes an instance.
19-
/// - Parameter vPrint: Closure invoked with human readable diagnostic messages.
20-
init(vPrint: @escaping (String) -> Void) {
21-
self.vPrint = vPrint
19+
/// - Parameter print: Closure invoked with human readable diagnostic messages.
20+
init(print: @escaping (String) -> Void) {
21+
self.print = print
2222
}
2323

2424
/// Prunes exclusive entries and validates no residual exclusives remain.
@@ -159,9 +159,9 @@ private extension ExclusivesProcessor {
159159
targets: String
160160
) {
161161
guard !entries.isEmpty else { return }
162-
vPrint("Exclusive \(kind) found between targets \(targets):")
162+
print("Exclusive \(kind) found between targets \(targets):")
163163
for entry in entries.sorted() {
164-
vPrint(" - \(entry)")
164+
print(" - \(entry)")
165165
}
166166
}
167167
}

Tests/XcodeTargetsTests/Exclusives/ExclusivesProcessorTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Testing
55
final class ExclusivesProcessorTests {
66
// Captured verbose messages
77
var messages: [String] = []
8-
lazy var vPrint: (String) -> Void = { [weak self] message in
8+
lazy var print: (String) -> Void = { [weak self] message in
99
self?.messages.append(message)
1010
}
1111

@@ -334,6 +334,6 @@ final class ExclusivesProcessorTests {
334334

335335
private extension ExclusivesProcessorTests {
336336
func makeSut() -> ExclusivesProcessor {
337-
ExclusivesProcessor(vPrint: vPrint)
337+
ExclusivesProcessor(print: print)
338338
}
339339
}

0 commit comments

Comments
 (0)