@@ -97,7 +97,7 @@ import class Dispatch.DispatchQueue
97
97
else {
98
98
return nil
99
99
}
100
- let currentArgsHash = Self . computeArgsHash ( parsedOptions)
100
+ let currentArgsHash = BuildRecordArguments . computeHash ( parsedOptions)
101
101
let compilationInputModificationDates =
102
102
recordedInputModificationDates. filter { input, _ in
103
103
input. type. isPartOfSwiftCompilation
@@ -113,16 +113,6 @@ import class Dispatch.DispatchQueue
113
113
compilationInputModificationDates: compilationInputModificationDates)
114
114
}
115
115
116
- private static func computeArgsHash( _ parsedOptionsArg: ParsedOptions
117
- ) -> String {
118
- var parsedOptions = parsedOptionsArg
119
- let hashInput = parsedOptions
120
- . filter { $0. option. affectsIncrementalBuild && $0. option. kind != . input}
121
- . map { $0. description } // The description includes the spelling of the option itself and, if present, its argument(s).
122
- . joined ( )
123
- return SHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
124
- }
125
-
126
116
/// Determine the input and output path for the build record
127
117
private static func computeBuildRecordPath(
128
118
outputFileMap: OutputFileMap ? ,
@@ -209,3 +199,15 @@ import class Dispatch.DispatchQueue
209
199
buildRecordPath. parentDirectory
210
200
}
211
201
}
202
+
203
+ public struct BuildRecordArguments {
204
+ /// Compute a hash of the parsed options that affect incremental builds.
205
+ public static func computeHash( _ parsedOptionsArg: ParsedOptions ) -> String {
206
+ var parsedOptions = parsedOptionsArg
207
+ let hashInput = parsedOptions
208
+ . filter { $0. option. affectsIncrementalBuild && $0. option. kind != . input}
209
+ . map { $0. description } // The description includes the spelling of the option itself and, if present, its argument(s).
210
+ . joined ( )
211
+ return SHA256 ( ) . hash ( hashInput) . hexadecimalRepresentation
212
+ }
213
+ }
0 commit comments