Skip to content

Commit 120312c

Browse files
committed
SWBCore,SWBTaskConstruction,SWBTaskExecution,SWBTestSupport,SWBUtil: narrow some imports
Narrow the scope of imports for some of the import statements across the package. This avoids some unnecessary warnings.
1 parent aa79a82 commit 120312c

File tree

11 files changed

+17
-10
lines changed

11 files changed

+17
-10
lines changed

Sources/SWBCore/Extensions/ToolchainRegistryExtension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
public import SWBUtil
14-
public import SWBMacro
14+
private import SWBMacro
1515

1616
public struct ToolchainRegistryExtensionPoint: ExtensionPoint, Sendable {
1717
public typealias ExtensionProtocol = ToolchainRegistryExtension

Sources/SWBCore/LibSwiftDriver/PlannedBuild.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#if os(Windows)
14+
private import Foundation
15+
#else
1316
public import Foundation
17+
#endif
1418

1519
import SwiftDriver
1620
import TSCBasic

Sources/SWBLLBuild/LowLevelBuildSystem.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
public import SWBUtil
14+
#if os(Windows)
15+
private import SWBLibc
16+
#else
1417
public import SWBLibc
18+
#endif
1519

1620
// Re-export all APIs from llbuild bindings.
1721
@_exported public import llbuild

Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ package import SWBCore
1414
package import SWBUtil
1515
import struct SWBProtocol.BuildOperationTaskEnded
1616
import Foundation
17-
public import SWBMacro
17+
package import SWBMacro
1818

1919
// Some things that should probably live in this task producer that might not be immediately obvious:
2020
// Emitting an error if PGO is turned on for a target containing Swift files.

Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/DevelopmentAssetsTaskProducer.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import SWBCore
1414
import SWBUtil
15-
import SWBTaskConstruction
1615

1716
final class DevelopmentAssetsTaskProducer: StandardTaskProducer, TaskProducer {
1817
func generateTasks() async -> [any PlannedTask] {

Sources/SWBTaskExecution/Task.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public import SWBUtil
1616
public import SWBCore
1717
import SWBCAS
1818
public import SWBMacro
19-
public import typealias SWBLLBuild.llbuild_pid_t
20-
public import protocol SWBLLBuild.ProcessDelegate
19+
package import typealias SWBLLBuild.llbuild_pid_t
20+
package import protocol SWBLLBuild.ProcessDelegate
2121

2222
public import struct SWBProtocol.BuildOperationMetrics
2323

Sources/SWBTestSupport/AssertMatch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
public import SWBUtil
13+
package import SWBUtil
1414
package import Testing
1515

1616
package indirect enum StringPattern: Sendable {

Sources/SWBTestSupport/CoreTestSupport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
package import Foundation
13+
private import Foundation
1414
@_spi(Testing) package import SWBCore
1515
package import SWBUtil
1616
import SWBTaskConstruction

Sources/SWBTestSupport/Projects/AppClips.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
package import SWBUtil
14-
package import SWBProtocol
14+
private import SWBProtocol
1515

1616
extension TestProject {
1717
package static func appClip(sourceRoot: Path, fs: (any FSProxy)? = nil, appClipPlatformFilters: Set<PlatformFilter> = PlatformFilter.iOSFilters, appClipSupportsMacCatalyst: Bool = false, appDeploymentTarget: String? = nil) async throws -> TestProject {

Sources/SWBUtil/Dispatch+Async.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// This file contains helpers used to bridge GCD and Swift Concurrency.
1414
// In the long term, these ideally all go away.
1515

16-
public import Foundation
16+
private import Foundation
1717

1818
/// Runs an async function and synchronously waits for the response.
1919
/// - warning: This function is extremely dangerous because it blocks the calling thread and may lead to deadlock, and should only be used as a temporary transitional aid.

Sources/SWBUtil/Lock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
public import SWBLibc
13+
private import SWBLibc
1414

1515
// FIXME: Replace the contents of this file with the Swift standard library's Mutex type once it's available everywhere we deploy.
1616

0 commit comments

Comments
 (0)