File tree Expand file tree Collapse file tree 8 files changed +62
-96
lines changed Expand file tree Collapse file tree 8 files changed +62
-96
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import class Foundation.ProcessInfo
66
77let package = Package (
88 name: " swift-xcodegen " ,
9- platforms: [ . macOS( . v13 ) ] ,
9+ platforms: [ . macOS( . v15 ) ] ,
1010 targets: [
1111 . target(
1212 name: " SwiftXcodeGen " ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ //===--- Mutex+Extensions.swift -------------------------------------------===//
2+ //
3+ // This source file is part of the Swift.org open source project
4+ //
5+ // Copyright (c) 2025 Apple Inc. and the Swift project authors
6+ // Licensed under Apache License v2.0 with Runtime Library Exception
7+ //
8+ // See https://swift.org/LICENSE.txt for license information
9+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+ //
11+ //===----------------------------------------------------------------------===//
12+
13+ import Synchronization
14+
15+ extension Mutex {
16+ init ( ) where Value == Void {
17+ self . init ( ( ) )
18+ }
19+
20+ init < T> ( ) where Value == T ? {
21+ self . init ( nil )
22+ }
23+
24+ init < T> ( ) where Value == [ T ] {
25+ self . init ( [ ] )
26+ }
27+
28+ init < T, U> ( ) where Value == [ T : U ] {
29+ self . init ( [ : ] )
30+ }
31+ }
32+
33+ /// Having to write `_ in` when the value is `Void` is annoying.
34+ extension Mutex where Value == Void {
35+ borrowing func withLock< Result: ~ Copyable & Sendable, E> (
36+ _ body: ( ) throws ( E ) -> sending Result
37+ ) throws ( E) -> sending Result {
38+ return try self . withLock { _ throws ( E) in
39+ try body ( )
40+ }
41+ }
42+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1111//===----------------------------------------------------------------------===//
1212
1313import Foundation
14+ import Synchronization
1415
1516public final class Logger : @unchecked Sendable {
16- private let stateLock = Lock ( )
17- private let outputLock = Lock ( )
17+ private let stateLock = Mutex < Void > ( )
18+ private let outputLock = Mutex < Void > ( )
1819
1920 private var _hadError = false
2021 public var hadError : Bool {
@@ -44,7 +45,7 @@ public final class Logger: @unchecked Sendable {
4445}
4546
4647extension Logger {
47- public enum LogLevel : Comparable {
48+ public enum LogLevel : Comparable , Sendable {
4849 /// A message with information that isn't useful to the user, but is
4950 /// useful when debugging issues.
5051 case debug
Original file line number Diff line number Diff line change 22//
33// This source file is part of the Swift.org open source project
44//
5- // Copyright (c) 2024 Apple Inc. and the Swift project authors
5+ // Copyright (c) 2024 - 2025 Apple Inc. and the Swift project authors
66// Licensed under Apache License v2.0 with Runtime Library Exception
77//
88// See https://swift.org/LICENSE.txt for license information
99// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010//
1111//===----------------------------------------------------------------------===//
1212
13+ import Synchronization
14+
1315public final class NinjaBuildDir : Sendable {
1416 public let path : AbsolutePath
1517 public let projectRootDir : AbsolutePath
1618 private let _tripleSuffix : Result < String , Error >
1719
18- private let repoBuildDirs = MutexBox < [ Repo : RepoBuildDir ] > ( )
20+ private let repoBuildDirs = Mutex < [ Repo : RepoBuildDir ] > ( )
1921
2022 private static func detectTripleSuffix(
2123 buildDir: AbsolutePath
Original file line number Diff line number Diff line change 22//
33// This source file is part of the Swift.org open source project
44//
5- // Copyright (c) 2024 Apple Inc. and the Swift project authors
5+ // Copyright (c) 2024 - 2025 Apple Inc. and the Swift project authors
66// Licensed under Apache License v2.0 with Runtime Library Exception
77//
88// See https://swift.org/LICENSE.txt for license information
99// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010//
1111//===----------------------------------------------------------------------===//
1212
13+ import Synchronization
14+
1315public final class RepoBuildDir : Sendable {
1416 public let projectRootDir : AbsolutePath
1517 public let repo : Repo
@@ -19,10 +21,10 @@ public final class RepoBuildDir: Sendable {
1921
2022 private let repoDirCache : DirectoryCache
2123
22- private let _ninjaFile = MutexBox < NinjaBuildFile ? > ( )
23- private let _runnableTargets = MutexBox < RunnableTargets ? > ( )
24- private let _clangArgs = MutexBox < ClangBuildArgsProvider ? > ( )
25- private let _swiftTargets = MutexBox < SwiftTargets ? > ( )
24+ private let _ninjaFile = Mutex < NinjaBuildFile ? > ( )
25+ private let _runnableTargets = Mutex < RunnableTargets ? > ( )
26+ private let _clangArgs = Mutex < ClangBuildArgsProvider ? > ( )
27+ private let _swiftTargets = Mutex < SwiftTargets ? > ( )
2628
2729 init ( _ repo: Repo , for parent: NinjaBuildDir ) throws {
2830 self . projectRootDir = parent. projectRootDir
Original file line number Diff line number Diff line change 22//
33// This source file is part of the Swift.org open source project
44//
5- // Copyright (c) 2024 Apple Inc. and the Swift project authors
5+ // Copyright (c) 2024 - 2025 Apple Inc. and the Swift project authors
66// Licensed under Apache License v2.0 with Runtime Library Exception
77//
88// See https://swift.org/LICENSE.txt for license information
1111//===----------------------------------------------------------------------===//
1212
1313import Foundation
14+ import Synchronization
1415
1516/// A simple cache for the recursive contents of a directory under a given
1617/// root path. This is pretty basic and doesn't handle cases where we've already
1718/// cached the parent.
18- struct DirectoryCache {
19+ struct DirectoryCache : ~ Copyable {
1920 private let root : AbsolutePath
20- private let storage = MutexBox < [ RelativePath : [ RelativePath ] ] > ( )
21+ private let storage = Mutex < [ RelativePath : [ RelativePath ] ] > ( )
2122
2223 init ( root: AbsolutePath ) {
2324 self . root = root
You can’t perform that action at this time.
0 commit comments