Skip to content

Commit 66adadb

Browse files
authored
Catch feature branch up to main (#2046)
1 parent 96c1dbb commit 66adadb

File tree

989 files changed

+52927
-92138
lines changed

Some content is hidden

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

989 files changed

+52927
-92138
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- Xcode_26.0
2626
destination:
2727
- 'platform=iOS Simulator,OS=17.2,name=iPhone 15'
28-
- 'platform=iOS Simulator,OS=26.0,name=iPhone 17'
28+
- 'platform=iOS Simulator,OS=26.0.1,name=iPhone 17'
2929
- 'platform=tvOS Simulator,OS=17.2,name=Apple TV 4K (3rd generation) (at 1080p)'
3030
- 'platform=tvOS Simulator,OS=26.0,name=Apple TV 4K (3rd generation) (at 1080p)'
3131
- 'platform=visionOS Simulator,OS=1.0,name=Apple Vision Pro'
@@ -48,7 +48,7 @@ jobs:
4848
# Don't run new simulators with old Xcode
4949
- destination: 'platform=tvOS Simulator,OS=26.0,name=Apple TV 4K (3rd generation) (at 1080p)'
5050
xcode: Xcode_15.2
51-
- destination: 'platform=iOS Simulator,OS=26.0,name=iPhone 17'
51+
- destination: 'platform=iOS Simulator,OS=26.0.1,name=iPhone 17'
5252
xcode: Xcode_15.2
5353
- destination: 'platform=visionOS Simulator,OS=26.0,name=Apple Vision Pro'
5454
xcode: Xcode_15.2
@@ -91,6 +91,8 @@ jobs:
9191
java-version: 17
9292
- name: Tools Versions
9393
run: ./aws-sdk-swift/scripts/ci_steps/log_tool_versions.sh
94+
- name: List all sims installed
95+
run: xcrun simctl list
9496
- name: Run CLI Unit Tests
9597
if: ${{ matrix.destination == 'platform=macOS' }}
9698
run: |
@@ -123,18 +125,16 @@ jobs:
123125
linux:
124126
if: github.repository == 'awslabs/aws-sdk-swift' || github.event_name == 'pull_request'
125127
runs-on: ${{ matrix.runner }}
126-
container: swift:${{ matrix.version }}-${{ matrix.os }}
128+
container: swift:${{ matrix.swift }}
127129
strategy:
128130
fail-fast: false
129131
matrix:
130132
runner:
131133
- ubuntu-24.04
132134
- ubuntu-24.04-arm
133-
os:
134-
- jammy
135-
version:
136-
- "5.9"
137-
- "6.2"
135+
swift:
136+
- "5.9-jammy"
137+
- "6.2-noble"
138138
env:
139139
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
140140
steps:
@@ -163,10 +163,10 @@ jobs:
163163
path: |
164164
~/Library/Caches/org.swift.swiftpm
165165
~/.cache/org.swift.swiftpm
166-
key: 1-${{ runner.os }}-swift-${{ matrix.version }}-spm-${{ hashFiles('Package.swift', 'AWSSDKSwiftCLI/Package.swift') }}
166+
key: 1-${{ runner.os }}-swift-${{ matrix.swift }}-spm-${{ hashFiles('Package.swift', 'AWSSDKSwiftCLI/Package.swift') }}
167167
restore-keys: |
168-
1-${{ runner.os }}-swift-${{ matrix.version }}-spm-${{ hashFiles('Package.swift', 'AWSSDKSwiftCLI/Package.swift') }}
169-
1-${{ runner.os }}-swift-${{ matrix.version }}-spm-
168+
1-${{ runner.os }}-swift-${{ matrix.swift }}-spm-${{ hashFiles('Package.swift', 'AWSSDKSwiftCLI/Package.swift') }}
169+
1-${{ runner.os }}-swift-${{ matrix.swift }}-spm-
170170
- name: Setup Java
171171
uses: actions/setup-java@v4
172172
with:

.github/workflows/integration-test.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- Xcode_26.0
3131
destination:
3232
- 'platform=iOS Simulator,OS=17.2,name=iPhone 15'
33-
- 'platform=iOS Simulator,OS=26.0,name=iPhone 17'
33+
- 'platform=iOS Simulator,OS=26.0.1,name=iPhone 17'
3434
- 'platform=tvOS Simulator,OS=17.2,name=Apple TV 4K (3rd generation) (at 1080p)'
3535
- 'platform=tvOS Simulator,OS=26.0,name=Apple TV 4K (3rd generation) (at 1080p)'
3636
- 'platform=visionOS Simulator,OS=1.0,name=Apple Vision Pro'
@@ -53,7 +53,7 @@ jobs:
5353
# Don't run new simulators with old Xcode
5454
- destination: 'platform=tvOS Simulator,OS=26.0,name=Apple TV 4K (3rd generation) (at 1080p)'
5555
xcode: Xcode_15.2
56-
- destination: 'platform=iOS Simulator,OS=26.0,name=iPhone 17'
56+
- destination: 'platform=iOS Simulator,OS=26.0.1,name=iPhone 17'
5757
xcode: Xcode_15.2
5858
- destination: 'platform=visionOS Simulator,OS=26.0,name=Apple Vision Pro'
5959
xcode: Xcode_15.2
@@ -101,6 +101,8 @@ jobs:
101101
java-version: 17
102102
- name: Tools Versions
103103
run: ./aws-sdk-swift/scripts/ci_steps/log_tool_versions.sh
104+
- name: List all sims installed
105+
run: xcrun simctl list
104106
- name: Add Credentials to Test Plan
105107
run: |
106108
cd aws-sdk-swift
@@ -132,18 +134,16 @@ jobs:
132134
# Details on why AL2 isn't included: https://github.com/awslabs/aws-sdk-swift/pull/1833
133135
if: github.repository == 'awslabs/aws-sdk-swift' || github.event_name == 'pull_request'
134136
runs-on: ${{ matrix.runner }}
135-
container: swift:${{ matrix.version }}-${{ matrix.os }}
137+
container: swift:${{ matrix.swift }}
136138
strategy:
137139
fail-fast: false
138140
matrix:
139141
runner:
140142
- ubuntu-24.04
141143
- ubuntu-24.04-arm
142-
os:
143-
- jammy
144-
version:
145-
- "5.9"
146-
- "6.2"
144+
swift:
145+
- "5.9-jammy"
146+
- "6.2-noble"
147147
env:
148148
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
149149
steps:
@@ -179,10 +179,10 @@ jobs:
179179
path: |
180180
~/Library/Caches/org.swift.swiftpm
181181
~/.cache/org.swift.swiftpm
182-
key: 1-${{ runner.os }}-swift-${{ matrix.version }}-spm-${{ hashFiles('Package.swift', 'AWSSDKSwiftCLI/Package.swift') }}
182+
key: 1-${{ runner.os }}-swift-${{ matrix.swift }}-spm-${{ hashFiles('Package.swift', 'AWSSDKSwiftCLI/Package.swift') }}
183183
restore-keys: |
184-
1-${{ runner.os }}-swift-${{ matrix.version }}-spm-${{ hashFiles('Package.swift', 'AWSSDKSwiftCLI/Package.swift') }}
185-
1-${{ runner.os }}-swift-${{ matrix.version }}-spm-
184+
1-${{ runner.os }}-swift-${{ matrix.swift }}-spm-${{ hashFiles('Package.swift', 'AWSSDKSwiftCLI/Package.swift') }}
185+
1-${{ runner.os }}-swift-${{ matrix.swift }}-spm-
186186
- name: Setup Java
187187
uses: actions/setup-java@v4
188188
with:

AWSSDKSwiftCLI/Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ let package = Package(
3939
),
4040
.testTarget(
4141
name: "AWSSDKSwiftCLITests",
42-
dependencies: ["AWSSDKSwiftCLI"]
42+
dependencies: ["AWSSDKSwiftCLI"],
43+
resources: [.process("Resources")]
4344
)
4445
]
4546
)

AWSSDKSwiftCLI/Sources/AWSCLIUtils/FileManager+Utils.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public extension FileManager {
6969
.sorted()
7070
.filter { $0 != "AWSSDKForSwift" } // Ignore documentation module
7171
.filter { $0 != "SDKForSwift" } // Ignore new documentation module
72+
.filter { $0 != "AWSSDKDynamic" } // Internal module, do not document
7273
.filter { !$0.hasPrefix(".") }
7374
}
7475

AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Commands/AWSSDKSwiftCLI/AWSSDKSwiftCLI.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ struct AWSSDKSwiftCLI: ParsableCommand {
1717
PrepareReleaseCommand.self,
1818
SyncClientRuntimeVersionCommand.self,
1919
GenerateDocIndexCommand.self,
20-
GenerateSmokeTestsPackageManifestCommand.self
20+
GenerateSmokeTestsPackageManifestCommand.self,
21+
GeneratePartitionsCommand.self,
22+
GeneratePackageVersionCommand.self,
2123
]
2224
)
2325
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// Copyright Amazon.com Inc. or its affiliates.
3+
// All Rights Reserved.
4+
//
5+
// SPDX-License-Identifier: Apache-2.0
6+
//
7+
8+
import ArgumentParser
9+
import Foundation
10+
import AWSCLIUtils
11+
12+
struct GeneratePackageVersionCommand: ParsableCommand {
13+
14+
static var configuration = CommandConfiguration(
15+
commandName: "generate-package-version",
16+
abstract: "Generates the PackageVersion.swift file for the AWSSDKDynamic target."
17+
)
18+
19+
@Argument(help: "The path to the aws-sdk-swift repository")
20+
var repoPath: String
21+
22+
func run() throws {
23+
try PackageVersionBuilder(
24+
repoPath: repoPath
25+
).generatePackageVersionFile()
26+
}
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// Copyright Amazon.com Inc. or its affiliates.
3+
// All Rights Reserved.
4+
//
5+
// SPDX-License-Identifier: Apache-2.0
6+
//
7+
8+
import ArgumentParser
9+
import Foundation
10+
import AWSCLIUtils
11+
12+
struct GeneratePartitionsCommand: ParsableCommand {
13+
14+
static var configuration = CommandConfiguration(
15+
commandName: "generate-partitions",
16+
abstract: "Generates the Partitions.swift file for the AWSSDKDynamic target."
17+
)
18+
19+
@Argument(help: "The path to the aws-sdk-swift repository")
20+
var repoPath: String
21+
22+
func run() throws {
23+
try PartitionsBuilder(
24+
repoPath: repoPath
25+
).generatePartitionsFile()
26+
}
27+
}

AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Commands/AWSSDKSwiftCLI/Subcommands/PrepareRelease.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ struct PrepareRelease {
208208
"packageDependencies.plist",
209209
"Sources/Services",
210210
"Sources/Core/AWSSDKForSwift/Documentation.docc/AWSSDKForSwift.md",
211-
"Sources/Core/AWSSDKPartitions/Sources/AWSSDKPartitions/Partitions.swift",
211+
"Sources/Core/SDKForSwift/Documentation.docc/SDKForSwift.md",
212212
"Sources/Core/AWSSDKIdentity/",
213+
"Sources/Core/AWSSDKDynamic/Sources/AWSSDKDynamic/PackageVersion.swift",
214+
"Sources/Core/AWSSDKDynamic/Sources/AWSSDKDynamic/Partitions.swift",
213215
]
214216
case .smithySwift:
215217
files = ["Package.version", "Package.version.next"]
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
//
2+
// Copyright Amazon.com Inc. or its affiliates.
3+
// All Rights Reserved.
4+
//
5+
// SPDX-License-Identifier: Apache-2.0
6+
//
7+
8+
import Foundation
9+
import struct AWSCLIUtils.Error
10+
import struct AWSCLIUtils.Version
11+
12+
struct PackageVersionBuilder {
13+
let packageVersionFileURL: URL
14+
let packageVersionSwiftFileURL: URL
15+
16+
// MARK: - init
17+
18+
init(repoPath: String) {
19+
let repoFileURL = URL(fileURLWithPath: repoPath)
20+
self.init(
21+
packageVersionFileURL: repoFileURL.appendingPathComponent("Package.version.next"),
22+
packageVersionSwiftFileURL: repoFileURL.appendingPathComponent(
23+
"Sources/Core/AWSSDKDynamic/Sources/AWSSDKDynamic/PackageVersion.swift"
24+
)
25+
)
26+
}
27+
28+
init(
29+
packageVersionFileURL: URL,
30+
packageVersionSwiftFileURL: URL
31+
) {
32+
self.packageVersionFileURL = packageVersionFileURL
33+
self.packageVersionSwiftFileURL = packageVersionSwiftFileURL
34+
}
35+
36+
// MARK: - Code generation
37+
38+
func generatePackageVersionFile() throws {
39+
let currentVersionData = try Data(contentsOf: packageVersionFileURL)
40+
guard let packageVersion = String(data: currentVersionData, encoding: .utf8) else {
41+
throw Error("Package.version.next does not contain UTF-8 data.")
42+
}
43+
_ = try Version(packageVersion) // throws if currentVersion is not a valid version string
44+
let packageVersionFileContents = """
45+
//
46+
// Copyright Amazon.com Inc. or its affiliates.
47+
// All Rights Reserved.
48+
//
49+
// SPDX-License-Identifier: Apache-2.0
50+
//
51+
52+
// Code is auto-generated. DO NOT EDIT!
53+
54+
public let packageVersion = "\(packageVersion.trimmingCharacters(in: .whitespacesAndNewlines))"
55+
56+
"""
57+
try FileManager.default.createDirectory(
58+
at: packageVersionSwiftFileURL.deletingLastPathComponent(),
59+
withIntermediateDirectories: true
60+
)
61+
try Data(packageVersionFileContents.utf8).write(to: packageVersionSwiftFileURL)
62+
}
63+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
//
2+
// Copyright Amazon.com Inc. or its affiliates.
3+
// All Rights Reserved.
4+
//
5+
// SPDX-License-Identifier: Apache-2.0
6+
//
7+
8+
import Foundation
9+
import struct AWSCLIUtils.Error
10+
11+
struct PartitionsBuilder {
12+
let partitionsFileURL: URL
13+
let partitionsSwiftFileURL: URL
14+
15+
// MARK: - init
16+
17+
init(repoPath: String) {
18+
let repoFileURL = URL(fileURLWithPath: repoPath)
19+
self.init(
20+
partitionsFileURL: repoFileURL.appendingPathComponent("codegen/sdk-codegen/sdk-partitions.json"),
21+
partitionsSwiftFileURL: repoFileURL.appendingPathComponent(
22+
"Sources/Core/AWSSDKDynamic/Sources/AWSSDKDynamic/Partitions.swift"
23+
)
24+
)
25+
}
26+
27+
init(
28+
partitionsFileURL: URL,
29+
partitionsSwiftFileURL: URL
30+
) {
31+
self.partitionsFileURL = partitionsFileURL
32+
self.partitionsSwiftFileURL = partitionsSwiftFileURL
33+
}
34+
35+
// MARK: - Code generation
36+
37+
func generatePartitionsFile() throws {
38+
let partitionsData = try Data(contentsOf: partitionsFileURL)
39+
guard let partitions = String(data: partitionsData, encoding: .utf8) else {
40+
throw Error("sdk-partitions.json does not contain UTF-8 data.")
41+
}
42+
_ = try JSONSerialization.jsonObject(with: partitionsData) // verifies partitions are valid JSON
43+
let partitionsSwiftFileContents = """
44+
//
45+
// Copyright Amazon.com Inc. or its affiliates.
46+
// All Rights Reserved.
47+
//
48+
// SPDX-License-Identifier: Apache-2.0
49+
//
50+
51+
// Code is auto-generated. DO NOT EDIT!
52+
53+
public let partitions = #\"\"\"
54+
\(partitions.trimmingCharacters(in: .whitespacesAndNewlines))
55+
\"\"\"#
56+
57+
"""
58+
try FileManager.default.createDirectory(
59+
at: partitionsSwiftFileURL.deletingLastPathComponent(),
60+
withIntermediateDirectories: true
61+
)
62+
try Data(partitionsSwiftFileContents.utf8).write(to: partitionsSwiftFileURL)
63+
}
64+
}

0 commit comments

Comments
 (0)