-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Refactor #1
Changes from all commits
2496820
cf24ae9
2b8aa01
55ca837
1cdaeb2
e6d053d
e387f95
58e4746
1125e8c
20511b3
e7bd7ab
ca8781f
e8da38e
d322e81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,5 @@ DerivedData/ | |
|
|
||
| # SwiftLint Remote Config Cache | ||
| .swiftlint/RemoteConfigCache | ||
| .claude | ||
| MEGAREADME.md | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import Foundation | ||
| import PackagePlugin | ||
|
|
||
| @main | ||
| struct GenerateAXConstantsPlugin: CommandPlugin { | ||
| func performCommand(context: PluginContext, arguments: [String]) async throws { | ||
| let generator = try context.tool(named: "AXConstantsGenerator") | ||
|
|
||
| let outputDir = context.package.directory | ||
| .appending(subpath: "Sources") | ||
| .appending(subpath: "AccessibilityControl") | ||
|
|
||
| let process = Process() | ||
| process.executableURL = URL(fileURLWithPath: generator.path.string) | ||
| process.arguments = [outputDir.string] | ||
|
|
||
| try process.run() | ||
| process.waitUntilExit() | ||
|
|
||
| guard process.terminationStatus == 0 else { | ||
| Diagnostics.error("AXConstantsGenerator exited with code \(process.terminationStatus)") | ||
| return | ||
| } | ||
|
Comment on lines
+13
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generator failures are silently swallowed — capture stderr and throw on non-zero exit.
🔧 Proposed fix+ let outputPipe = Pipe()
+ let errorPipe = Pipe()
let process = Process()
process.executableURL = URL(fileURLWithPath: generator.path.string)
process.arguments = [outputDir.string]
+ process.standardOutput = outputPipe
+ process.standardError = errorPipe
try process.run()
process.waitUntilExit()
+ let stdoutData = outputPipe.fileHandleForReading.readDataToEndOfFile()
+ let stderrData = errorPipe.fileHandleForReading.readDataToEndOfFile()
+
+ if let output = String(data: stdoutData, encoding: .utf8), !output.isEmpty {
+ print(output)
+ }
+
guard process.terminationStatus == 0 else {
- Diagnostics.error("AXConstantsGenerator exited with code \(process.terminationStatus)")
- return
+ let stderr = String(data: stderrData, encoding: .utf8) ?? ""
+ throw "AXConstantsGenerator exited with code \(process.terminationStatus): \(stderr)"
}Note: You'll need a small 🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Swift 5.11 release date tools version availability💡 Result:
swift-tools-version: 5.11: If you’re asking about Swift Package Manager tools version 5.11, it’s not tied to a stable “Swift 5.11” compiler release, and using newer tools versions inside Xcode can be confusing because Xcode uses its own embedded SwiftPM, which may not match an installed custom toolchain. [3]Sources:
[1] Swift.org — Swift 5.10 Released (Mar 5, 2024) (swift.org)
[2] Swift.org — Announcing Swift 6 (Sep 17, 2024) (swift.org)
[3] Swift Forums — discussion of 5.10/“5.11” development snapshots & Xcode SwiftPM behavior (Feb 2024) (forums.swift.org)
[4] Apple Developer — Xcode releases table showing Swift 6.0 with Xcode 16 (developer.apple.com)
Citations:
Remove swift-tools-version:5.11—this version does not exist.
Swift 5.11 was never released. Swift 5.10 (March 2024) was the final Swift 5.x release; the next version is Swift 6.0 (September 2024). "5.11" appeared only as a development snapshot identifier and is not available in any production Xcode or SwiftPM toolchain. Change to
swift-tools-version:5.10orswift-tools-version:6.0depending on your minimum Xcode requirement.🤖 Prompt for AI Agents