Skip to content

Commit ec430b8

Browse files
authored
Move PluginConfiguration to its own file (#9233)
1 parent 4c4487b commit ec430b8

File tree

3 files changed

+36
-21
lines changed

3 files changed

+36
-21
lines changed

Sources/SwiftBuildSupport/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ add_library(SwiftBuildSupport STATIC
1717
PackagePIFProjectBuilder+Products.swift
1818
PIF.swift
1919
PIFBuilder.swift
20+
PluginConfiguration.swift
2021
SwiftBuildSystem.swift)
2122
target_link_libraries(SwiftBuildSupport PUBLIC
2223
Build
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift open source project
4+
//
5+
// Copyright (c) 2014-2025 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See http://swift.org/LICENSE.txt for license information
9+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
@_spi(SwiftPMInternal) import Basics
14+
@_spi(SwiftPMInternal) import SPMBuildCore
15+
16+
public struct PluginConfiguration {
17+
/// Entity responsible for compiling and running plugin scripts.
18+
let scriptRunner: PluginScriptRunner
19+
20+
/// Directory where plugin intermediate files are stored.
21+
let workDirectory: Basics.AbsolutePath
22+
23+
/// Whether to sandbox commands from build tool plugins.
24+
let disableSandbox: Bool
25+
26+
public init(
27+
scriptRunner: PluginScriptRunner,
28+
workDirectory: Basics.AbsolutePath,
29+
disableSandbox: Bool
30+
) {
31+
self.scriptRunner = scriptRunner
32+
self.workDirectory = workDirectory
33+
self.disableSandbox = disableSandbox
34+
}
35+
}

Sources/SwiftBuildSupport/SwiftBuildSystem.swift

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -174,27 +174,6 @@ private final class PlanningOperationDelegate: SWBPlanningOperationDelegate, Sen
174174
}
175175
}
176176

177-
public struct PluginConfiguration {
178-
/// Entity responsible for compiling and running plugin scripts.
179-
let scriptRunner: PluginScriptRunner
180-
181-
/// Directory where plugin intermediate files are stored.
182-
let workDirectory: Basics.AbsolutePath
183-
184-
/// Whether to sandbox commands from build tool plugins.
185-
let disableSandbox: Bool
186-
187-
public init(
188-
scriptRunner: PluginScriptRunner,
189-
workDirectory: Basics.AbsolutePath,
190-
disableSandbox: Bool
191-
) {
192-
self.scriptRunner = scriptRunner
193-
self.workDirectory = workDirectory
194-
self.disableSandbox = disableSandbox
195-
}
196-
}
197-
198177
public final class SwiftBuildSystem: SPMBuildCore.BuildSystem {
199178
private let buildParameters: BuildParameters
200179
private let packageGraphLoader: () async throws -> ModulesGraph

0 commit comments

Comments
 (0)