@@ -131,15 +131,16 @@ module CompilerHost =
131
131
132
132
let short ( s : string ) = s[ 0 .. 10 ]. ToLowerInvariant()
133
133
134
- let deepSourceHash sourceFiles =
134
+ let deepSourceHash rootContentHash sourceFiles =
135
135
136
136
let fileHash filePath = File.ReadAllText filePath |> sha256
137
137
138
138
let combinedHash =
139
139
sourceFiles
140
140
|> Seq.map fileHash
141
141
|> Seq.sort
142
- |> Seq.reduce ( fun a b -> a + b)
142
+ |> Seq.fold ( fun a b -> a + b) String.Empty
143
+ |> (+) rootContentHash
143
144
|> sha256
144
145
145
146
short combinedHash
@@ -194,7 +195,7 @@ module CompilerHost =
194
195
195
196
let outputDllName =
196
197
if options.UseCache then
197
- let hash = Hash.deepSourceHash metadata.SourceFiles
198
+ let hash = Hash.deepSourceHash ( rootFilePath |> File.ReadAllText |> Hash.sha256 |> Hash.short ) metadata.SourceFiles
198
199
Path.Combine( options.OutputDir.TrimEnd( '\\' , '/' ), $" {hash}.dll" )
199
200
else
200
201
$" {Path.GetTempFileName()}.dll"
@@ -271,9 +272,9 @@ module CompilerHost =
271
272
let metadata =
272
273
{ ScriptCache.Default with
273
274
FilePath = cacheDepsFilePath
274
- SourceFiles = projOptions.SourceFiles |> Seq.toList }
275
+ SourceFiles = projOptions.SourceFiles |> Seq.except [ rootFilePath ] |> Seq. toList }
275
276
log " Source files:"
276
- for sf in metadata .SourceFiles do
277
+ for sf in projOptions .SourceFiles do
277
278
log $" %s {sf}"
278
279
279
280
if options.Compiler.Standalone then
@@ -283,7 +284,7 @@ module CompilerHost =
283
284
Ok(
284
285
{ metadata with
285
286
NuGets =
286
- metadata .SourceFiles
287
+ projOptions .SourceFiles
287
288
|> Seq.filter ( fun p ->
288
289
p.Contains( " /.packagemanagement/nuget/" )
289
290
|| p.Contains( " /.paket/load/" ))
0 commit comments