diff --git a/scripts/fsxHelper.fs b/scripts/fsxHelper.fs index 668105c11..03366c4ad 100644 --- a/scripts/fsxHelper.fs +++ b/scripts/fsxHelper.fs @@ -6,10 +6,35 @@ open System.IO open Fsdk open Fsdk.Process +type SolutionFile = + | Default + | Linux + | Mac + module FsxHelper = + let GetSolution (solType: SolutionFile) = + let solFileName = + match solType with + | Default -> + #if !LEGACY_FRAMEWORK + "gwallet.core.sln" + #else + "gwallet.core-legacy.sln" + #endif + | Linux -> "gwallet.linux-legacy.sln" + | Mac -> "gwallet.mac-legacy.sln" + + let slnFile = + Path.Combine("src", solFileName) + |> FileInfo + if not slnFile.Exists then + raise <| FileNotFoundException("Solution file not found", slnFile.FullName) + slnFile + let ScriptsDir = __SOURCE_DIRECTORY__ |> DirectoryInfo let RootDir = Path.Combine(ScriptsDir.FullName, "..") |> DirectoryInfo + let SourceDir = Path.Combine(RootDir.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/make.fsx b/scripts/make.fsx index 71c9e55a1..11e143e59 100644 --- a/scripts/make.fsx +++ b/scripts/make.fsx @@ -5,14 +5,6 @@ open System.IO open System.Linq open System.Diagnostics -open System.Text -open System.Text.RegularExpressions -#r "System.Core.dll" -open System.Xml -#r "System.Xml.Linq.dll" -open System.Xml.Linq -open System.Xml.XPath - #if !LEGACY_FRAMEWORK #r "nuget: Fsdk, Version=0.6.0--date20230818-1152.git-83d671b" #else @@ -34,25 +26,6 @@ let UNIX_NAME = "geewallet" let CONSOLE_FRONTEND = "GWallet.Frontend.Console" let GTK_FRONTEND = "GWallet.Frontend.XF.Gtk" -type SolutionFile = - | Default - | Linux - | Mac - -let GetSolution (solType: SolutionFile) = - let solFileName = - match solType with - | Default -> -#if !LEGACY_FRAMEWORK - "gwallet.core.sln" -#else - "gwallet.core-legacy.sln" -#endif - | Linux -> "gwallet.linux-legacy.sln" - | Mac -> "gwallet.mac-legacy.sln" - - Path.Combine("src", solFileName) - type ProjectFile = | XFFrontend | GtkFrontend @@ -63,7 +36,12 @@ let GetProject (projFile: ProjectFile) = | GtkFrontend -> Path.Combine("GWallet.Frontend.XF.Gtk", "GWallet.Frontend.XF.Gtk.fsproj") | XFFrontend -> Path.Combine("GWallet.Frontend.XF", "GWallet.Frontend.XF.fsproj") - Path.Combine("src", projFileName) + let prjFile = + Path.Combine("src", projFileName) + |> FileInfo + if not prjFile.Exists then + raise <| FileNotFoundException("Project file not found", prjFile.FullName) + prjFile let BACKEND = "GWallet.Backend" @@ -154,11 +132,11 @@ FRONTEND_PATH="$DIR_OF_THIS_SCRIPT/../lib/$UNIX_NAME/$GWALLET_PROJECT.exe" exec mono "$FRONTEND_PATH" "$@" """ -let NugetRestore projectOrSolutionRelativePath = +let NugetRestore (projectOrSolution: FileInfo) = let nugetArgs = sprintf "restore %s -DisableParallelProcessing -SolutionDirectory ." - projectOrSolutionRelativePath + projectOrSolution.FullName let proc = Network.RunNugetCommand FsxHelper.NugetExe @@ -194,13 +172,13 @@ let PrintNugetVersion () = let BuildSolutionOrProject (buildToolAndBuildArg: string*string) - (fileName: string) + (file: FileInfo) (binaryConfig: BinaryConfig) (maybeConstant: Option) (extraOptions: string) = #if LEGACY_FRAMEWORK - NugetRestore fileName + NugetRestore file #endif let buildTool,buildArg = buildToolAndBuildArg @@ -255,7 +233,7 @@ let BuildSolutionOrProject configOption let buildArgs = sprintf "%s %s %s %s" buildArg - fileName + file.FullName configOptions extraOptions let buildProcess = Process.Execute ({ Command = buildTool; Arguments = buildArgs }, Echo.All) @@ -273,7 +251,7 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = let maybeBuildTool = Map.tryFind "BuildTool" buildConfigContents let maybeLegacyBuildTool = Map.tryFind "LegacyBuildTool" buildConfigContents - let solutionFileName = GetSolution SolutionFile.Default + let solutionFile = FsxHelper.GetSolution SolutionFile.Default let getBuildToolAndArgs(buildTool: string) = match buildTool with | "dotnet" -> @@ -307,7 +285,7 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = | None, Some buildTool -> BuildSolutionOrProject (getBuildToolAndArgs buildTool) - solutionFileName + solutionFile binaryConfig maybeConstant String.Empty @@ -328,7 +306,7 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = | Misc.Platform.Mac -> //this is because building in release requires code signing keys if binaryConfig = BinaryConfig.Debug then - let solution = GetSolution SolutionFile.Mac + let solution = FsxHelper.GetSolution SolutionFile.Mac // somehow, msbuild doesn't restore the frontend dependencies (e.g. Xamarin.Forms) when targetting // the {LINUX|MAC}_SOLUTION_FILE below, so we need this workaround. TODO: just finish migrating to MAUI(dotnet restore) NugetRestore solution @@ -337,7 +315,7 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = Frontend.Console | Misc.Platform.Linux -> if FsxHelper.AreGtkLibsPresent Echo.All then - let solution = GetSolution SolutionFile.Linux + let solution = FsxHelper.GetSolution SolutionFile.Linux // somehow, msbuild doesn't restore the frontend dependencies (e.g. Xamarin.Forms) when targetting // the {LINUX|MAC}_SOLUTION_FILE below, so we need this workaround. TODO: just finish migrating to MAUI(dotnet restore) NugetRestore solution 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 dc990fff8..6d83643af 100755 --- a/scripts/sanitycheck.fsx +++ b/scripts/sanitycheck.fsx @@ -421,26 +421,20 @@ 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 -> - - 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" -> - file.Name = "gwallet.linux.sln" - - | Misc.Platform.Mac -> - file.Name = "gwallet.mac.sln" - - | _ (* stockmono linux and windows *) -> - - // TODO: have a windows solution file - file.Name = "gwallet.core.sln" - ) - for sol in solutions do - sanityCheckNugetPackagesFromSolution sol + let sol = + match Misc.GuessPlatform() with +#if LEGACY_FRAMEWORK + | Misc.Platform.Linux when "msbuild" = Environment.GetEnvironmentVariable "LegacyBuildTool" -> + FsxHelper.GetSolution SolutionFile.Linux +#endif + | Misc.Platform.Mac when "msbuild" = Environment.GetEnvironmentVariable "LegacyBuildTool" -> + FsxHelper.GetSolution SolutionFile.Mac + | _ -> + // TODO: have a windows solution file + FsxHelper.GetSolution SolutionFile.Default + + sanityCheckNugetPackagesFromSolution sol + FindOffendingPrintfUsage() SanityCheckNugetPackages() diff --git a/src/GWallet.Frontend.XF.Android/GWallet.Frontend.XF.Android.fsproj b/src/GWallet.Frontend.XF.Android/GWallet.Frontend.XF.Android.fsproj index e1e71b823..1b60db231 100644 --- a/src/GWallet.Frontend.XF.Android/GWallet.Frontend.XF.Android.fsproj +++ b/src/GWallet.Frontend.XF.Android/GWallet.Frontend.XF.Android.fsproj @@ -276,19 +276,19 @@ ..\..\packages\HtmlAgilityPack.1.11.24\lib\netstandard2.0\HtmlAgilityPack.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.Client.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.Client.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.IpcClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.IpcClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.HttpClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.HttpClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.TcpClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.TcpClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.WebSocketClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.WebSocketClient.dll ..\..\packages\Microsoft.Extensions.Logging.Abstractions.1.0.2\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll @@ -333,7 +333,7 @@ ..\..\packages\Nethereum.0.95.0--date20210125-0551.git-05a29e9\lib\netstandard2.0\Nethereum.Web3.dll - ..\..\packages\Newtonsoft.Json.11.0.2\lib\netstandard2.0\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.13.0.2\lib\netstandard2.0\Newtonsoft.Json.dll ..\..\packages\SharpRaven.2.4.0\lib\netstandard2.0\SharpRaven.dll diff --git a/src/GWallet.Frontend.XF.Android/packages.config b/src/GWallet.Frontend.XF.Android/packages.config index 94dd1271d..87848d06f 100644 --- a/src/GWallet.Frontend.XF.Android/packages.config +++ b/src/GWallet.Frontend.XF.Android/packages.config @@ -7,7 +7,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/src/GWallet.Frontend.XF.Gtk/GWallet.Frontend.XF.Gtk.fsproj b/src/GWallet.Frontend.XF.Gtk/GWallet.Frontend.XF.Gtk.fsproj index 4cbbceac4..ce3686c54 100644 --- a/src/GWallet.Frontend.XF.Gtk/GWallet.Frontend.XF.Gtk.fsproj +++ b/src/GWallet.Frontend.XF.Gtk/GWallet.Frontend.XF.Gtk.fsproj @@ -67,7 +67,7 @@ ..\..\packages\Portable.BouncyCastle.1.8.5.2\lib\net40\BouncyCastle.Crypto.dll - ..\..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll ..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll @@ -146,19 +146,19 @@ ..\..\packages\System.Net.WebSockets.Client.4.3.2\lib\net46\System.Net.WebSockets.Client.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.Client.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.Client.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.IpcClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.IpcClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.HttpClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.HttpClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.TcpClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.TcpClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.WebSocketClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.WebSocketClient.dll ..\..\packages\Nethereum.0.95.0--date20210125-0551.git-05a29e9\lib\netstandard2.0\Nethereum.ABI.dll diff --git a/src/GWallet.Frontend.XF.Gtk/packages.config b/src/GWallet.Frontend.XF.Gtk/packages.config index 8ca40d5d6..a96baa6b8 100644 --- a/src/GWallet.Frontend.XF.Gtk/packages.config +++ b/src/GWallet.Frontend.XF.Gtk/packages.config @@ -7,13 +7,13 @@ - + - + diff --git a/src/GWallet.Frontend.XF.Mac/GWallet.Frontend.XF.Mac.fsproj b/src/GWallet.Frontend.XF.Mac/GWallet.Frontend.XF.Mac.fsproj index 1ffb1a64c..31032e2a0 100644 --- a/src/GWallet.Frontend.XF.Mac/GWallet.Frontend.XF.Mac.fsproj +++ b/src/GWallet.Frontend.XF.Mac/GWallet.Frontend.XF.Mac.fsproj @@ -63,7 +63,7 @@ ..\..\packages\Zlib.Portable.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll - ..\..\packages\Newtonsoft.Json.11.0.2\lib\netstandard2.0\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.13.0.2\lib\netstandard2.0\Newtonsoft.Json.dll ..\..\packages\Portable.BouncyCastle.1.8.5.2\lib\netstandard2.0\BouncyCastle.Crypto.dll @@ -121,19 +121,19 @@ ..\..\packages\Microsoft.Extensions.Logging.Abstractions.1.0.2\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.Client.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.Client.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.IpcClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.IpcClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.HttpClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.HttpClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.TcpClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.TcpClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.WebSocketClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.WebSocketClient.dll ..\..\packages\Nethereum.0.95.0--date20210125-0551.git-05a29e9\lib\netstandard2.0\Nethereum.ABI.dll diff --git a/src/GWallet.Frontend.XF.Mac/packages.config b/src/GWallet.Frontend.XF.Mac/packages.config index 8a4523607..51a86c052 100644 --- a/src/GWallet.Frontend.XF.Mac/packages.config +++ b/src/GWallet.Frontend.XF.Mac/packages.config @@ -6,7 +6,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/src/GWallet.Frontend.XF.iOS/GWallet.Frontend.XF.iOS.fsproj b/src/GWallet.Frontend.XF.iOS/GWallet.Frontend.XF.iOS.fsproj index b2124da90..3d8017712 100644 --- a/src/GWallet.Frontend.XF.iOS/GWallet.Frontend.XF.iOS.fsproj +++ b/src/GWallet.Frontend.XF.iOS/GWallet.Frontend.XF.iOS.fsproj @@ -178,7 +178,7 @@ ..\..\packages\Common.Logging.Core.3.4.1\lib\netstandard1.0\Common.Logging.Core.dll - ..\..\packages\Newtonsoft.Json.11.0.2\lib\netstandard2.0\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.13.0.2\lib\netstandard2.0\Newtonsoft.Json.dll ..\..\packages\Portable.BouncyCastle.1.8.5.2\lib\netstandard2.0\BouncyCastle.Crypto.dll @@ -230,19 +230,19 @@ ..\..\packages\Microsoft.Extensions.Logging.Abstractions.1.0.2\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.Client.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.Client.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.IpcClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.IpcClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.HttpClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.HttpClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.TcpClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.TcpClient.dll - ..\..\packages\JsonRpcSharp.0.94.0--date20201018-1119.git-05d4006\lib\netstandard2.0\JsonRpcSharp.WebSocketClient.dll + ..\..\packages\JsonRpcSharp.0.98.0--date20230731-1252.git-6788e32\lib\netstandard2.0\JsonRpcSharp.WebSocketClient.dll ..\..\packages\Nethereum.0.95.0--date20210125-0551.git-05a29e9\lib\netstandard2.0\Nethereum.ABI.dll diff --git a/src/GWallet.Frontend.XF.iOS/packages.config b/src/GWallet.Frontend.XF.iOS/packages.config index 94471b643..a8e21708f 100644 --- a/src/GWallet.Frontend.XF.iOS/packages.config +++ b/src/GWallet.Frontend.XF.iOS/packages.config @@ -6,7 +6,7 @@ - + @@ -15,7 +15,7 @@ - +