@@ -145,7 +145,7 @@ module LegacyFrameworkDiscovery =
145145 |> Some
146146 else
147147 // taken from https://github.com/microsoft/vswhere
148- // vswhere.exe is guranteed to be at the following location. refer to https://github.com/Microsoft/vswhere/issues/162
148+ // vswhere.exe is guaranteed to be at the following location. refer to https://github.com/Microsoft/vswhere/issues/162
149149 let vsWhereDir =
150150 Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.ProgramFilesX86), " Microsoft Visual Studio" , " Installer" )
151151 |> DirectoryInfo
@@ -404,9 +404,9 @@ module ProjectLoader =
404404 )
405405
406406 if String.IsNullOrWhiteSpace tfm then
407- let tfms = pi.GetPropertyValue " TargetFrameworks"
407+ let targetFrameworks = pi.GetPropertyValue " TargetFrameworks"
408408
409- match tfms with
409+ match targetFrameworks with
410410 | null -> None
411411 | tfms ->
412412 match tfms.Split( ';' ) with
@@ -558,7 +558,7 @@ module ProjectLoader =
558558 |> Seq.filter ( fun p -> p.ItemType = " CscCommandLineArgs" )
559559 |> Seq.map ( fun p -> p.EvaluatedInclude)
560560
561- let getP2Prefs ( LoadedProject project ) =
561+ let getP2PRefs ( LoadedProject project ) =
562562 project.Items
563563 |> Seq.filter ( fun p -> p.ItemType = " _MSBuildProjectReferenceExistent" )
564564 |> Seq.map ( fun p ->
@@ -755,7 +755,7 @@ module ProjectLoader =
755755 path
756756 )
757757
758- let project = {
758+ let project : ProjectOptions = {
759759 ProjectId = Some path
760760 ProjectFileName = path
761761 TargetFramework = sdkInfo.TargetFramework
@@ -766,9 +766,11 @@ module ProjectLoader =
766766 LoadTime = DateTime.Now
767767 TargetPath =
768768 props
769- |> Seq.tryFind ( fun n -> n.Name = " TargetPath" )
770- |> Option.map ( fun n -> n.Value)
769+ |> Seq.tryPick ( fun n -> if n.Name = " TargetPath" then Some n.Value else None)
771770 |> Option.defaultValue " "
771+ TargetRefPath =
772+ props
773+ |> Seq.tryPick ( fun n -> if n.Name = " TargetRefPath" then Some n.Value else None)
772774 ProjectOutputType = outputType
773775 ProjectSdkInfo = sdkInfo
774776 Items = compileItems
@@ -804,13 +806,14 @@ module ProjectLoader =
804806 " BaseIntermediateOutputPath"
805807 " IntermediateOutputPath"
806808 " TargetPath"
809+ " TargetRefPath"
807810 " IsCrossTargetingBuild"
808811 " TargetFrameworks"
809812 ]
810813
811- let p2pRefs = getP2Prefs project
814+ let p2pRefs = getP2PRefs project
812815
813- let comandlineArgs =
816+ let commandLineArgs =
814817 if path.EndsWith " .fsproj" then
815818 getFscArgs project
816819 else
@@ -826,7 +829,7 @@ module ProjectLoader =
826829 Result.Error " not restored"
827830 else
828831
829- let proj = mapToProject path comandlineArgs p2pRefs compileItems nuGetRefs sdkInfo props customProps
832+ let proj = mapToProject path commandLineArgs p2pRefs compileItems nuGetRefs sdkInfo props customProps
830833
831834 Result.Ok proj
832835
@@ -918,7 +921,7 @@ type WorkspaceLoaderViaProjectGraph private (toolsPath, ?globalProperties: (stri
918921 let globalProperties = ProjectLoader.getGlobalProps projectPath tfm globalProperties
919922 ProjectInstance( projectPath, globalProperties, toolsVersion = null , projectCollection = projectCollection)
920923
921- let projectGraphProjs ( paths : string seq ) =
924+ let projectGraphProjects ( paths : string seq ) =
922925
923926 handleProjectGraphFailures
924927 <| fun () ->
@@ -1044,28 +1047,28 @@ type WorkspaceLoaderViaProjectGraph private (toolsPath, ?globalProperties: (stri
10441047 then
10451048 handleError msbuildMessage result.Exception
10461049 else
1047- let buildProjs =
1050+ let builtProjects =
10481051 result.ResultsByNode.Keys
10491052 |> Seq.collect ( fun ( pgn : ProjectGraphNode ) -> seq { yield pgn.ProjectInstance })
1050- |> Seq.toList
1053+ |> Seq.toArray
10511054
1052- let projectsBuilt = Seq.length buildProjs
1055+ let projectsBuiltCount = builtProjects.Length
10531056
10541057 match result.OverallResult with
10551058 | BuildResultCode.Success ->
10561059 logger.info (
1057- Log.setMessageI $" Overall Build: {result.OverallResult:overallCode}, projects built {projectsBuilt :count}"
1060+ Log.setMessageI $" Overall Build: {result.OverallResult:overallCode}, projects built {projectsBuiltCount :count}"
10581061 >> Log.addExn result.Exception
10591062 )
10601063 | BuildResultCode.Failure
10611064 | _ ->
10621065 logger.error (
1063- Log.setMessageI $" Overall Build: {result.OverallResult:overallCode}, projects built {projectsBuilt :count} : {msbuildMessage:msbuildMessage} "
1066+ Log.setMessageI $" Overall Build: {result.OverallResult:overallCode}, projects built {projectsBuiltCount :count} : {msbuildMessage:msbuildMessage} "
10641067 >> Log.addExn result.Exception
10651068 )
10661069
10671070 let projects =
1068- buildProjs
1071+ builtProjects
10691072 |> Seq.map ( fun p -> p.FullPath, ProjectLoader.getLoadedProjectInfo p.FullPath customProperties ( ProjectLoader.LoadedProject p))
10701073
10711074 |> Seq.choose ( fun ( projectPath , projectOptionResult ) ->
@@ -1111,7 +1114,7 @@ type WorkspaceLoaderViaProjectGraph private (toolsPath, ?globalProperties: (stri
11111114
11121115 interface IWorkspaceLoader with
11131116 override this.LoadProjects ( projects : string list , customProperties , binaryLogs ) =
1114- projectGraphProjs projects
1117+ projectGraphProjects projects
11151118 |> Option.map ( fun pg -> loadProjects ( pg, customProperties, binaryLogs))
11161119 |> Option.defaultValue Seq.empty
11171120
@@ -1273,8 +1276,8 @@ type WorkspaceLoader private (toolsPath: ToolsPath, ?globalProperties: (string *
12731276 member this.LoadSln ( sln , customProperties : string list , binaryLogs ) =
12741277 match InspectSln.tryParseSln sln with
12751278 | Ok(_, slnData) ->
1276- let projs = InspectSln.loadingBuildOrder slnData
1277- this.LoadProjects( projs , customProperties, binaryLogs)
1279+ let solutionProjects = InspectSln.loadingBuildOrder slnData
1280+ this.LoadProjects( solutionProjects , customProperties, binaryLogs)
12781281 | Error d -> failwithf " Cannot load the sln: %A " d
12791282
12801283 member this.LoadSln ( sln , customProperties ) =
@@ -1340,20 +1343,20 @@ module ProjectViewer =
13401343 |> ( fun path -> path.EndsWith( assemblyAttributesName))
13411344 | None -> false
13421345
1343- //the generated assemblyinfo .fs are not shown as sources
1344- let isGeneratedAssemblyinfo ( name : string ) =
1346+ //The generated AssemblyInfo .fs are not shown as sources
1347+ let isGeneratedAssemblyInfo ( name : string ) =
13451348 //TODO check is in `obj` dir for the tfm
13461349 //TODO better, get the name from fsproj
13471350 name.EndsWith( $" {projName}.AssemblyInfo.{sourceFilesExtension}" )
13481351
13491352 let includeSourceFile ( name : string ) =
13501353 not ( isAssemblyAttributes name)
1351- && not ( isGeneratedAssemblyinfo name)
1354+ && not ( isGeneratedAssemblyInfo name)
13521355
13531356 sources
13541357 |> List.choose (
13551358 function
1356- | ProjectItem.Compile( name, fullpath ) -> Some( name, fullpath )
1359+ | ProjectItem.Compile( name, fullPath ) -> Some( name, fullPath )
13571360 )
13581361 |> List.filter ( fun ( _ , p ) -> includeSourceFile p)
13591362
@@ -1363,5 +1366,5 @@ module ProjectViewer =
13631366 |> Path.GetFileNameWithoutExtension
13641367 Items =
13651368 compileFiles
1366- |> List.map ( fun ( name , fullpath ) -> ProjectViewerItem.Compile( fullpath , { ProjectViewerItemConfig.Link = name }))
1369+ |> List.map ( fun ( name , fullPath ) -> ProjectViewerItem.Compile( fullPath , { ProjectViewerItemConfig.Link = name }))
13671370 }
0 commit comments