From 5cc012d76326f8348d72454382f52e9ce8179393 Mon Sep 17 00:00:00 2001 From: stffabi Date: Thu, 1 Dec 2022 09:20:18 +0100 Subject: [PATCH] [darwin] Inspector tools should also be included into a debug build (#2162) --- v2/internal/frontend/desktop/darwin/inspector.go | 2 +- v2/internal/frontend/desktop/darwin/inspector_dev.go | 4 ++-- v2/pkg/commands/build/base.go | 5 ++++- v2/pkg/commands/build/build.go | 7 ++++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/v2/internal/frontend/desktop/darwin/inspector.go b/v2/internal/frontend/desktop/darwin/inspector.go index 5ec4c6af..3021c5c1 100644 --- a/v2/internal/frontend/desktop/darwin/inspector.go +++ b/v2/internal/frontend/desktop/darwin/inspector.go @@ -1,4 +1,4 @@ -//go:build darwin && !dev +//go:build darwin && !(dev || debug) package darwin diff --git a/v2/internal/frontend/desktop/darwin/inspector_dev.go b/v2/internal/frontend/desktop/darwin/inspector_dev.go index 18850cd8..4e63e23e 100644 --- a/v2/internal/frontend/desktop/darwin/inspector_dev.go +++ b/v2/internal/frontend/desktop/darwin/inspector_dev.go @@ -1,8 +1,8 @@ -//go:build darwin && dev +//go:build darwin && (dev || debug) package darwin -// We are using private APIs here, make sure this is only included in a dev build and not in a production build. +// We are using private APIs here, make sure this is only included in a dev/debug build and not in a production build. // Otherwise the binary might get rejected by the AppReview-Team when pushing it to the AppStore. /* diff --git a/v2/pkg/commands/build/base.go b/v2/pkg/commands/build/base.go index 06ed3046..f4195628 100644 --- a/v2/pkg/commands/build/base.go +++ b/v2/pkg/commands/build/base.go @@ -3,7 +3,6 @@ package build import ( "bytes" "fmt" - "github.com/pterm/pterm" "os" "os/exec" "path/filepath" @@ -11,6 +10,8 @@ import ( "strconv" "strings" + "github.com/pterm/pterm" + "github.com/wailsapp/wails/v2/internal/system" "github.com/leaanthony/gosod" @@ -560,6 +561,7 @@ func (b *BaseBuilder) BuildFrontend(outputLogger *clilogger.CLILogger) error { if installCommand == "" { // No - don't install printBulletPoint("No Install command. Skipping.") + pterm.Println("") } else { // Do install if needed printBulletPoint("Installing frontend dependencies: ") @@ -580,6 +582,7 @@ func (b *BaseBuilder) BuildFrontend(outputLogger *clilogger.CLILogger) error { } if buildCommand == "" { printBulletPoint("No Build command. Skipping.") + pterm.Println("") // No - ignore return nil } diff --git a/v2/pkg/commands/build/build.go b/v2/pkg/commands/build/build.go index 26244683..876ba19a 100644 --- a/v2/pkg/commands/build/build.go +++ b/v2/pkg/commands/build/build.go @@ -2,12 +2,13 @@ package build import ( "fmt" - "github.com/pterm/pterm" "os" "path/filepath" "runtime" "strings" + "github.com/pterm/pterm" + "github.com/samber/lo" "github.com/wailsapp/wails/v2/internal/staticanalysis" "github.com/wailsapp/wails/v2/pkg/commands/bindings" @@ -345,6 +346,10 @@ func execBuildApplication(builder Builder, options *Options) (string, error) { pterm.Info.Println(message) } + if options.Platform == "darwin" && options.Mode == Debug { + pterm.Warning.Println("A darwin debug build contains private APIs, please don't distribute this build. Please use it only as a test build for testing and debug purposes.") + } + return options.CompiledBinary, nil }