Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FE.XF.GTK: open console app with --console arg #239

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# NOTE: newer commits are above, older ones below

# Frontend.Console: stop using moduleless funcs
ccdb07a040167b8e405d837c08e4b482ab8f3b25

# Frontend.XF: cosmetic, replace this with self
55fd9692099943d09504376354e7f085cfa75cfc

Expand Down
26 changes: 19 additions & 7 deletions scripts/make.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,30 @@ open Fsdk.Process
open GWallet.Scripting

let UNIX_NAME = "geewallet"
let CONSOLE_FRONTEND = "GWallet.Frontend.Console"
let GTK_FRONTEND = "GWallet.Frontend.XF.Gtk"
let SHORT_NAME = "GWallet"
let CONSOLE_FRONTEND = sprintf "%s.Frontend.Console" SHORT_NAME
let GTK_FRONTEND = sprintf "%s.Frontend.XF.Gtk" SHORT_NAME

type ProjectFile =
| ConsoleFrontend
| 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")
| ConsoleFrontend -> sprintf "%s.Frontend.Console" SHORT_NAME
| GtkFrontend -> sprintf "%s.Frontend.XF.Gtk" SHORT_NAME
| XFFrontend -> sprintf "%s.Frontend.XF" SHORT_NAME

let prjFile =
Path.Combine("src", projFileName)
Path.Combine("src", projFileName, sprintf "%s.fsproj" projFileName)
|> FileInfo
if not prjFile.Exists then
raise <| FileNotFoundException("Project file not found", prjFile.FullName)
prjFile

let BACKEND = "GWallet.Backend"
let BACKEND = sprintf "%s.Backend" SHORT_NAME

type Frontend =
| Console
Expand Down Expand Up @@ -334,6 +337,15 @@ let JustBuild binaryConfig maybeConstant: Frontend*FileInfo =
binaryConfig
maybeConstant
String.Empty

let buildAsLibraryFlag = "build /property:BuildFrontendConsoleAsLibrary=true"

BuildSolutionOrProject
(buildTool, buildAsLibraryFlag)
(GetProject ProjectFile.ConsoleFrontend)
binaryConfig
maybeConstant
String.Empty

let twoPhaseFlag = "/property:TwoPhaseBuildDueToXBuildUsage=true"

Expand Down Expand Up @@ -501,7 +513,7 @@ match maybeTarget with
Console.WriteLine "Running tests..."
Console.WriteLine ()

let testProjectName = "GWallet.Backend.Tests"
let testProjectName = sprintf "%s.Backend.Tests" SHORT_NAME
#if !LEGACY_FRAMEWORK
let testTarget =
Path.Combine (
Expand Down
13 changes: 12 additions & 1 deletion src/GWallet.Frontend.Console/GWallet.Frontend.Console.fsproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<Choose>
<When Condition="'$(BuildFrontendConsoleAsLibrary)'=='true' Or '$(MSBuildRuntimeType)'=='Mono'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aarani why filter by Mono here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

Copy link
Contributor Author

@aarani aarani Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we only rely on BuildFrontendConsoleAsLibrary , geewallet linux-legacy becomes unbuildable without that property.

Copy link
Contributor Author

@aarani aarani Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason BuildFrontendConsoleAsLibrary is there, is for stockdotnet6+stockmono lane.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you know what I'm going to reply to this, right?

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="..\GWallet.Backend\Properties\CommonAssemblyInfo.fs">
<Link>Properties\CommonAssemblyInfo.fs</Link>
Expand Down
Loading
Loading