5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 20:39:34 +08:00

[v2] Fix build output

This commit is contained in:
Lea Anthony 2021-10-30 10:33:30 +11:00
parent 569569f1fc
commit fd5348d26d
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
2 changed files with 11 additions and 17 deletions

View File

@ -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
}

View File

@ -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" {