Skip to content

Commit ffba14f

Browse files
committed
Merge branch 'main' into lifetime-attribute-revert-main
2 parents a0c06f2 + 747bd3a commit ffba14f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+9765
-2321
lines changed

.github/workflows/automerge_to_main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@main
1414
with:
1515
base_branch: main
16-
head_branch: release/6.2
16+
head_branch: release/6.3
1717
permissions:
1818
contents: write
1919
pull-requests: write

.github/workflows/automerge_to_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Create PR to merge main into release branch
1313
uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@main
1414
with:
15-
base_branch: release/6.2
15+
base_branch: release/6.3
1616
permissions:
1717
contents: write
1818
pull-requests: write

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ list(APPEND _SwiftFoundation_versions
102102
"6.1"
103103
"6.2"
104104
"6.3"
105+
"6.4"
105106
)
106107

107108
# Each availability name to define

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import CompilerPluginSupport
99
let availabilityTags: [_Availability] = [
1010
_Availability("FoundationPreview"), // Default FoundationPreview availability
1111
]
12-
let versionNumbers = ["6.0.2", "6.1", "6.2", "6.3"]
12+
let versionNumbers = ["6.0.2", "6.1", "6.2", "6.3", "6.4"]
1313

1414
// Availability Macro Utilities
1515

@@ -140,7 +140,8 @@ let package = Package(
140140
"ProcessInfo/CMakeLists.txt",
141141
"FileManager/CMakeLists.txt",
142142
"URL/CMakeLists.txt",
143-
"NotificationCenter/CMakeLists.txt"
143+
"NotificationCenter/CMakeLists.txt",
144+
"ProgressManager/CMakeLists.txt",
144145
],
145146
cSettings: [
146147
.define("_GNU_SOURCE", .when(platforms: [.linux]))
@@ -185,7 +186,7 @@ let package = Package(
185186
"Locale/CMakeLists.txt",
186187
"Calendar/CMakeLists.txt",
187188
"CMakeLists.txt",
188-
"Predicate/CMakeLists.txt"
189+
"Predicate/CMakeLists.txt",
189190
],
190191
cSettings: wasiLibcCSettings,
191192
swiftSettings: [

Sources/FoundationEssentials/AttributedString/AttributeScope.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// }
1818
// An AttributeScope can contain other scopes as well.
1919
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
20-
public protocol AttributeScope : DecodingConfigurationProviding, EncodingConfigurationProviding {
20+
public protocol AttributeScope : DecodingConfigurationProviding, EncodingConfigurationProviding, SendableMetatype {
2121
static var decodingConfiguration: AttributeScopeCodableConfiguration { get }
2222
static var encodingConfiguration: AttributeScopeCodableConfiguration { get }
2323
}

Sources/FoundationEssentials/AttributedString/AttributedStringAttribute.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ extension AttributedString {
9595

9696
// Developers define new attributes by implementing AttributeKey.
9797
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
98-
public protocol AttributedStringKey {
98+
public protocol AttributedStringKey : SendableMetatype {
9999
associatedtype Value : Hashable
100100
static var name : String { get }
101101

Sources/FoundationEssentials/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ add_library(FoundationEssentials
2727
Logging.swift
2828
OutputBuffer.swift
2929
Platform.swift
30+
Progress+Stub.swift
3031
SortComparator.swift
3132
UUID_Wrappers.swift
3233
UUID.swift
@@ -45,6 +46,7 @@ add_subdirectory(Locale)
4546
add_subdirectory(NotificationCenter)
4647
add_subdirectory(Predicate)
4748
add_subdirectory(ProcessInfo)
49+
add_subdirectory(ProgressManager)
4850
add_subdirectory(PropertyList)
4951
add_subdirectory(String)
5052
add_subdirectory(TimeZone)

Sources/FoundationEssentials/Data/CMakeLists.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
##
33
## This source file is part of the Swift 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
77
##
88
## See LICENSE.txt for license information
@@ -13,13 +13,23 @@
1313
##===----------------------------------------------------------------------===##
1414

1515
target_sources(FoundationEssentials PRIVATE
16+
Representations/Data+Inline.swift
17+
Representations/Data+InlineSlice.swift
18+
Representations/Data+LargeSlice.swift
19+
Representations/Data+Representation.swift
20+
Representations/DataStorage.swift
21+
1622
Collections+DataProtocol.swift
1723
ContiguousBytes.swift
24+
Data.swift
1825
Data+Base64.swift
26+
Data+Bridging.swift
27+
Data+Deprecated.swift
1928
Data+Error.swift
29+
Data+Iterator.swift
2030
Data+Reading.swift
21-
Data+Stub.swift
31+
Data+Searching.swift
2232
Data+Writing.swift
23-
Data.swift
2433
DataProtocol.swift
34+
PathOrURL.swift
2535
Pointers+DataProtocol.swift)

Sources/FoundationEssentials/Data/ContiguousBytes.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2018 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2018-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
@@ -39,6 +39,9 @@ extension ArraySlice : ContiguousBytes where Element == UInt8 { }
3939
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
4040
extension ContiguousArray : ContiguousBytes where Element == UInt8 { }
4141

42+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
43+
extension Data : ContiguousBytes { }
44+
4245
//===--- Pointer Conformances ---------------------------------------------===//
4346

4447
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)

Sources/FoundationEssentials/Data/Data+Base64.swift

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2023-2024 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2023-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
@@ -25,6 +25,56 @@ import WinSDK
2525
import WASILibc
2626
#endif
2727

28+
#if !FOUNDATION_FRAMEWORK
29+
extension Data {
30+
31+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
32+
public struct Base64EncodingOptions : OptionSet, Sendable {
33+
public let rawValue: UInt
34+
35+
public init(rawValue: UInt) {
36+
self.rawValue = rawValue
37+
}
38+
/// Set the maximum line length to 64 characters, after which a line ending is inserted.
39+
public static let lineLength64Characters = Base64EncodingOptions(rawValue: 1 << 0)
40+
/// Set the maximum line length to 76 characters, after which a line ending is inserted.
41+
public static let lineLength76Characters = Base64EncodingOptions(rawValue: 1 << 1)
42+
/// When a maximum line length is set, specify that the line ending to insert should include a carriage return.
43+
public static let endLineWithCarriageReturn = Base64EncodingOptions(rawValue: 1 << 4)
44+
/// When a maximum line length is set, specify that the line ending to insert should include a line feed.
45+
public static let endLineWithLineFeed = Base64EncodingOptions(rawValue: 1 << 5)
46+
}
47+
48+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
49+
public struct Base64DecodingOptions : OptionSet, Sendable {
50+
public let rawValue: UInt
51+
52+
public init(rawValue: UInt) {
53+
self.rawValue = rawValue
54+
}
55+
/// Modify the decoding algorithm so that it ignores unknown non-Base-64 bytes, including line ending characters.
56+
public static let ignoreUnknownCharacters = Base64DecodingOptions(rawValue: 1 << 0)
57+
}
58+
}
59+
#else
60+
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
61+
extension Data {
62+
// These types are typealiased to the `NSData` options for framework builds only.
63+
public typealias Base64EncodingOptions = NSData.Base64EncodingOptions
64+
public typealias Base64DecodingOptions = NSData.Base64DecodingOptions
65+
}
66+
#endif //!FOUNDATION_FRAMEWORK
67+
68+
extension Data.Base64EncodingOptions {
69+
/// Use the base64url alphabet to encode the data
70+
@available(FoundationPreview 6.3, *)
71+
public static let base64URLAlphabet = Self(rawValue: 1 << 6)
72+
73+
/// Omit the `=` padding characters in the end of the base64 encoded result
74+
@available(FoundationPreview 6.3, *)
75+
public static let omitPaddingCharacter = Self(rawValue: 1 << 7)
76+
}
77+
2878
@available(macOS 10.10, iOS 8.0, watchOS 2.0, tvOS 9.0, *)
2979
extension Data {
3080

0 commit comments

Comments
 (0)