From acf9007242b21077876b5a519eac34e85ac87268 Mon Sep 17 00:00:00 2001 From: Mehrshad Date: Tue, 17 Oct 2023 13:50:23 +0330 Subject: [PATCH] WIP: the solotion files must exist --- scripts/sanitycheck.fsx | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/scripts/sanitycheck.fsx b/scripts/sanitycheck.fsx index bef7ebd78..9867e240f 100755 --- a/scripts/sanitycheck.fsx +++ b/scripts/sanitycheck.fsx @@ -421,28 +421,35 @@ let SanityCheckNugetPackages () = //let solutions = Directory.GetCurrentDirectory() |> DirectoryInfo |> findSolutions //NOTE: we hardcode the solutions rather than the line above, because e.g. Linux OS can't build/restore iOS proj - let solutions = - FsxHelper.SourceDir.EnumerateFiles().Where ( - fun file -> + let solutionFileNames = [ + System.IO.Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.linux-legacy.sln"); + System.IO.Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.mac-legacy.sln"); + System.IO.Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.core-legacy.sln") + ] - match Misc.GuessPlatform() with + let checkFilesExist (fileNames: string list) = + fileNames + |> List.map System.IO.File.Exists + |> List.fold (&&) true - // xbuild cannot build .NETStandard projects so we cannot build the non-Core parts: - | Misc.Platform.Linux when "msbuild" = Environment.GetEnvironmentVariable "BuildTool" -> - file.Name = "gwallet.linux-legacy.sln" + let allFilesExist = checkFilesExist solutionFileNames - | Misc.Platform.Mac -> - file.Name = "gwallet.mac-legacy.sln" + if not (allFilesExist) then + raise <| FileNotFoundException("solution files were not found to do sanity check.") - | _ (* stockmono linux and windows *) -> + match Misc.GuessPlatform() with + // xbuild cannot build .NETStandard projects so we cannot build the non-Core parts: + | Misc.Platform.Linux when "msbuild" = Environment.GetEnvironmentVariable "BuildTool" -> + sanityCheckNugetPackagesFromSolution (FileInfo <| solutionFileNames.[0]) - // TODO: have a windows solution file - file.Name = "gwallet.core-legacy.sln" - ) - if not (solutions.Any()) then - raise <| FileNotFoundException() - for sol in solutions do - sanityCheckNugetPackagesFromSolution sol + | Misc.Platform.Mac -> + sanityCheckNugetPackagesFromSolution (FileInfo <| solutionFileNames.[1]) + + | _ (* stockmono linux and windows *) -> + + // TODO: have a windows solution file + sanityCheckNugetPackagesFromSolution (FileInfo <| solutionFileNames.[2]) + FindOffendingPrintfUsage() SanityCheckNugetPackages()