From fd5348d26d678fabeefe4495c1f9b3a5b4c01a5f Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Sat, 30 Oct 2021 10:33:30 +1100 Subject: [PATCH] [v2] Fix build output --- v2/pkg/commands/build/base.go | 11 ++++------- v2/pkg/commands/build/build.go | 17 +++++++---------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/v2/pkg/commands/build/base.go b/v2/pkg/commands/build/base.go index b029d6c89..1f4433153 100644 --- a/v2/pkg/commands/build/base.go +++ b/v2/pkg/commands/build/base.go @@ -3,9 +3,6 @@ package build import ( "bytes" "fmt" - "github.com/leaanthony/gosod" - wailsRuntime "github.com/wailsapp/wails/v2/internal/frontend/runtime" - "github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper" "io/ioutil" "os" "os/exec" @@ -13,6 +10,10 @@ import ( "runtime" "strings" + "github.com/leaanthony/gosod" + wailsRuntime "github.com/wailsapp/wails/v2/internal/frontend/runtime" + "github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper" + "github.com/pkg/errors" "github.com/leaanthony/slicer" @@ -215,8 +216,6 @@ func (b *BaseBuilder) CompileProject(options *Options) error { commands.Add(`"all=-N -l"`) } - //commands.Add("-a") - var tags slicer.StringSlicer tags.Add(options.OutputType) tags.AddSlice(options.UserTags) @@ -337,8 +336,6 @@ func (b *BaseBuilder) CompileProject(options *Options) error { return err } - println("Done.") - if !options.Compress { return nil } diff --git a/v2/pkg/commands/build/build.go b/v2/pkg/commands/build/build.go index 9e2798a1b..2b05bda0d 100644 --- a/v2/pkg/commands/build/build.go +++ b/v2/pkg/commands/build/build.go @@ -111,12 +111,6 @@ func Build(options *Options) (string, error) { } } - // Build the base assets - //err = builder.BuildAssets(options) - //if err != nil { - // return "", err - //} - // If we are building for windows, we will need to generate the asset bundle before // compilation. This will be a .syso file in the project root if options.Pack && options.Platform == "windows" { @@ -149,10 +143,10 @@ func Build(options *Options) (string, error) { options.OutputFile = amd64Filename options.CleanBuildDirectory = false if options.Verbosity == VERBOSE { - println() - println(" Building AMD64 Target:", filepath.Join(options.BuildDirectory, options.OutputFile)) + outputLogger.Println("\nBuilding AMD64 Target:", filepath.Join(options.BuildDirectory, options.OutputFile)) } err = builder.CompileProject(options) + if err != nil { return "", err } @@ -161,15 +155,16 @@ func Build(options *Options) (string, error) { options.OutputFile = arm64Filename options.CleanBuildDirectory = false if options.Verbosity == VERBOSE { - println(" Building ARM64 Target:", filepath.Join(options.BuildDirectory, options.OutputFile)) + outputLogger.Println("Building ARM64 Target:", filepath.Join(options.BuildDirectory, options.OutputFile)) } err = builder.CompileProject(options) + if err != nil { return "", err } // Run lipo if options.Verbosity == VERBOSE { - println(" Running lipo: ", "lipo", "-create", "-output", outputFile, amd64Filename, arm64Filename) + outputLogger.Println(" Running lipo: ", "lipo", "-create", "-output", outputFile, amd64Filename, arm64Filename) } _, stderr, err := shell.RunCommand(options.BuildDirectory, "lipo", "-create", "-output", outputFile, amd64Filename, arm64Filename) if err != nil { @@ -193,6 +188,8 @@ func Build(options *Options) (string, error) { } } + outputLogger.Println("Done.") + // Do we need to pack the app for non-windows? if options.Pack && options.Platform != "windows" {