From c5095e00562e2a172a262de7d8def8495e78a78b Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Sun, 13 Aug 2023 10:50:58 +0800 Subject: [PATCH 01/12] build: remove Nuget.Restore.targets This was kzu's project[1] which had a very interesting goal: make nuget restore be part of the build process itself (kind of like a PreBuild target so that your IDE did the restore before building, regardless if the IDE had nuget support or not). Now, there's several reasons to remove it (ordered by level of importance): 1. We're moving soon to dotnet v6 and newer, where a restore is always assumed by the IDEs and command-line builds (the command is even called "dotnet restore" itself, no need to specify "nuget" anymore, as the term 'restore' has become part of the dotnet jargon already). 2. Looking back, I introduced it in 2017 [2] but I kinda regret doing it because of all the hacks (such as needing to generate the special file 'before.$solutionFileName.targets before the build) required to make it work, the ugliness of its code (not really blaming the author here, maybe MSBuild's XML syntax is generally unreadable), and: 3. The fact that despite the use of it, there were certain sccenarios that needed an explicit restore of other solutions or projects to make the build work with Xamarin.Forms. So as there were explicit restores happening in make.fsx anyway, let's make nuget restore explicitly handled now in all cases by make.fsx (this quirk will not live very long anyway, just as long as the Xamarin.Forms frontend lives, which is getting replaced by MAUI soon). This commit also disables nuget restore parallel processing to prevent flaky nuget restore on mono. [1] https://github.com/kzu/Nuget.Restore [2] 9804b653a63266c8560c7e8143f9ec644f05a334 --- .gitignore | 3 - NuGet.Restore.targets | 170 ------------------------------------------ scripts/configure.fsx | 13 +--- scripts/make.fsx | 64 ++++++++++------ 4 files changed, 41 insertions(+), 209 deletions(-) delete mode 100644 NuGet.Restore.targets diff --git a/.gitignore b/.gitignore index f1d54e208..8c6982c30 100644 --- a/.gitignore +++ b/.gitignore @@ -22,9 +22,6 @@ TestResult.xml # backup files of some editors such as nano *~ -# autogenerated file by configure.sh -before.gwallet.core-legacy.sln.targets - # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 diff --git a/NuGet.Restore.targets b/NuGet.Restore.targets deleted file mode 100644 index f6755a9c2..000000000 --- a/NuGet.Restore.targets +++ /dev/null @@ -1,170 +0,0 @@ - - - - $(MSBuildThisFileDirectory).nuget - https://dist.nuget.org/win-x86-commandline/v5.4.0/nuget.exe - $(NuGetPath)\nuget.exe - mono - $(TMPDIR) - - https://raw.githubusercontent.com/kzu/NuGet.Restore/master/ - $(BaseUrl)curl.exe - -k -f -L - "$(TEMP)\curl.exe" $(CurlArgs) - curl $(CurlArgs) - %WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe - - - ErrorAndStop - - quiet - normal - $(MSBuildThisFilename)$(MSBuildThisFileExtension) - - - - - - - - - - Restore - -verbosity $(RestoreLoggingVerbosity) - - - - - - - - - - - - - $([System.IO.Path]::GetDirectoryName('$(SolutionPath)')) - - - - <_NuGet>$(NuGet) - <_RestoreDir>$(RestoreDir) - <_RestoreDir Condition="'$(_RestoreDir)' == ''">%(RestoreSolution.RootDir)%(RestoreSolution.Directory) - - <_NuGet Condition=" '$(RestoreDir)' != ''">$(_NuGet.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - - - - - - - - - - - - - - - - - <_RestoreSolution Condition=" '$(OS)' != 'Unix' And '$(_RestoreDir)' != ''">$(_RestoreSolution.Replace('$(_RestoreDir)', '').TrimStart('/').TrimStart('\')) - <_RestoreOutput Condition=" '$(OS)' != 'Unix' And '$(_RestoreOutput)' != '' And '$(_RestoreDir)' != ''">$(_RestoreOutput.Replace('$(_RestoreDir)', '').TrimStart('/').TrimStart('\')) - - <_RestoreCommand Condition=" '$(_RestoreCommand)' == '' ">Restore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @(ETag) - $(ETag.Substring(5).Trim().TrimStart('"').TrimEnd('"')) - - <Namespace Prefix='msb' Uri='http://schemas.microsoft.com/developer/msbuild/2003'/> - $(MSBuildThisFileFullPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - 1D1D4F4E2A49280 - - - diff --git a/scripts/configure.fsx b/scripts/configure.fsx index 97bf385a9..33a0e4e68 100644 --- a/scripts/configure.fsx +++ b/scripts/configure.fsx @@ -51,7 +51,7 @@ let initialConfigFile, buildTool, areGtkLibsAbsentOrDoesNotApply = Process.ConfigCommandCheck ["mono"] true true |> ignore Process.ConfigCommandCheck ["fsharpc"] true true |> ignore - // needed by NuGet.Restore.targets & the "update-servers" Makefile target + // needed by the "update-servers" Makefile target? Process.ConfigCommandCheck ["curl"] true true |> ignore @@ -123,17 +123,6 @@ let initialConfigFile, buildTool, areGtkLibsAbsentOrDoesNotApply = // (it can be retrieved with `let monoVersion = Map.tryFind "MonoPkgConfigVersion" buildConfigContents`) Map.empty.Add("MonoPkgConfigVersion", monoVersion), buildTool, areGtkLibsAbsentOrDoesNotApply -#if LEGACY_FRAMEWORK -let targetsFileToExecuteNugetBeforeBuild = """ - - - -""" -File.WriteAllText(Path.Combine(rootDir.FullName, "before.gwallet.core-legacy.sln.targets"), - targetsFileToExecuteNugetBeforeBuild) -#endif - let prefix = DirectoryInfo(Misc.GatherOrGetDefaultPrefix(Misc.FsxOnlyArguments(), false, None)) if not (prefix.Exists) then diff --git a/scripts/make.fsx b/scripts/make.fsx index 96d5579e1..307607d98 100644 --- a/scripts/make.fsx +++ b/scripts/make.fsx @@ -33,7 +33,12 @@ open GWallet.Scripting let UNIX_NAME = "geewallet" let CONSOLE_FRONTEND = "GWallet.Frontend.Console" let GTK_FRONTEND = "GWallet.Frontend.XF.Gtk" -let DEFAULT_SOLUTION_FILE = "gwallet.core.sln" +let DEFAULT_SOLUTION_FILE = +#if !LEGACY_FRAMEWORK + "gwallet.core.sln" +#else + "gwallet.core-legacy.sln" +#endif let LINUX_SOLUTION_FILE = "gwallet.linux-legacy.sln" let MAC_SOLUTION_FILE = "gwallet.mac-legacy.sln" let BACKEND = "GWallet.Backend" @@ -126,6 +131,21 @@ exec mono "$FRONTEND_PATH" "$@" """ #if LEGACY_FRAMEWORK +let NugetRestore projectOrSolutionRelativePath = + let nugetArgs = + sprintf + "restore %s -DisableParallelProcessing -SolutionDirectory ." + projectOrSolutionRelativePath + let proc = + Network.RunNugetCommand + FsxHelper.NugetExe + nugetArgs + Echo.All + false + match proc.Result with + | Error _ -> failwith "NuGet Restore failed ^" + | _ -> () + let PrintNugetVersion () = if not (FsxHelper.NugetExe.Exists) then false @@ -157,6 +177,10 @@ let BuildSolution (maybeConstant: Option) (extraOptions: string) = +#if LEGACY_FRAMEWORK + NugetRestore solutionFileName +#endif + let buildTool,buildArg = buildToolAndBuildArg let configOption = @@ -225,8 +249,8 @@ let BuildSolution let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = let maybeBuildTool = Map.tryFind "BuildTool" buildConfigContents - let mainSolution = DEFAULT_SOLUTION_FILE - let buildTool,buildArg,solutionFileName = + let solutionFileName = DEFAULT_SOLUTION_FILE + let buildTool,buildArg = match maybeBuildTool with | None -> failwith "A BuildTool should have been chosen by the configure script, please report this bug" @@ -234,7 +258,7 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = #if LEGACY_FRAMEWORK failwith "'dotnet' shouldn't be the build tool when using legacy framework, please report this bug" #endif - "dotnet", "build", mainSolution + "dotnet", "build" | Some otherBuildTool -> #if LEGACY_FRAMEWORK let nugetConfig = @@ -249,9 +273,9 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = |> FileInfo File.Copy(legacyNugetConfig.FullName, nugetConfig.FullName, true) - otherBuildTool, String.Empty, "gwallet.core-legacy.sln" + otherBuildTool, String.Empty #else - otherBuildTool, String.Empty, mainSolution + otherBuildTool, String.Empty #endif Console.WriteLine (sprintf "Building in %s mode..." (binaryConfig.ToString())) @@ -267,22 +291,6 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = // older mono versions (which only have xbuild, not msbuild) can't compile .NET Standard assemblies if buildTool = "msbuild" then -#if LEGACY_FRAMEWORK - // 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: report this bug - let ExplicitRestore projectOrSolutionRelativePath = - let nugetWorkaroundArgs = - sprintf - "restore %s -SolutionDirectory ." - projectOrSolutionRelativePath - Network.RunNugetCommand - FsxHelper.NugetExe - nugetWorkaroundArgs - Echo.All - true - |> ignore -#endif - let MSBuildRestoreAndBuild solutionFile = BuildSolution ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "-target:Restore" BuildSolution ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "-target:Build" @@ -294,7 +302,9 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = if binaryConfig = BinaryConfig.Debug then let solution = MAC_SOLUTION_FILE #if LEGACY_FRAMEWORK - ExplicitRestore solution + // 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 #endif MSBuildRestoreAndBuild solution @@ -303,7 +313,9 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = if FsxHelper.AreGtkLibsPresent Echo.All then let solution = LINUX_SOLUTION_FILE #if LEGACY_FRAMEWORK - ExplicitRestore solution + // 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 #endif MSBuildRestoreAndBuild solution @@ -368,6 +380,10 @@ let GetPathToBackend () = Path.Combine (FsxHelper.RootDir.FullName, "src", BACKEND) let MakeAll (maybeConstant: Option) = +#if LEGACY_FRAMEWORK + if not FsxHelper.NugetExe.Exists then + Network.DownloadNugetExe FsxHelper.NugetExe +#endif let buildConfig = BinaryConfig.Debug let frontend,_ = JustBuild buildConfig maybeConstant frontend,buildConfig From d504f7358133aa91e4968a0886a6f8dfa456c1fd Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Sun, 13 Aug 2023 11:13:35 +0800 Subject: [PATCH 02/12] Rename main solution from gwallet to geewallet We renamed the project long time ago so it is about time to follow suit with the solution file name. --- gwallet.sln => geewallet.sln | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gwallet.sln => geewallet.sln (100%) diff --git a/gwallet.sln b/geewallet.sln similarity index 100% rename from gwallet.sln rename to geewallet.sln From 03db5e58ffe37f421ef9ac15ee5dbb62322cfd68 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Sun, 13 Aug 2023 13:50:33 +0800 Subject: [PATCH 03/12] Move non-main solutions to src/ subdir This way they don't get confused with the main solution (and still can be used by make.fsx to build with the command line). --- scripts/make.fsx | 28 +++++++--- gwallet-legacy.sln => src/gwallet-legacy.sln | 56 +++++++++---------- .../gwallet.core-legacy.sln | 20 +++---- gwallet.core.sln => src/gwallet.core.sln | 20 +++---- .../gwallet.linux-legacy.sln | 22 ++++---- .../gwallet.mac-legacy.sln | 24 ++++---- 6 files changed, 91 insertions(+), 79 deletions(-) rename gwallet-legacy.sln => src/gwallet-legacy.sln (91%) rename gwallet.core-legacy.sln => src/gwallet.core-legacy.sln (78%) rename gwallet.core.sln => src/gwallet.core.sln (79%) rename gwallet.linux-legacy.sln => src/gwallet.linux-legacy.sln (74%) rename gwallet.mac-legacy.sln => src/gwallet.mac-legacy.sln (88%) diff --git a/scripts/make.fsx b/scripts/make.fsx index 307607d98..e45ac1d1b 100644 --- a/scripts/make.fsx +++ b/scripts/make.fsx @@ -33,14 +33,26 @@ open GWallet.Scripting let UNIX_NAME = "geewallet" let CONSOLE_FRONTEND = "GWallet.Frontend.Console" let GTK_FRONTEND = "GWallet.Frontend.XF.Gtk" -let DEFAULT_SOLUTION_FILE = + +type SolutionFile = + | Default + | Linux + | Mac + +let GetSolution (solType: SolutionFile) = + let solFileName = + match solType with + | Default -> #if !LEGACY_FRAMEWORK - "gwallet.core.sln" + "gwallet.core.sln" #else - "gwallet.core-legacy.sln" + "gwallet.core-legacy.sln" #endif -let LINUX_SOLUTION_FILE = "gwallet.linux-legacy.sln" -let MAC_SOLUTION_FILE = "gwallet.mac-legacy.sln" + | Linux -> "gwallet.linux-legacy.sln" + | Mac -> "gwallet.mac-legacy.sln" + + Path.Combine("src", solFileName) + let BACKEND = "GWallet.Backend" type Frontend = @@ -249,7 +261,7 @@ let BuildSolution let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = let maybeBuildTool = Map.tryFind "BuildTool" buildConfigContents - let solutionFileName = DEFAULT_SOLUTION_FILE + let solutionFileName = GetSolution SolutionFile.Default let buildTool,buildArg = match maybeBuildTool with | None -> @@ -300,7 +312,7 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = //this is because building in release requires code signing keys if binaryConfig = BinaryConfig.Debug then - let solution = MAC_SOLUTION_FILE + let solution = GetSolution SolutionFile.Mac #if LEGACY_FRAMEWORK // 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) @@ -311,7 +323,7 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = Frontend.Console | Misc.Platform.Linux -> if FsxHelper.AreGtkLibsPresent Echo.All then - let solution = LINUX_SOLUTION_FILE + let solution = GetSolution SolutionFile.Linux #if LEGACY_FRAMEWORK // 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) diff --git a/gwallet-legacy.sln b/src/gwallet-legacy.sln similarity index 91% rename from gwallet-legacy.sln rename to src/gwallet-legacy.sln index 9a069b97d..b9df61420 100644 --- a/gwallet-legacy.sln +++ b/src/gwallet-legacy.sln @@ -2,33 +2,33 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27130.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Legacy", "src\GWallet.Backend\GWallet.Backend-legacy.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Legacy", "GWallet.Backend\GWallet.Backend-legacy.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "src\GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.Console", "src\GWallet.Frontend.Console\GWallet.Frontend.Console-legacy.fsproj", "{8413EEF5-69F5-499F-AE01-754E9541EF90}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.Console", "GWallet.Frontend.Console\GWallet.Frontend.Console-legacy.fsproj", "{8413EEF5-69F5-499F-AE01-754E9541EF90}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{9DFD61F8-2CED-47F1-BB3A-48A383D4751D}" ProjectSection(SolutionItems) = preProject - configure.sh = configure.sh - Makefile = Makefile - scripts\configure.fsx = scripts\configure.fsx - scripts\make.fsx = scripts\make.fsx - scripts\make.sh = scripts\make.sh - scripts\bump.fsx = scripts\bump.fsx - scripts\sanitycheck.fsx = scripts\sanitycheck.fsx - scripts\fsxHelper.fs = scripts\fsxHelper.fs - scripts\snap_release.fsx = scripts\snap_release.fsx - scripts\githubActions.fs = scripts\githubActions.fs - scripts\find.fsx = scripts\find.fsx - scripts\bump.fsx = scripts\bump.fsx + configure.sh = ..\configure.sh + Makefile = ..\Makefile + scripts\configure.fsx = ..\scripts\configure.fsx + scripts\make.fsx = ..\scripts\make.fsx + scripts\make.sh = ..\scripts\make.sh + scripts\bump.fsx = ..\scripts\bump.fsx + scripts\sanitycheck.fsx = ..\scripts\sanitycheck.fsx + scripts\fsxHelper.fs = ..\scripts\fsxHelper.fs + scripts\snap_release.fsx = ..\scripts\snap_release.fsx + scripts\githubActions.fs = ..\scripts\githubActions.fs + scripts\find.fsx = ..\scripts\find.fsx + scripts\bump.fsx = ..\scripts\bump.fsx EndProjectSection EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GWallet.Backend", "src\GWallet.Backend\GWallet.Backend.fsproj", "{D1D192E0-F226-40AD-8D81-687F7E6F7DAB}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GWallet.Backend", "GWallet.Backend\GWallet.Backend.fsproj", "{D1D192E0-F226-40AD-8D81-687F7E6F7DAB}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Mac", "src\GWallet.Frontend.XF.Mac\GWallet.Frontend.XF.Mac.fsproj", "{9E020D62-9160-49AC-A9CD-476CADAE0B87}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Mac", "GWallet.Frontend.XF.Mac\GWallet.Frontend.XF.Mac.fsproj", "{9E020D62-9160-49AC-A9CD-476CADAE0B87}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GWallet.Frontend.XF.UWP", "src\GWallet.Frontend.XF.UWP\GWallet.Frontend.XF.UWP.csproj", "{DD7B4A7D-02E7-4DF7-9894-25743BDEC0C0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GWallet.Frontend.XF.UWP", "GWallet.Frontend.XF.UWP\GWallet.Frontend.XF.UWP.csproj", "{DD7B4A7D-02E7-4DF7-9894-25743BDEC0C0}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{C90A30F5-1423-44B2-A8D4-ED5FEDD4E36F}" ProjectSection(SolutionItems) = preProject @@ -36,22 +36,22 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{C90A30F5-1 ReadMe.md = ReadMe.md EndProjectSection EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Gtk", "src\GWallet.Frontend.XF.Gtk\GWallet.Frontend.XF.Gtk.fsproj", "{578E4F5E-A33D-4C04-BD6C-22B48B789F36}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Gtk", "GWallet.Frontend.XF.Gtk\GWallet.Frontend.XF.Gtk.fsproj", "{578E4F5E-A33D-4C04-BD6C-22B48B789F36}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Android", "src\GWallet.Frontend.XF.Android\GWallet.Frontend.XF.Android.fsproj", "{24B7E0C6-9113-4430-8614-6E3AED7FE0C0}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Android", "GWallet.Frontend.XF.Android\GWallet.Frontend.XF.Android.fsproj", "{24B7E0C6-9113-4430-8614-6E3AED7FE0C0}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GWallet.Frontend.XF", "src\GWallet.Frontend.XF\GWallet.Frontend.XF.fsproj", "{85236682-6463-4209-B66C-E0643EF12B46}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GWallet.Frontend.XF", "GWallet.Frontend.XF\GWallet.Frontend.XF.fsproj", "{85236682-6463-4209-B66C-E0643EF12B46}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.iOS", "src\GWallet.Frontend.XF.iOS\GWallet.Frontend.XF.iOS.fsproj", "{5DD656CE-3319-46BB-B47F-BBED8CC722FD}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.iOS", "GWallet.Frontend.XF.iOS\GWallet.Frontend.XF.iOS.fsproj", "{5DD656CE-3319-46BB-B47F-BBED8CC722FD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fsdk", "Fsdk", "{6EE07541-91A1-42C2-A21F-2809BBDC2F50}" ProjectSection(SolutionItems) = preProject - scripts\fsx\Fsdk\Misc.fs = scripts\fsx\InfraLib\Misc.fs - scripts\fsx\Fsdk\Unix.fs = scripts\fsx\InfraLib\Unix.fs - scripts\fsx\Fsdk\Taiga.fs = scripts\fsx\InfraLib\Taiga.fs - scripts\fsx\Fsdk\Process.fs = scripts\fsx\InfraLib\Process.fs - scripts\fsx\Fsdk\Network.fs = scripts\fsx\InfraLib\Network.fs - scripts\fsx\Fsdk\Git.fs = scripts\fsx\InfraLib\Git.fs + scripts\fsx\Fsdk\Misc.fs = ..\scripts\fsx\InfraLib\Misc.fs + scripts\fsx\Fsdk\Unix.fs = ..\scripts\fsx\InfraLib\Unix.fs + scripts\fsx\Fsdk\Taiga.fs = ..\scripts\fsx\InfraLib\Taiga.fs + scripts\fsx\Fsdk\Process.fs = ..\scripts\fsx\InfraLib\Process.fs + scripts\fsx\Fsdk\Network.fs = ..\scripts\fsx\InfraLib\Network.fs + scripts\fsx\Fsdk\Git.fs = ..\scripts\fsx\InfraLib\Git.fs EndProjectSection EndProject Global diff --git a/gwallet.core-legacy.sln b/src/gwallet.core-legacy.sln similarity index 78% rename from gwallet.core-legacy.sln rename to src/gwallet.core-legacy.sln index 727ee6368..5c2e38665 100644 --- a/gwallet.core-legacy.sln +++ b/src/gwallet.core-legacy.sln @@ -3,21 +3,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend", "src\GWallet.Backend\GWallet.Backend-legacy.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend", "GWallet.Backend\GWallet.Backend-legacy.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.Console", "src\GWallet.Frontend.Console\GWallet.Frontend.Console-legacy.fsproj", "{8413EEF5-69F5-499F-AE01-754E9541EF90}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.Console", "GWallet.Frontend.Console\GWallet.Frontend.Console-legacy.fsproj", "{8413EEF5-69F5-499F-AE01-754E9541EF90}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "src\GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CE79AB9D-0FB9-4606-B7C6-A78C0858CC54}" ProjectSection(SolutionItems) = preProject - configure.fsx = configure.fsx - configure.sh = configure.sh - fsicheck.sh = fsicheck.sh - Infra.fs = Infra.fs - make.fsx = make.fsx - make.sh = make.sh - Makefile = Makefile + configure.fsx = ..\configure.fsx + configure.sh = ..\configure.sh + fsicheck.sh = ..\fsicheck.sh + Infra.fs = ..\Infra.fs + make.fsx = ..\make.fsx + make.sh = ..\make.sh + Makefile = ..\Makefile EndProjectSection EndProject Global diff --git a/gwallet.core.sln b/src/gwallet.core.sln similarity index 79% rename from gwallet.core.sln rename to src/gwallet.core.sln index 60cd41057..f8fb7e2b4 100644 --- a/gwallet.core.sln +++ b/src/gwallet.core.sln @@ -3,21 +3,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend", "src\GWallet.Backend\GWallet.Backend.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend", "GWallet.Backend\GWallet.Backend.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.Console", "src\GWallet.Frontend.Console\GWallet.Frontend.Console.fsproj", "{8413EEF5-69F5-499F-AE01-754E9541EF90}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.Console", "GWallet.Frontend.Console\GWallet.Frontend.Console.fsproj", "{8413EEF5-69F5-499F-AE01-754E9541EF90}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "src\GWallet.Backend.Tests\GWallet.Backend.Tests.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "GWallet.Backend.Tests\GWallet.Backend.Tests.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CE79AB9D-0FB9-4606-B7C6-A78C0858CC54}" ProjectSection(SolutionItems) = preProject - configure.fsx = configure.fsx - configure.sh = configure.sh - fsicheck.sh = fsicheck.sh - Infra.fs = Infra.fs - make.fsx = make.fsx - make.sh = make.sh - Makefile = Makefile + configure.fsx = ..\configure.fsx + configure.sh = ..\configure.sh + fsicheck.sh = ..\fsicheck.sh + Infra.fs = ..\Infra.fs + make.fsx = ..\make.fsx + make.sh = ..\make.sh + Makefile = ..\Makefile EndProjectSection EndProject Global diff --git a/gwallet.linux-legacy.sln b/src/gwallet.linux-legacy.sln similarity index 74% rename from gwallet.linux-legacy.sln rename to src/gwallet.linux-legacy.sln index 59437a551..038e6104b 100644 --- a/gwallet.linux-legacy.sln +++ b/src/gwallet.linux-legacy.sln @@ -1,25 +1,25 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend", "src\GWallet.Backend\GWallet.Backend.fsproj", "{949A9225-A1BE-4EDA-A1DA-04AC131CFE9B}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend", "GWallet.Backend\GWallet.Backend.fsproj", "{949A9225-A1BE-4EDA-A1DA-04AC131CFE9B}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF", "src\GWallet.Frontend.XF\GWallet.Frontend.XF.fsproj", "{2C7A1A49-CAD1-4961-866A-D32868AE7D18}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF", "GWallet.Frontend.XF\GWallet.Frontend.XF.fsproj", "{2C7A1A49-CAD1-4961-866A-D32868AE7D18}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Gtk", "src\GWallet.Frontend.XF.Gtk\GWallet.Frontend.XF.Gtk.fsproj", "{578E4F5E-A33D-4C04-BD6C-22B48B789F36}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Gtk", "GWallet.Frontend.XF.Gtk\GWallet.Frontend.XF.Gtk.fsproj", "{578E4F5E-A33D-4C04-BD6C-22B48B789F36}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{3703CCD5-CB28-45FE-8FD5-BBE5DFF62706}" ProjectSection(SolutionItems) = preProject - scripts\configure.fsx = scripts\configure.fsx - scripts\fsicheck.sh = scripts\fsicheck.sh - scripts\Infra.fs = scripts\Infra.fs - scripts\make.fsx = scripts\make.fsx - scripts\make.sh = scripts\make.sh - scripts\replace.fsx = scripts\replace.fsx + scripts\configure.fsx = ..\scripts\configure.fsx + scripts\fsicheck.sh = ..\scripts\fsicheck.sh + scripts\Infra.fs = ..\scripts\Infra.fs + scripts\make.fsx = ..\scripts\make.fsx + scripts\make.sh = ..\scripts\make.sh + scripts\replace.fsx = ..\scripts\replace.fsx EndProjectSection EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Legacy`", "src\GWallet.Backend\GWallet.Backend-legacy.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Legacy`", "GWallet.Backend\GWallet.Backend-legacy.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "src\GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/gwallet.mac-legacy.sln b/src/gwallet.mac-legacy.sln similarity index 88% rename from gwallet.mac-legacy.sln rename to src/gwallet.mac-legacy.sln index d278dba9e..b86c20da6 100644 --- a/gwallet.mac-legacy.sln +++ b/src/gwallet.mac-legacy.sln @@ -1,27 +1,27 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend", "src\GWallet.Backend\GWallet.Backend.fsproj", "{949A9225-A1BE-4EDA-A1DA-04AC131CFE9B}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend", "GWallet.Backend\GWallet.Backend.fsproj", "{949A9225-A1BE-4EDA-A1DA-04AC131CFE9B}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF", "src\GWallet.Frontend.XF\GWallet.Frontend.XF.fsproj", "{2C7A1A49-CAD1-4961-866A-D32868AE7D18}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF", "GWallet.Frontend.XF\GWallet.Frontend.XF.fsproj", "{2C7A1A49-CAD1-4961-866A-D32868AE7D18}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{3703CCD5-CB28-45FE-8FD5-BBE5DFF62706}" ProjectSection(SolutionItems) = preProject - scripts\configure.fsx = scripts\configure.fsx - scripts\fsicheck.sh = scripts\fsicheck.sh - scripts\Infra.fs = scripts\Infra.fs - scripts\make.fsx = scripts\make.fsx - scripts\make.sh = scripts\make.sh - scripts\replace.fsx = scripts\replace.fsx + scripts\configure.fsx = ..\scripts\configure.fsx + scripts\fsicheck.sh = ..\scripts\fsicheck.sh + scripts\Infra.fs = ..\scripts\Infra.fs + scripts\make.fsx = ..\scripts\make.fsx + scripts\make.sh = ..\scripts\make.sh + scripts\replace.fsx = ..\scripts\replace.fsx EndProjectSection EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.iOS", "src\GWallet.Frontend.XF.iOS\GWallet.Frontend.XF.iOS.fsproj", "{5DD656CE-3319-46BB-B47F-BBED8CC722FD}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.iOS", "GWallet.Frontend.XF.iOS\GWallet.Frontend.XF.iOS.fsproj", "{5DD656CE-3319-46BB-B47F-BBED8CC722FD}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Android", "src\GWallet.Frontend.XF.Android\GWallet.Frontend.XF.Android.fsproj", "{24B7E0C6-9113-4430-8614-6E3AED7FE0C0}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Android", "GWallet.Frontend.XF.Android\GWallet.Frontend.XF.Android.fsproj", "{24B7E0C6-9113-4430-8614-6E3AED7FE0C0}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Legacy", "src\GWallet.Backend\GWallet.Backend-legacy.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Legacy", "GWallet.Backend\GWallet.Backend-legacy.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "src\GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From a671a9c5c3cf6221752e7737d62475af71011f60 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 15 Aug 2023 13:15:40 +0800 Subject: [PATCH 04/12] *.sln: update Updating links to scripts and Fsdk in main solution, and deleting them on the others (since the others will only be used for building now, not for using in the IDE). --- geewallet.sln | 13 ++++++------- src/gwallet-legacy.sln | 35 ----------------------------------- src/gwallet.core-legacy.sln | 13 ------------- src/gwallet.core.sln | 13 ------------- src/gwallet.linux-legacy.sln | 10 ---------- src/gwallet.mac-legacy.sln | 10 ---------- 6 files changed, 6 insertions(+), 88 deletions(-) diff --git a/geewallet.sln b/geewallet.sln index 2eef0b56c..a9cc545b1 100644 --- a/geewallet.sln +++ b/geewallet.sln @@ -42,14 +42,13 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GWallet.Frontend.XF", "src\ EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.iOS", "src\GWallet.Frontend.XF.iOS\GWallet.Frontend.XF.iOS.fsproj", "{5DD656CE-3319-46BB-B47F-BBED8CC722FD}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "InfraLib", "InfraLib", "{6EE07541-91A1-42C2-A21F-2809BBDC2F50}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fsdk", "Fsdk", "{6EE07541-91A1-42C2-A21F-2809BBDC2F50}" ProjectSection(SolutionItems) = preProject - scripts\fsx\InfraLib\Misc.fs = scripts\fsx\InfraLib\Misc.fs - scripts\fsx\InfraLib\Unix.fs = scripts\fsx\InfraLib\Unix.fs - scripts\fsx\InfraLib\Taiga.fs = scripts\fsx\InfraLib\Taiga.fs - scripts\fsx\InfraLib\Process.fs = scripts\fsx\InfraLib\Process.fs - scripts\fsx\InfraLib\Network.fs = scripts\fsx\InfraLib\Network.fs - scripts\fsx\InfraLib\Git.fs = scripts\fsx\InfraLib\Git.fs + scripts\fsx\Fsdk\Misc.fs = scripts\fsx\Fsdk\Misc.fs + scripts\fsx\Fsdk\Unix.fs = scripts\fsx\Fsdk\Unix.fs + scripts\fsx\Fsdk\Process.fs = scripts\fsx\Fsdk\Process.fs + scripts\fsx\Fsdk\Network.fs = scripts\fsx\Fsdk\Network.fs + scripts\fsx\Fsdk\Git.fs = scripts\fsx\Fsdk\Git.fs EndProjectSection EndProject Global diff --git a/src/gwallet-legacy.sln b/src/gwallet-legacy.sln index b9df61420..baf5d9147 100644 --- a/src/gwallet-legacy.sln +++ b/src/gwallet-legacy.sln @@ -8,34 +8,12 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "GW EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.Console", "GWallet.Frontend.Console\GWallet.Frontend.Console-legacy.fsproj", "{8413EEF5-69F5-499F-AE01-754E9541EF90}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{9DFD61F8-2CED-47F1-BB3A-48A383D4751D}" - ProjectSection(SolutionItems) = preProject - configure.sh = ..\configure.sh - Makefile = ..\Makefile - scripts\configure.fsx = ..\scripts\configure.fsx - scripts\make.fsx = ..\scripts\make.fsx - scripts\make.sh = ..\scripts\make.sh - scripts\bump.fsx = ..\scripts\bump.fsx - scripts\sanitycheck.fsx = ..\scripts\sanitycheck.fsx - scripts\fsxHelper.fs = ..\scripts\fsxHelper.fs - scripts\snap_release.fsx = ..\scripts\snap_release.fsx - scripts\githubActions.fs = ..\scripts\githubActions.fs - scripts\find.fsx = ..\scripts\find.fsx - scripts\bump.fsx = ..\scripts\bump.fsx - EndProjectSection -EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GWallet.Backend", "GWallet.Backend\GWallet.Backend.fsproj", "{D1D192E0-F226-40AD-8D81-687F7E6F7DAB}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Mac", "GWallet.Frontend.XF.Mac\GWallet.Frontend.XF.Mac.fsproj", "{9E020D62-9160-49AC-A9CD-476CADAE0B87}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GWallet.Frontend.XF.UWP", "GWallet.Frontend.XF.UWP\GWallet.Frontend.XF.UWP.csproj", "{DD7B4A7D-02E7-4DF7-9894-25743BDEC0C0}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{C90A30F5-1423-44B2-A8D4-ED5FEDD4E36F}" - ProjectSection(SolutionItems) = preProject - CONTRIBUTING.md = CONTRIBUTING.md - ReadMe.md = ReadMe.md - EndProjectSection -EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Gtk", "GWallet.Frontend.XF.Gtk\GWallet.Frontend.XF.Gtk.fsproj", "{578E4F5E-A33D-4C04-BD6C-22B48B789F36}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Android", "GWallet.Frontend.XF.Android\GWallet.Frontend.XF.Android.fsproj", "{24B7E0C6-9113-4430-8614-6E3AED7FE0C0}" @@ -44,16 +22,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GWallet.Frontend.XF", "GWal EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.iOS", "GWallet.Frontend.XF.iOS\GWallet.Frontend.XF.iOS.fsproj", "{5DD656CE-3319-46BB-B47F-BBED8CC722FD}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fsdk", "Fsdk", "{6EE07541-91A1-42C2-A21F-2809BBDC2F50}" - ProjectSection(SolutionItems) = preProject - scripts\fsx\Fsdk\Misc.fs = ..\scripts\fsx\InfraLib\Misc.fs - scripts\fsx\Fsdk\Unix.fs = ..\scripts\fsx\InfraLib\Unix.fs - scripts\fsx\Fsdk\Taiga.fs = ..\scripts\fsx\InfraLib\Taiga.fs - scripts\fsx\Fsdk\Process.fs = ..\scripts\fsx\InfraLib\Process.fs - scripts\fsx\Fsdk\Network.fs = ..\scripts\fsx\InfraLib\Network.fs - scripts\fsx\Fsdk\Git.fs = ..\scripts\fsx\InfraLib\Git.fs - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -308,9 +276,6 @@ Global {5DD656CE-3319-46BB-B47F-BBED8CC722FD}.Release|x86.ActiveCfg = Release|iPhoneSimulator {5DD656CE-3319-46BB-B47F-BBED8CC722FD}.Release|x86.Build.0 = Release|iPhoneSimulator EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {6EE07541-91A1-42C2-A21F-2809BBDC2F50} = {CE79AB9D-0FB9-4606-B7C6-A78C0858CC54} - EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection diff --git a/src/gwallet.core-legacy.sln b/src/gwallet.core-legacy.sln index 5c2e38665..65787ba68 100644 --- a/src/gwallet.core-legacy.sln +++ b/src/gwallet.core-legacy.sln @@ -9,17 +9,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.Console", EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CE79AB9D-0FB9-4606-B7C6-A78C0858CC54}" - ProjectSection(SolutionItems) = preProject - configure.fsx = ..\configure.fsx - configure.sh = ..\configure.sh - fsicheck.sh = ..\fsicheck.sh - Infra.fs = ..\Infra.fs - make.fsx = ..\make.fsx - make.sh = ..\make.sh - Makefile = ..\Makefile - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,8 +28,6 @@ Global {F9448076-88BE-4045-8704-A652D133E036}.Release|Any CPU.ActiveCfg = Release|Any CPU {F9448076-88BE-4045-8704-A652D133E036}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection - GlobalSection(NestedProjects) = preSolution - EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection diff --git a/src/gwallet.core.sln b/src/gwallet.core.sln index f8fb7e2b4..49bfc8323 100644 --- a/src/gwallet.core.sln +++ b/src/gwallet.core.sln @@ -9,17 +9,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.Console", EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "GWallet.Backend.Tests\GWallet.Backend.Tests.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CE79AB9D-0FB9-4606-B7C6-A78C0858CC54}" - ProjectSection(SolutionItems) = preProject - configure.fsx = ..\configure.fsx - configure.sh = ..\configure.sh - fsicheck.sh = ..\fsicheck.sh - Infra.fs = ..\Infra.fs - make.fsx = ..\make.fsx - make.sh = ..\make.sh - Makefile = ..\Makefile - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,8 +28,6 @@ Global {F9448076-88BE-4045-8704-A652D133E036}.Release|Any CPU.ActiveCfg = Release|Any CPU {F9448076-88BE-4045-8704-A652D133E036}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection - GlobalSection(NestedProjects) = preSolution - EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection diff --git a/src/gwallet.linux-legacy.sln b/src/gwallet.linux-legacy.sln index 038e6104b..3e7a6593d 100644 --- a/src/gwallet.linux-legacy.sln +++ b/src/gwallet.linux-legacy.sln @@ -7,16 +7,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF", "GWal EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Gtk", "GWallet.Frontend.XF.Gtk\GWallet.Frontend.XF.Gtk.fsproj", "{578E4F5E-A33D-4C04-BD6C-22B48B789F36}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{3703CCD5-CB28-45FE-8FD5-BBE5DFF62706}" - ProjectSection(SolutionItems) = preProject - scripts\configure.fsx = ..\scripts\configure.fsx - scripts\fsicheck.sh = ..\scripts\fsicheck.sh - scripts\Infra.fs = ..\scripts\Infra.fs - scripts\make.fsx = ..\scripts\make.fsx - scripts\make.sh = ..\scripts\make.sh - scripts\replace.fsx = ..\scripts\replace.fsx - EndProjectSection -EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Legacy`", "GWallet.Backend\GWallet.Backend-legacy.fsproj", "{96F9B3E5-11F8-4F5F-AADC-51D0D995B3D2}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend.Tests", "GWallet.Backend.Tests\GWallet.Backend.Tests-legacy.fsproj", "{F9448076-88BE-4045-8704-A652D133E036}" diff --git a/src/gwallet.mac-legacy.sln b/src/gwallet.mac-legacy.sln index b86c20da6..3cd714e63 100644 --- a/src/gwallet.mac-legacy.sln +++ b/src/gwallet.mac-legacy.sln @@ -5,16 +5,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Backend", "GWallet. EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF", "GWallet.Frontend.XF\GWallet.Frontend.XF.fsproj", "{2C7A1A49-CAD1-4961-866A-D32868AE7D18}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{3703CCD5-CB28-45FE-8FD5-BBE5DFF62706}" - ProjectSection(SolutionItems) = preProject - scripts\configure.fsx = ..\scripts\configure.fsx - scripts\fsicheck.sh = ..\scripts\fsicheck.sh - scripts\Infra.fs = ..\scripts\Infra.fs - scripts\make.fsx = ..\scripts\make.fsx - scripts\make.sh = ..\scripts\make.sh - scripts\replace.fsx = ..\scripts\replace.fsx - EndProjectSection -EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.iOS", "GWallet.Frontend.XF.iOS\GWallet.Frontend.XF.iOS.fsproj", "{5DD656CE-3319-46BB-B47F-BBED8CC722FD}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "GWallet.Frontend.XF.Android", "GWallet.Frontend.XF.Android\GWallet.Frontend.XF.Android.fsproj", "{24B7E0C6-9113-4430-8614-6E3AED7FE0C0}" From c8c59c29beb6541c41f1d3c721999fd2353bab70 Mon Sep 17 00:00:00 2001 From: Afshin Arani Date: Mon, 21 Aug 2023 10:07:05 +0330 Subject: [PATCH 05/12] Frontend.XF.GTK: add DLL refs for project refs This allows for building Backend and Frontend.XF with separate build engine like .NET 6. --- .../GWallet.Frontend.XF.Gtk.fsproj | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 95cfb882c..4cbbceac4 100644 --- a/src/GWallet.Frontend.XF.Gtk/GWallet.Frontend.XF.Gtk.fsproj +++ b/src/GWallet.Frontend.XF.Gtk/GWallet.Frontend.XF.Gtk.fsproj @@ -224,6 +224,12 @@ ..\..\packages\Fsdk.0.6.0--date20230530-1155.git-3bb8d08\lib\netstandard2.0\Fsdk.dll + + ..\GWallet.Backend\bin\$(Configuration)\netstandard2.0\GWallet.Backend.dll + + + ..\GWallet.Frontend.XF\bin\$(Configuration)\netstandard2.0\GWallet.Frontend.XF.dll + @@ -240,11 +246,11 @@ logo.png PreserveNewest - + {85236682-6463-4209-B66C-E0643EF12B46} GWallet.Frontend.XF - + GWallet.Backend @@ -253,5 +259,5 @@ - + From 7f6c88d453cecdf5155cc40de10ece20fe089345 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 15 Aug 2023 13:20:19 +0800 Subject: [PATCH 06/12] scripts: using legacy & non-legacy tools together This commit allows for using legacy and non-legacy build tools together to build GTK frontend without using MS's binaries (newmono-msbuild). It works by building .NETStandard project (that xbuild can't build) using .NET6 and building GTK project using xbuild. Co-authored-by: Afshin Arani --- scripts/configure.fsx | 263 ++++++++++++++++++++++++------------------ scripts/fsx | 2 +- scripts/make.fsx | 66 +++++++++-- 3 files changed, 207 insertions(+), 124 deletions(-) diff --git a/scripts/configure.fsx b/scripts/configure.fsx index 33a0e4e68..73193c3d8 100644 --- a/scripts/configure.fsx +++ b/scripts/configure.fsx @@ -19,109 +19,144 @@ open Fsdk.Process open GWallet.Scripting let rootDir = DirectoryInfo(Path.Combine(__SOURCE_DIRECTORY__, "..")) +let stableVersionOfMono = Version("6.6") + +let buildTool, legacyBuildTool, areGtkLibsAbsentOrDoesNotApply = + + let dotnetCmd = Process.ConfigCommandCheck ["dotnet"] false true -let initialConfigFile, buildTool, areGtkLibsAbsentOrDoesNotApply = match Misc.GuessPlatform() with | Misc.Platform.Windows -> - let buildTool= - match Process.ConfigCommandCheck ["dotnet"] false true with - | Some _ -> "dotnet" + let msbuildCmd = + Console.Write "checking for msbuild... " + match Process.VsWhere "MSBuild\\**\\Bin\\MSBuild.exe" with | None -> - Console.Write "checking for msbuild... " - match Process.VsWhere "MSBuild\\**\\Bin\\MSBuild.exe" with - | None -> - Console.WriteLine "not found" - Console.Out.Flush() - Console.Error.WriteLine "Error, please install 'dotnet' aka .NET (6.0 or newer), and/or .NETFramework 4.x ('msbuild')" - Environment.Exit 1 - failwith "Unreachable" - | Some msbuildPath -> - Console.WriteLine "found" - msbuildPath - - Map.empty, buildTool, true + Console.WriteLine "not found" + None + | Some msbuildPath -> + Console.WriteLine "found" + Some msbuildPath + + dotnetCmd, msbuildCmd, true | platform (* Unix *) -> Process.ConfigCommandCheck ["make"] true true |> ignore - match Process.ConfigCommandCheck ["dotnet"] false true with - | Some _ -> Map.empty, "dotnet", true + // needed by the "update-servers" Makefile target? + Process.ConfigCommandCheck ["curl"] true true |> ignore + + match Process.ConfigCommandCheck ["mono"] false true with | None -> + dotnetCmd, None, true + | Some _ -> - Process.ConfigCommandCheck ["mono"] true true |> ignore - Process.ConfigCommandCheck ["fsharpc"] true true |> ignore + match Process.ConfigCommandCheck ["fsharpc"] false true with + | None -> + dotnetCmd, None, true + | Some _ -> - // needed by the "update-servers" Makefile target? - Process.ConfigCommandCheck ["curl"] true true - |> ignore + if platform = Misc.Platform.Mac then + let msBuildOrXBuild = Process.ConfigCommandCheck [ "msbuild"; "xbuild" ] false true + dotnetCmd, msBuildOrXBuild, true + else - if platform = Misc.Platform.Mac then - match Process.ConfigCommandCheck [ "msbuild"; "xbuild" ] true true with - | Some theBuildTool -> Map.empty, theBuildTool, true - | _ -> failwith "unreachable" - else - let buildTool = - // yes, msbuild tests for the existence of this file path below (a folder named xbuild, not msbuild), - // because $MSBuildExtensionsPath32 evaluates to /usr/lib/mono/xbuild (for historical reasons) - if File.Exists "/usr/lib/mono/xbuild/Microsoft/VisualStudio/v16.0/FSharp/Microsoft.FSharp.Targets" then - match Process.ConfigCommandCheck [ "msbuild"; "xbuild" ] true true with - | Some theBuildTool -> theBuildTool - | _ -> failwith "unreachable" - else - // if the above file doesn't exist, even though F# is installed (because we already checked for 'fsharpc'), - // the version installed is too old, and doesn't work with msbuild, so it's better to use xbuild - match Process.ConfigCommandCheck [ "xbuild" ] false true with - | None -> - Console.Error.WriteLine "An alternative to installing mono-xbuild is upgrading your F# installtion to v5.0" - Environment.Exit 1 - failwith "unreachable" - | Some xbuildCmd -> xbuildCmd - - let pkgConfig = "pkg-config" - Process.ConfigCommandCheck [pkgConfig] true true |> ignore - - let pkgName = "mono" - let stableVersionOfMono = Version("6.6") - Console.Write (sprintf "checking for %s v%s... " pkgName (stableVersionOfMono.ToString())) - - let pkgConfigCmd = { Command = pkgConfig - Arguments = sprintf "--modversion %s" pkgName } - let processResult = Process.Execute(pkgConfigCmd, Echo.Off) - let monoVersion = - processResult - .Unwrap("Mono was found but not detected by pkg-config?") - .Trim() - - let currentMonoVersion = Version(monoVersion) - - // NOTE: see what 1 means here: https://learn.microsoft.com/en-us/dotnet/api/system.version.compareto?view=netframework-4.7 - if 1 = stableVersionOfMono.CompareTo currentMonoVersion then - Console.WriteLine "not found" - Console.Error.WriteLine (sprintf "configure: error, package requirements not met:") - Console.Error.WriteLine (sprintf "Please upgrade %s version from %s to (at least) %s" - pkgName - (currentMonoVersion.ToString()) - (stableVersionOfMono.ToString())) - Environment.Exit 1 - Console.WriteLine "found" + let pkgConfig = "pkg-config" - let areGtkLibsAbsentOrDoesNotApply = - if buildTool <> "msbuild" then - // because xbuild cannot build .NETStandard libs (and XF needs to be one) - true - else - Console.Write "checking for GTK (libs)... " - let gtkLibsPresent = FsxHelper.AreGtkLibsPresent Echo.Off - if gtkLibsPresent then - Console.WriteLine "found" - else + match Process.ConfigCommandCheck [ pkgConfig ] false true with + | None -> dotnetCmd, None, true + | Some _ -> + + // yes, msbuild tests for the existence of this file path below (a folder named xbuild, not msbuild), + // because $MSBuildExtensionsPath32 evaluates to /usr/lib/mono/xbuild (for historical reasons) + let fsharpTargetsFileExists = + File.Exists + "/usr/lib/mono/xbuild/Microsoft/VisualStudio/v16.0/FSharp/Microsoft.FSharp.Targets" + + if not fsharpTargetsFileExists then + Console.Error.WriteLine + "WARNING: old F# version found, only xbuild can work with it (not msbuild, even if installed)" + + Console.Error.WriteLine + "NOTE: an alternative to installing 'mono-xbuild' pkg is upgrading your F# installtion to v5.0" + + let maybeXbuild = Process.ConfigCommandCheck [ "xbuild" ] false true + + let maybeMsbuild = + let msbuildCheck = Process.ConfigCommandCheck [ "msbuild" ] false true + + if fsharpTargetsFileExists then + msbuildCheck + else + None + + let pkgName = "mono" + Console.Write(sprintf "checking for %s v%s... " pkgName (stableVersionOfMono.ToString())) + + let pkgConfigCmd = + { Command = pkgConfig + Arguments = sprintf "--modversion %s" pkgName } + + let processResult = Process.Execute(pkgConfigCmd, Echo.Off) + + let monoVersion = + processResult + .Unwrap("Mono was found but not detected by pkg-config?") + .Trim() + + let currentMonoVersion = Version(monoVersion) + + // NOTE: see what 1 means here: https://learn.microsoft.com/en-us/dotnet/api/system.version.compareto?view=netframework-4.7 + if 1 = stableVersionOfMono.CompareTo currentMonoVersion then Console.WriteLine "not found" - not gtkLibsPresent + dotnetCmd, None, true + else + Console.WriteLine "found" + + let areGtkLibsAbsentOrDoesNotApply = + match dotnetCmd, maybeMsbuild, maybeXbuild with + | None, None, None -> + // well, configure.fsx will not finish in this case anyway + true + | Some _ , None, None -> + // xbuild or msbuild is needed to compile XF.Gtk project + true + | None, None, _ -> + // xbuild alone cannot build .NETStandard2.0 libs (Backend and XF are) + true + | _, _, _ -> + Console.Write "checking for GTK (libs)..." + let gtkLibsPresent = FsxHelper.AreGtkLibsPresent Echo.Off + + if gtkLibsPresent then + Console.WriteLine "found" + else + Console.WriteLine "not found" + + not gtkLibsPresent + + let legacyBuildTool = + if maybeMsbuild.IsSome then + maybeMsbuild + else + maybeXbuild + + dotnetCmd, legacyBuildTool, areGtkLibsAbsentOrDoesNotApply + +if buildTool.IsNone && legacyBuildTool.IsNone then + Console.Out.Flush() + Console.Error.WriteLine "configure: error, package requirements not met:" + + match Misc.GuessPlatform() with + | Misc.Platform.Windows -> + Console.Error.WriteLine "Please install 'dotnet' aka .NET (6.0 or newer), and/or .NETFramework 4.x ('msbuild')" + | _ -> + Console.Error.WriteLine ( + sprintf + "Please install dotnet v6 (or newer), and/or Mono (msbuild or xbuild needed) v%s (or newer)" + (stableVersionOfMono.ToString()) + ) - // NOTE: this config entry is actually not being used at the moment by make.fsx, - // but kept, like this, in case we need to use it in the future - // (it can be retrieved with `let monoVersion = Map.tryFind "MonoPkgConfigVersion" buildConfigContents`) - Map.empty.Add("MonoPkgConfigVersion", monoVersion), buildTool, areGtkLibsAbsentOrDoesNotApply + Environment.Exit 1 let prefix = DirectoryInfo(Misc.GatherOrGetDefaultPrefix(Misc.FsxOnlyArguments(), false, None)) @@ -155,13 +190,27 @@ let fsxRunner = fsxRunnerBinText buildConfigFile.Name +let configFileToBeWritten = + let initialConfigFile = Map.empty.Add("Prefix", prefix.FullName) + + let configFileStageTwo = + match legacyBuildTool with + | Some theTool -> initialConfigFile.Add("LegacyBuildTool", theTool) + | None -> initialConfigFile + + let finalConfigFile = + match buildTool with + | Some theTool -> configFileStageTwo.Add("BuildTool", theTool) + | None -> configFileStageTwo + + finalConfigFile + let lines = let toConfigFileLine (keyValuePair: System.Collections.Generic.KeyValuePair) = sprintf "%s=%s" keyValuePair.Key keyValuePair.Value - initialConfigFile.Add("Prefix", prefix.FullName) - .Add("BuildTool", buildTool) - |> Seq.map toConfigFileLine + configFileToBeWritten |> Seq.map toConfigFileLine + File.AppendAllLines(buildConfigFile.FullName, lines |> Array.ofSeq) let version = Misc.GetCurrentVersion(rootDir) @@ -169,25 +218,11 @@ let version = Misc.GetCurrentVersion(rootDir) let repoInfo = Git.GetRepoInfo() let frontend = - match buildTool, Misc.GuessPlatform() with - - // NOTE: 'dotnet build' cannot build Xamarin.Forms, and make.fsx doesn't support yet building - // with both dotnet & msbuild yet - | "dotnet", _ -> "Console" - - // because xbuild cannot build .NETStandard projects (and Frontend.XF proj needs to be) - | _, Misc.Platform.Linux -> - if areGtkLibsAbsentOrDoesNotApply then - "Console" - else - "Xamarin.Forms" - - // NOTE: even though Windows has msbuild too, its buildTool value contains full path so it won't - // match with the case below (and this is on purpose, since we don't build WinUI/UWP frontend yet) - | "msbuild", _ -> + if areGtkLibsAbsentOrDoesNotApply then + "Console" + else "Xamarin.Forms" - | _ -> "Console" Console.WriteLine() Console.WriteLine(sprintf @@ -200,9 +235,15 @@ Console.WriteLine(sprintf Console.WriteLine(sprintf "\t* F# script runner: %s" fsxRunner) -Console.WriteLine(sprintf - "\t* .NET build tool: %s" - (if buildTool = "dotnet" then "dotnet build" else buildTool)) + +match buildTool with +| Some _ -> Console.WriteLine "\t* Build tool: dotnet build" +| None -> () + +match legacyBuildTool with +| Some cmd -> Console.WriteLine(sprintf "\t* Legacy build tool: %s" cmd) +| None -> () + Console.WriteLine(sprintf "\t* Frontend: %s" frontend) diff --git a/scripts/fsx b/scripts/fsx index 2268d5059..5488853b1 160000 --- a/scripts/fsx +++ b/scripts/fsx @@ -1 +1 @@ -Subproject commit 2268d505970604f38738bda758ffac44a2a77e54 +Subproject commit 5488853b17fedb44707e8459480297b618cffad0 diff --git a/scripts/make.fsx b/scripts/make.fsx index e45ac1d1b..6f1a432b3 100644 --- a/scripts/make.fsx +++ b/scripts/make.fsx @@ -14,7 +14,7 @@ open System.Xml.Linq open System.Xml.XPath #if !LEGACY_FRAMEWORK -#r "nuget: Fsdk, Version=0.6.0--date20230812-0646.git-2268d50" +#r "nuget: Fsdk, Version=0.6.0--date20230818-1152.git-83d671b" #else #r "System.Configuration" open System.Configuration @@ -53,6 +53,18 @@ let GetSolution (solType: SolutionFile) = Path.Combine("src", solFileName) +type ProjectFile = + | XFFrontend + | GtkFrontend + +let GetProject (projFile: ProjectFile) = + let projFileName = + match projFile with + | 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 BACKEND = "GWallet.Backend" type Frontend = @@ -142,7 +154,6 @@ FRONTEND_PATH="$DIR_OF_THIS_SCRIPT/../lib/$UNIX_NAME/$GWALLET_PROJECT.exe" exec mono "$FRONTEND_PATH" "$@" """ -#if LEGACY_FRAMEWORK let NugetRestore projectOrSolutionRelativePath = let nugetArgs = sprintf @@ -180,17 +191,16 @@ let PrintNugetVersion () = Console.WriteLine() Console.Out.Flush() failwith "nuget process' output contained errors ^" -#endif -let BuildSolution +let BuildSolutionOrProject (buildToolAndBuildArg: string*string) - (solutionFileName: string) + (fileName: string) (binaryConfig: BinaryConfig) (maybeConstant: Option) (extraOptions: string) = #if LEGACY_FRAMEWORK - NugetRestore solutionFileName + NugetRestore fileName #endif let buildTool,buildArg = buildToolAndBuildArg @@ -245,7 +255,7 @@ let BuildSolution configOption let buildArgs = sprintf "%s %s %s %s" buildArg - solutionFileName + fileName configOptions extraOptions let buildProcess = Process.Execute ({ Command = buildTool; Arguments = buildArgs }, Echo.All) @@ -261,11 +271,18 @@ let BuildSolution let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = let maybeBuildTool = Map.tryFind "BuildTool" buildConfigContents + let maybeLegacyBuildTool = Map.tryFind "LegacyBuildTool" buildConfigContents + let buildToolToUse = + if maybeBuildTool.IsNone then + maybeLegacyBuildTool + else + maybeBuildTool + let solutionFileName = GetSolution SolutionFile.Default let buildTool,buildArg = - match maybeBuildTool with + match buildToolToUse with | None -> - failwith "A BuildTool should have been chosen by the configure script, please report this bug" + failwith "A BuildTool or LegacyBuildTool should have been chosen by the configure script, please report this bug" | Some "dotnet" -> #if LEGACY_FRAMEWORK failwith "'dotnet' shouldn't be the build tool when using legacy framework, please report this bug" @@ -291,7 +308,7 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = #endif Console.WriteLine (sprintf "Building in %s mode..." (binaryConfig.ToString())) - BuildSolution + BuildSolutionOrProject (buildTool, buildArg) solutionFileName binaryConfig @@ -304,8 +321,8 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = if buildTool = "msbuild" then let MSBuildRestoreAndBuild solutionFile = - BuildSolution ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "-target:Restore" - BuildSolution ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "-target:Build" + BuildSolutionOrProject ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "-target:Restore" + BuildSolutionOrProject ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "-target:Build" match Misc.GuessPlatform () with | Misc.Platform.Mac -> @@ -336,7 +353,32 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = Frontend.Console | _ -> Frontend.Console + elif buildTool.StartsWith "dotnet" then + match maybeLegacyBuildTool with + | Some legacyBuildTool when legacyBuildTool = "xbuild" -> + if FsxHelper.AreGtkLibsPresent Echo.All then + BuildSolutionOrProject + (buildTool, buildArg) + (GetProject ProjectFile.XFFrontend) + binaryConfig + maybeConstant + String.Empty + + let twoPhaseFlag = "/property:TwoPhaseBuildDueToXBuildUsage=true" + + let gtkFrontendProject = GetProject ProjectFile.GtkFrontend + NugetRestore gtkFrontendProject + BuildSolutionOrProject + (legacyBuildTool, twoPhaseFlag) + gtkFrontendProject + binaryConfig + maybeConstant + "/target:Build" + Frontend.Gtk + else + Frontend.Console + | _ -> Frontend.Console else Frontend.Console From 14c46b1013ea23dffd73f58e09eaf25c47fdbeeb Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 15 Aug 2023 18:55:09 +0800 Subject: [PATCH 07/12] scripts,GitHubCI: remove curl as a dependency Now that we removed [1] NuGet.Restore.targets, and NuGet.exe gets downloaded by Fsdk via WebClient, I don't think we need curl anymore. [1] 04277edfe7f3e2d22b67bbf13a369df43794037f --- .github/workflows/CI.yml | 22 +++++++++++++++------- scripts/configure.fsx | 3 --- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b103ec130..59ec8d5dd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -248,7 +248,11 @@ jobs: - name: install sudo run: apt update && apt install --yes sudo - name: install all dependencies - run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make curl fsharp nunit-console + run: | + # needed by fsx submodule + sudo apt install --yes curl + + sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make fsharp nunit-console # workaround for https://github.com/actions/runner/issues/2033 - name: ownership workaround @@ -284,7 +288,7 @@ jobs: - name: install sudo run: apt update && apt install --yes sudo - name: install all dependencies - run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make curl dotnet6 + run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet6 # workaround for https://github.com/actions/runner/issues/2033 - name: ownership workaround @@ -326,7 +330,7 @@ jobs: - name: install sudo run: apt update && apt install --yes sudo - name: install all dependencies - run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make curl dotnet6 + run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet6 - name: install last version of mono (Microsoft APT repositories) run: sudo ./scripts/install_mono_from_microsoft_deb_packages.sh @@ -370,7 +374,7 @@ jobs: - name: install sudo run: apt update && apt install --yes sudo - name: install all dependencies - run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make curl dotnet6 mono-xbuild + run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet6 mono-xbuild # workaround for https://github.com/actions/runner/issues/2033 - name: ownership workaround @@ -412,7 +416,7 @@ jobs: - name: install sudo run: apt update && apt install --yes sudo - name: install all dependencies - run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make curl fsharp nunit-console + run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make fsharp nunit-console - name: install last version of mono (Microsoft APT repositories) run: sudo ./scripts/install_mono_from_microsoft_deb_packages.sh @@ -507,7 +511,11 @@ jobs: - name: install sudo run: apt update && apt install --yes sudo - name: install all dependencies - run: sudo apt install --yes git make curl fsharp nunit-console + run: | + # needed by fsx submodule + sudo apt install --yes curl + + sudo apt install --yes git make fsharp nunit-console # workaround for https://github.com/actions/runner/issues/2033 - name: ownership workaround @@ -543,7 +551,7 @@ jobs: - name: install sudo run: apt update && apt install --yes sudo - name: install all dependencies - run: sudo apt install --yes git make curl fsharp nunit-console + run: sudo apt install --yes git make fsharp nunit-console - name: install last version of mono (Microsoft APT repositories) run: sudo ./scripts/install_mono_from_microsoft_deb_packages.sh diff --git a/scripts/configure.fsx b/scripts/configure.fsx index 73193c3d8..28c0ebcec 100644 --- a/scripts/configure.fsx +++ b/scripts/configure.fsx @@ -42,9 +42,6 @@ let buildTool, legacyBuildTool, areGtkLibsAbsentOrDoesNotApply = Process.ConfigCommandCheck ["make"] true true |> ignore - // needed by the "update-servers" Makefile target? - Process.ConfigCommandCheck ["curl"] true true |> ignore - match Process.ConfigCommandCheck ["mono"] false true with | None -> dotnetCmd, None, true From 8ee7f26a8c8736fe6f8bc073a72e65ca3ef5e1db Mon Sep 17 00:00:00 2001 From: Afshin Arani Date: Mon, 21 Aug 2023 09:59:18 +0330 Subject: [PATCH 08/12] CI: add more deps to stockdotnet6-stockmono lane This commit alongside [1] allow for building GTK front- end on this lane. [1] 7f6c88d453cecdf5155cc40de10ece20fe089345 --- .github/workflows/CI.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 59ec8d5dd..6978d3f7a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -374,8 +374,9 @@ jobs: - name: install sudo run: apt update && apt install --yes sudo - name: install all dependencies - run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet6 mono-xbuild - + run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet6 mono-xbuild fsharp + - name: install GTK libs (dependency of GTK frontend) + run: sudo apt install -y libgtk2.0-cil-dev # workaround for https://github.com/actions/runner/issues/2033 - name: ownership workaround run: git config --global --add safe.directory '*' From acab2ad23f86e3a8707938c858ab10c916009166 Mon Sep 17 00:00:00 2001 From: Afshin Arani Date: Mon, 21 Aug 2023 12:32:26 +0330 Subject: [PATCH 09/12] CI: build snap packages with stockdotnet6+xbuild --- .github/workflows/CI.yml | 9 ++++----- scripts/snap_build.sh | 2 +- scripts/snap_install_as_docker.sh | 2 -- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6978d3f7a..d64fa2de3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -640,15 +640,14 @@ jobs: - name: Install snap tools run: | sudo apt update - sudo ./scripts/install_mono_from_microsoft_deb_packages.sh ./scripts/install_snapcraft.sh - # hack to disable dotnet detection (can't use apt purge because github VM seems to have it installed in different way) - # NOTE: you might think an easier way to do this would be use container:\nimage: ubuntu22.04 and then not install dotnet pkg, + # hack to disable msbuild detection + # NOTE: you might think an easier way to do this would be use container:\nimage: ubuntu22.04 and then not install msbuild, # but that doesn't work because we get the following error when trying to install snapcraft via `snap install --classic`: # > error: cannot communicate with server: Post "http://localhost/v2/snaps/snapcraft": dial unix /run/snapd.socket: connect: no such file or directory - - name: HACK to emulate dotnet uninstall - run: sudo rm `which dotnet` + - name: HACK to emulate msbuild uninstall + run: sudo rm `which msbuild` - name: Generate snap package run: | diff --git a/scripts/snap_build.sh b/scripts/snap_build.sh index f73636d6c..2a6c07e3a 100755 --- a/scripts/snap_build.sh +++ b/scripts/snap_build.sh @@ -3,7 +3,7 @@ set -euxo pipefail # this is the equivalent of using the 'build-packages' (not stage-packages) section in snapcraft # but as we're not using the 'make' plugin, we need to this manually now -DEBIAN_FRONTEND=noninteractive sudo apt install -y fsharp build-essential pkg-config cli-common-dev mono-devel libgtk2.0-cil-dev +DEBIAN_FRONTEND=noninteractive sudo apt install -y fsharp build-essential pkg-config cli-common-dev mono-devel libgtk2.0-cil-dev dotnet6 # just in case this is a retry-run, we want to clean artifacts from previous try rm -rf ./staging diff --git a/scripts/snap_install_as_docker.sh b/scripts/snap_install_as_docker.sh index 3d54327a4..92ea1cd26 100755 --- a/scripts/snap_install_as_docker.sh +++ b/scripts/snap_install_as_docker.sh @@ -133,7 +133,5 @@ echo " done" $SUDO docker exec $CONTNAME snap install core || clean_up echo "container $CONTNAME started ..." -$SUDO docker exec $CONTNAME scripts/install_mono_from_microsoft_deb_packages.sh - print_info rm_builddir From 06efc5b6dc0c01e50b696f0f62132477b454bb6f Mon Sep 17 00:00:00 2001 From: Afshin Arani Date: Thu, 24 Aug 2023 11:48:14 +0330 Subject: [PATCH 10/12] scripts/make: build XF frontend when dotnet exists Before this commit, we were assuming that legacy tools were not present if dotnet was present. Now, if dotnet is present, and legacy tools also are (so that the XF frontend can be built), then make will build the frontend. Obj path in some projects had to be changed like it was done in [1] because building same project once with dotnet and once with MSBuild causes problems (it happens in macOS when both mono and dotnet exist). [1] 6b3c64ed493e9481560e96e1858a938aaa1b56e7 --- scripts/make.fsx | 99 +++++++++---------- .../GWallet.Backend.Tests-legacy.fsproj | 1 + .../GWallet.Frontend.Console-legacy.fsproj | 1 + 3 files changed, 47 insertions(+), 54 deletions(-) diff --git a/scripts/make.fsx b/scripts/make.fsx index 6f1a432b3..71c9e55a1 100644 --- a/scripts/make.fsx +++ b/scripts/make.fsx @@ -272,23 +272,16 @@ let BuildSolutionOrProject let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = let maybeBuildTool = Map.tryFind "BuildTool" buildConfigContents let maybeLegacyBuildTool = Map.tryFind "LegacyBuildTool" buildConfigContents - let buildToolToUse = - if maybeBuildTool.IsNone then - maybeLegacyBuildTool - else - maybeBuildTool let solutionFileName = GetSolution SolutionFile.Default - let buildTool,buildArg = - match buildToolToUse with - | None -> - failwith "A BuildTool or LegacyBuildTool should have been chosen by the configure script, please report this bug" - | Some "dotnet" -> + let getBuildToolAndArgs(buildTool: string) = + match buildTool with + | "dotnet" -> #if LEGACY_FRAMEWORK failwith "'dotnet' shouldn't be the build tool when using legacy framework, please report this bug" #endif "dotnet", "build" - | Some otherBuildTool -> + | otherBuildTool -> #if LEGACY_FRAMEWORK let nugetConfig = Path.Combine( @@ -308,44 +301,46 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = #endif Console.WriteLine (sprintf "Building in %s mode..." (binaryConfig.ToString())) - BuildSolutionOrProject - (buildTool, buildArg) - solutionFileName - binaryConfig - maybeConstant - String.Empty + + match maybeBuildTool, maybeLegacyBuildTool with + | Some buildTool, _ + | None, Some buildTool -> + BuildSolutionOrProject + (getBuildToolAndArgs buildTool) + solutionFileName + binaryConfig + maybeConstant + String.Empty + | None, None -> + failwith "A BuildTool or LegacyBuildTool should have been chosen by the configure script, please report this bug" let frontend = - // older mono versions (which only have xbuild, not msbuild) can't compile .NET Standard assemblies - if buildTool = "msbuild" then + match maybeBuildTool, maybeLegacyBuildTool with + | _, Some legacyBuildTool when legacyBuildTool = "msbuild" -> let MSBuildRestoreAndBuild solutionFile = - BuildSolutionOrProject ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "-target:Restore" - BuildSolutionOrProject ("msbuild",buildArg) solutionFile binaryConfig maybeConstant "-target:Build" + BuildSolutionOrProject (getBuildToolAndArgs legacyBuildTool) solutionFile binaryConfig maybeConstant "-target:Restore" + // TODO: report as a bug the fact that /t:Restore;Build doesn't work while /t:Restore and later /t:Build does + BuildSolutionOrProject (getBuildToolAndArgs legacyBuildTool) solutionFile binaryConfig maybeConstant "-target:Build" match Misc.GuessPlatform () with | Misc.Platform.Mac -> - //this is because building in release requires code signing keys if binaryConfig = BinaryConfig.Debug then let solution = GetSolution SolutionFile.Mac -#if LEGACY_FRAMEWORK // 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 -#endif MSBuildRestoreAndBuild solution Frontend.Console | Misc.Platform.Linux -> if FsxHelper.AreGtkLibsPresent Echo.All then let solution = GetSolution SolutionFile.Linux -#if LEGACY_FRAMEWORK // 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 -#endif MSBuildRestoreAndBuild solution Frontend.Gtk @@ -353,34 +348,30 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo = Frontend.Console | _ -> Frontend.Console - elif buildTool.StartsWith "dotnet" then - match maybeLegacyBuildTool with - | Some legacyBuildTool when legacyBuildTool = "xbuild" -> - if FsxHelper.AreGtkLibsPresent Echo.All then - BuildSolutionOrProject - (buildTool, buildArg) - (GetProject ProjectFile.XFFrontend) - binaryConfig - maybeConstant - String.Empty - - let twoPhaseFlag = "/property:TwoPhaseBuildDueToXBuildUsage=true" - - let gtkFrontendProject = GetProject ProjectFile.GtkFrontend - NugetRestore gtkFrontendProject - BuildSolutionOrProject - (legacyBuildTool, twoPhaseFlag) - gtkFrontendProject - binaryConfig - maybeConstant - "/target:Build" - - Frontend.Gtk - else - Frontend.Console - | _ -> Frontend.Console - else - Frontend.Console + | Some buildTool, Some legacyBuildTool when buildTool = "dotnet" && legacyBuildTool = "xbuild" -> + if FsxHelper.AreGtkLibsPresent Echo.All then + BuildSolutionOrProject + (getBuildToolAndArgs buildTool) + (GetProject ProjectFile.XFFrontend) + binaryConfig + maybeConstant + String.Empty + + let twoPhaseFlag = "/property:TwoPhaseBuildDueToXBuildUsage=true" + + let gtkFrontendProject = GetProject ProjectFile.GtkFrontend + NugetRestore gtkFrontendProject + BuildSolutionOrProject + (legacyBuildTool, twoPhaseFlag) + gtkFrontendProject + binaryConfig + maybeConstant + "/target:Build" + + Frontend.Gtk + else + Frontend.Console + | _ -> Frontend.Console let scriptName = sprintf "%s-%s" UNIX_NAME (frontend.ToString().ToLower()) let launcherScriptFile = diff --git a/src/GWallet.Backend.Tests/GWallet.Backend.Tests-legacy.fsproj b/src/GWallet.Backend.Tests/GWallet.Backend.Tests-legacy.fsproj index 3d974f42d..7657a1ea9 100644 --- a/src/GWallet.Backend.Tests/GWallet.Backend.Tests-legacy.fsproj +++ b/src/GWallet.Backend.Tests/GWallet.Backend.Tests-legacy.fsproj @@ -18,6 +18,7 @@ /warnon:3218 /warnon:0193 + obj\legacy\ true diff --git a/src/GWallet.Frontend.Console/GWallet.Frontend.Console-legacy.fsproj b/src/GWallet.Frontend.Console/GWallet.Frontend.Console-legacy.fsproj index d585a508f..2cf63c863 100644 --- a/src/GWallet.Frontend.Console/GWallet.Frontend.Console-legacy.fsproj +++ b/src/GWallet.Frontend.Console/GWallet.Frontend.Console-legacy.fsproj @@ -19,6 +19,7 @@ /warnon:3218 /warnon:0193 + obj\legacy\ true From 3e02b8291c7ae377222f67bb18a0f6222a74c46f Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Fri, 13 Oct 2023 23:37:48 +0800 Subject: [PATCH 11/12] GitHubCI: cosmetic, use `--yes` instead of `-y` --- .github/workflows/CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d64fa2de3..896b4e941 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -218,7 +218,7 @@ jobs: - name: check mono version run: mono --version - name: install GTK libs (dependency of GTK frontend) - run: sudo apt install -y libgtk2.0-cil-dev + run: sudo apt install --yes libgtk2.0-cil-dev - name: configure run: ./configure.sh - name: build in DEBUG mode (retry 3 times because of flakey XamForms restore) @@ -376,7 +376,7 @@ jobs: - name: install all dependencies run: sudo DEBIAN_FRONTEND=noninteractive apt install --yes git make dotnet6 mono-xbuild fsharp - name: install GTK libs (dependency of GTK frontend) - run: sudo apt install -y libgtk2.0-cil-dev + run: sudo apt install --yes libgtk2.0-cil-dev # workaround for https://github.com/actions/runner/issues/2033 - name: ownership workaround run: git config --global --add safe.directory '*' @@ -428,7 +428,7 @@ jobs: - name: check mono version run: mono --version - name: install GTK libs (dependency of GTK frontend) - run: sudo apt install -y libgtk2.0-cil-dev + run: sudo apt install --yes libgtk2.0-cil-dev - name: configure run: ./configure.sh - name: build in DEBUG mode (retry 3 times because of flakey XamForms restore) @@ -482,7 +482,7 @@ jobs: - name: check mono version run: mono --version - name: install GTK libs (dependency of GTK frontend) - run: sudo apt install -y libgtk2.0-cil-dev + run: sudo apt install --yes libgtk2.0-cil-dev - name: configure run: ./configure.sh - name: build in DEBUG mode (retry 3 times because of flakey XamForms restore) @@ -563,7 +563,7 @@ jobs: - name: check mono version run: mono --version - name: install GTK libs (dependency of GTK frontend) - run: sudo apt install -y libgtk2.0-cil-dev + run: sudo apt install --yes libgtk2.0-cil-dev - name: configure run: ./configure.sh - name: build in DEBUG mode (retry 3 times because of flakey XamForms restore) From 4d0002876bc86e063537f38f89a30e99ae555a97 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Fri, 13 Oct 2023 23:44:41 +0800 Subject: [PATCH 12/12] Introduce .git-blame-ignore-revs There have been some recent cosmetic commits so it's better to group them here to avoid git-blame pollution. --- .git-blame-ignore-revs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..29e13f251 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,11 @@ +# NOTE: newer commits are above, older ones below + +# GitHubCI: cosmetic, use `--yes` instead of `-y` +3e02b8291c7ae377222f67bb18a0f6222a74c46f + +# scripts/make.fsx: cosmetic, use longer flag name +94aadcc339724f6528cba39e22581dc6fe16717b + +# scripts/make.fsx: cosmetic, use longer flag name +ae83bae269359e9431ec670764d20e5bb452b15e +