Skip to content

Commit 01721a1

Browse files
committed
Merge pull request #478 from rneatherway/project-cracking-fix-child-references
Project cracking fix child references
2 parents 9ba8aef + b9734d1 commit 01721a1

File tree

1 file changed

+14
-11
lines changed
  • src/fsharp/FSharp.Compiler.Service.ProjectCracker.Exe

1 file changed

+14
-11
lines changed

src/fsharp/FSharp.Compiler.Service.ProjectCracker.Exe/Program.fs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -378,20 +378,23 @@ module Program =
378378
// C# referenced projects, as we don't look at them otherwise.
379379
let referencedProjectOutputs =
380380
if runningOnMono then
381-
[| yield! Array.map (fun (s,_) -> "-r:" + s) referencedProjectOptions
382-
for file in parsedProject.ProjectReferences do
383-
let ext = Path.GetExtension(file)
384-
if ext = ".csproj" || ext = ".vbproj" then
385-
let parsedProject = FSharpProjectFileInfo.Parse(file, properties=properties, enableLogging=false)
386-
match parsedProject.OutputFile with
387-
| None -> ()
388-
| Some f -> yield "-r:" + f |]
381+
[ yield! Array.map (fun (s,_) -> "-r:" + s) referencedProjectOptions
382+
for file in parsedProject.ProjectReferences do
383+
let ext = Path.GetExtension(file)
384+
if ext = ".csproj" || ext = ".vbproj" then
385+
let parsedProject = FSharpProjectFileInfo.Parse(file, properties=properties, enableLogging=false)
386+
match parsedProject.OutputFile with
387+
| None -> ()
388+
| Some f -> yield "-r:" + f ]
389389
else
390-
[||]
390+
[]
391+
392+
// On some versions of Mono the referenced projects are already
393+
// correctly included, so we make sure not to introduce duplicates
394+
|> List.filter (fun r -> not (Set.contains r (set parsedProject.Options)))
391395

392396
let options = { ProjectFile = file
393-
Options = Array.append (Array.ofList (parsedProject.Options))
394-
referencedProjectOutputs
397+
Options = Array.ofSeq (parsedProject.Options @ referencedProjectOutputs)
395398
ReferencedProjectOptions = referencedProjectOptions
396399
LogOutput = parsedProject.LogOutput }
397400

0 commit comments

Comments
 (0)