Skip to content

Commit

Permalink
scripts/sanitycheck: also check nugets of non-main sols
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Nov 11, 2023
1 parent 89b3189 commit e87dae8
Showing 1 changed file with 37 additions and 27 deletions.
64 changes: 37 additions & 27 deletions scripts/sanitycheck.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,42 +114,38 @@ let FindOffendingPrintfUsage () =
Environment.Exit 1


let SanityCheckNugetPackages () =
let conventionDirectory =
let SanityCheckNugetPackages (solution: FileInfo) =
let conventionsDir =
Path.Combine(FsxHelper.RootDir.FullName, "..", "conventions")

let cloningResult =
Process.Execute(
{ Command = "git"
Arguments =
sprintf
"clone -b SanityCheckStepSquashed https://github.com/Mersho/conventions.git %s"
conventionDirectory },
Echo.Off
)

match cloningResult.Result with
| Error _ ->
Console.WriteLine()
Console.Error.WriteLine "Clone failed."
Environment.Exit 1

| WarningsOrAmbiguous _ -> ()

| _ -> ()
|> DirectoryInfo

if not conventionsDir.Exists then
let cloningResult =
Process.Execute(
{ Command = "git"
Arguments =
sprintf
"clone -b SanityCheckStepSquashed https://github.com/Mersho/conventions.git %s"
conventionsDir.FullName },
Echo.Off
)
match cloningResult.Result with
| Error _ ->
Console.WriteLine()
Console.Error.WriteLine "Clone failed."
Environment.Exit 1
| _ -> ()

let sanityCheckArgs =
let sanityCheckExecuteCommand =
sprintf
"fsi %s"
(Path.Combine(FsxHelper.RootDir.FullName, conventionDirectory, "scripts", "sanityCheckNuget.fsx"))
(Path.Combine(FsxHelper.RootDir.FullName, conventionsDir.FullName, "scripts", "sanityCheckNuget.fsx"))

sprintf
"%s %s"
sanityCheckExecuteCommand
(FsxHelper.GetSolution SolutionFile.Default)
.FullName

solution.FullName

Process
.Execute(
Expand All @@ -162,6 +158,20 @@ let SanityCheckNugetPackages () =


FindOffendingPrintfUsage()

#if !LEGACY_FRAMEWORK
SanityCheckNugetPackages()

let mainSol = FsxHelper.GetSolution SolutionFile.Default
SanityCheckNugetPackages mainSol

match Misc.GuessPlatform() with
| Misc.Platform.Linux ->
FsxHelper.GetSolution SolutionFile.Linux
|> SanityCheckNugetPackages
| Misc.Platform.Mac ->
FsxHelper.GetSolution SolutionFile.Mac
|> SanityCheckNugetPackages
| _ ->
()

#endif

0 comments on commit e87dae8

Please sign in to comment.