File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
tools/generators/swift_debug_settings/src Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 1
1
import Darwin
2
+ import Foundation
2
3
import ToolCommon
3
4
4
5
@main
@@ -12,16 +13,32 @@ struct SwiftDebugSettings {
12
13
13
14
do {
14
15
// First argument is executable name
15
- var rawArguments = CommandLine . arguments. dropFirst ( )
16
+ let rawArguments = CommandLine . arguments. dropFirst ( )
17
+
18
+ // Check for a params file
19
+ var arguments : ArraySlice < String >
20
+ if let arg = rawArguments. first, rawArguments. count == 1 ,
21
+ arg. starts ( with: " @ " )
22
+ {
23
+ arguments = try await parseParamsFile ( String ( arg. dropFirst ( ) ) )
24
+ } else {
25
+ arguments = ArraySlice ( rawArguments)
26
+ }
16
27
17
- if try rawArguments . consumeArg ( " colorize " , as: Bool . self) {
28
+ if try arguments . consumeArg ( " colorize " , as: Bool . self) {
18
29
logger. enableColors ( )
19
30
}
20
31
21
- try await Generator ( ) . generate ( rawArguments: rawArguments )
32
+ try await Generator ( ) . generate ( rawArguments: arguments )
22
33
} catch {
23
34
logger. logError ( error. localizedDescription)
24
35
Darwin . exit ( 1 )
25
36
}
26
37
}
38
+
39
+ private static func parseParamsFile(
40
+ _ path: String
41
+ ) async throws -> ArraySlice < String > {
42
+ return try await ArraySlice ( URL ( fileURLWithPath: path) . allLines. collect ( ) )
43
+ }
27
44
}
Original file line number Diff line number Diff line change @@ -1049,6 +1049,8 @@ def _write_swift_debug_settings(
1049
1049
)
1050
1050
1051
1051
args = actions .args ()
1052
+ args .use_param_file ("@%s" )
1053
+ args .set_param_file_format (format = "multiline" )
1052
1054
1053
1055
# colorize
1054
1056
args .add (TRUE_ARG if colorize else FALSE_ARG )
You can’t perform that action at this time.
0 commit comments