|
1 | | -namespace Ionide.ProjInfo |
| 1 | +namespace Ionide.ProjInfo |
2 | 2 |
|
3 | 3 | open System |
4 | 4 | open System.Collections.Generic |
@@ -358,16 +358,25 @@ module ProjectLoader = |
358 | 358 | | Other of ProjectInstance |
359 | 359 |
|
360 | 360 | let (|IsTraversal|_|) (p: ProjectInstance) = |
361 | | - match p.GetProperty "IsTraversal" with |
362 | | - | null -> None |
363 | | - | p when Boolean.TryParse(p.EvaluatedValue) = (true, false) -> None |
364 | | - | _ -> Some() |
| 361 | + let prop = p.GetProperty "IsTraversal" |
| 362 | + if isNull prop then |
| 363 | + None |
| 364 | + else |
| 365 | + match Boolean.TryParse(prop.EvaluatedValue) with |
| 366 | + | true, true -> Some() |
| 367 | + | _ -> None |
365 | 368 |
|
366 | 369 | let (|DesignTimeCapable|_|) (targets: string seq) (p: ProjectInstance) = |
367 | | - if Seq.forall p.Targets.ContainsKey targets then |
368 | | - Some() |
| 370 | + // https://github.com/dotnet/project-system/blob/main/docs/design-time-builds.md#diagnosing-design-time-builds |
| 371 | + let designTimeBuildTargets = p.GetProperty "DesignTimeBuildTargets" |
| 372 | + if not (isNull designTimeBuildTargets) && not (String.IsNullOrWhiteSpace designTimeBuildTargets.EvaluatedValue) then |
| 373 | + Some() |
369 | 374 | else |
370 | | - None |
| 375 | + let missing = targets |> Seq.filter (fun t -> not (p.Targets.ContainsKey t)) |> Seq.toList |
| 376 | + if List.isEmpty missing then |
| 377 | + Some() |
| 378 | + else |
| 379 | + None |
371 | 380 |
|
372 | 381 | let internal projectLoaderLogger = lazy (LogProvider.getLoggerByName "ProjectLoader") |
373 | 382 |
|
@@ -437,7 +446,7 @@ module ProjectLoader = |
437 | 446 | member this.Parameters: string = "" |
438 | 447 |
|
439 | 448 | member this.Parameters |
440 | | - with set (v: string): unit = printfn "v" |
| 449 | + with set (v: string): unit = () |
441 | 450 |
|
442 | 451 | member this.Shutdown() : unit = () |
443 | 452 | member this.Verbosity: LoggerVerbosity = LoggerVerbosity.Detailed |
@@ -655,10 +664,7 @@ module ProjectLoader = |
655 | 664 | "CoreCompile" |
656 | 665 | |] |
657 | 666 | else |
658 | | - [| |
659 | | - yield! designTimeBuildTargetsCore |
660 | | - "DispatchToInnerBuilds" |
661 | | - |] |
| 667 | + designTimeBuildTargetsCore |
662 | 668 |
|
663 | 669 | let setLegacyMsbuildProperties isOldStyleProjFile = |
664 | 670 | match LegacyFrameworkDiscovery.msbuildBinary.Value with |
|
0 commit comments