Skip to content

Commit

Permalink
WIP: the solotion files must exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Mersho committed Oct 17, 2023
1 parent 6804b72 commit 01bc478
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions scripts/sanitycheck.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.linux-legacy.sln") |> FileInfo
Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.mac-legacy.sln") |> FileInfo
Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.core-legacy.sln") |> FileInfo
]

match Misc.GuessPlatform() with
let checkFilesExist (fileNames: List<FileInfo>) =
fileNames
|> List.map (fun fileName -> fileName.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
failwith "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 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 solutionFileNames.[1]

| _ (* stockmono linux and windows *) ->

// TODO: have a windows solution file
sanityCheckNugetPackagesFromSolution solutionFileNames.[2]


FindOffendingPrintfUsage()
SanityCheckNugetPackages()
Expand Down

0 comments on commit 01bc478

Please sign in to comment.