diff --git a/scripts/fsxHelper.fs b/scripts/fsxHelper.fs index 668105c11..74664b745 100644 --- a/scripts/fsxHelper.fs +++ b/scripts/fsxHelper.fs @@ -10,6 +10,7 @@ module FsxHelper = let ScriptsDir = __SOURCE_DIRECTORY__ |> DirectoryInfo let RootDir = Path.Combine(ScriptsDir.FullName, "..") |> DirectoryInfo + let SourceDir = Path.Combine(ScriptsDir.FullName, "../src/") |> DirectoryInfo let NugetDir = Path.Combine (RootDir.FullName, ".nuget") |> DirectoryInfo let NugetExe = Path.Combine (NugetDir.FullName, "nuget.exe") |> FileInfo let NugetSolutionPackagesDir = Path.Combine(RootDir.FullName, "packages") |> DirectoryInfo diff --git a/scripts/sanitycheck.fsx b/scripts/sanitycheck.fsx index dc990fff8..87ad24133 100755 --- a/scripts/sanitycheck.fsx +++ b/scripts/sanitycheck.fsx @@ -421,26 +421,37 @@ 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.RootDir.EnumerateFiles().Where ( - fun file -> + let solutionFileNames = [ + Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.linux-legacy.sln") + Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.mac-legacy.sln") + Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.core-legacy.sln") + ] - match Misc.GuessPlatform() with + let solutionFiles = solutionFileNames |> List.map FileInfo - // 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.sln" + let checkFilesExist (fileNames: List) = + fileNames + |> List.map (fun fileName -> fileName.Exists) + |> List.fold (&&) true - | Misc.Platform.Mac -> - file.Name = "gwallet.mac.sln" + let allFilesExist = checkFilesExist solutionFiles - | _ (* stockmono linux and windows *) -> + if not allFilesExist then + failwith "Solution files were not found to do sanity check." - // TODO: have a windows solution file - file.Name = "gwallet.core.sln" - ) - for sol in solutions do - sanityCheckNugetPackagesFromSolution sol + 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 solutionFiles.[0] + + | Misc.Platform.Mac -> + sanityCheckNugetPackagesFromSolution solutionFiles.[1] + + | _ (* stockmono linux and windows *) -> + + // TODO: have a windows solution file + sanityCheckNugetPackagesFromSolution solutionFiles.[2] + FindOffendingPrintfUsage() SanityCheckNugetPackages()