Skip to content

Commit

Permalink
scripts/sanitycheck.fsx: fix .NET legacy
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Mersho and aarani committed Oct 19, 2023
1 parent 5dbb2cf commit ff08275
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
12 changes: 9 additions & 3 deletions scripts/sanitycheck.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 *) ->
Expand Down

0 comments on commit ff08275

Please sign in to comment.