From ff082758d30fc1695e760ad249fc72fdd6521920 Mon Sep 17 00:00:00 2001 From: Mehrshad Date: Wed, 18 Oct 2023 15:40:38 +0330 Subject: [PATCH] scripts/sanitycheck.fsx: fix .NET legacy As a result of this change, the sanity check works with both dotnet and mono, and the check is based on the environment variables that we set on make.sh. Co-authored-by: Afshin Arani --- scripts/make.sh | 2 +- scripts/sanitycheck.fsx | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/make.sh b/scripts/make.sh index 913fa8e95..180ff91d4 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -6,4 +6,4 @@ if [ ! -f "$BUILD_CONFIG" ]; then echo "ERROR: configure hasn't been run yet, run ./configure.sh first" >&2 && exit 1 fi source "$BUILD_CONFIG" -FsxRunnerBin=$FsxRunnerBin FsxRunnerArg=$FsxRunnerArg BuildTool=$BuildTool $FsxRunnerBin $FsxRunnerArg ./scripts/make.fsx "$@" +FsxRunnerBin=$FsxRunnerBin FsxRunnerArg=$FsxRunnerArg BuildTool=$BuildTool LegacyBuildTool=$LegacyBuildTool $FsxRunnerBin $FsxRunnerArg ./scripts/make.fsx "$@" diff --git a/scripts/sanitycheck.fsx b/scripts/sanitycheck.fsx index 87ad24133..afaf61e4d 100755 --- a/scripts/sanitycheck.fsx +++ b/scripts/sanitycheck.fsx @@ -425,6 +425,7 @@ let SanityCheckNugetPackages () = 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") + Path.Combine(FsxHelper.SourceDir.FullName, "gwallet.core.sln") ] let solutionFiles = solutionFileNames |> List.map FileInfo @@ -441,10 +442,15 @@ let SanityCheckNugetPackages () = 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" -> + | Misc.Platform.Linux when "dotnet" = Environment.GetEnvironmentVariable "BuildTool" -> + sanityCheckNugetPackagesFromSolution solutionFiles.[3] + | Misc.Platform.Linux when "msbuild" = Environment.GetEnvironmentVariable "LegacyBuildTool" -> sanityCheckNugetPackagesFromSolution solutionFiles.[0] - - | Misc.Platform.Mac -> + // .NET-only macOS only builds gwallet.core.sln + | Misc.Platform.Mac when "dotnet" = Environment.GetEnvironmentVariable "BuildTool" + && Environment.GetEnvironmentVariable "LegacyBuildTool" = "" -> + sanityCheckNugetPackagesFromSolution solutionFiles.[3] + | Misc.Platform.Mac when "msbuild" = Environment.GetEnvironmentVariable "LegacyBuildTool" -> sanityCheckNugetPackagesFromSolution solutionFiles.[1] | _ (* stockmono linux and windows *) ->