mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 05:30:52 +08:00
[mac] Fix binary path in build. Remove apple identity
This commit is contained in:
parent
2729081f2c
commit
3723c41d15
@ -46,11 +46,10 @@ type Options struct {
|
||||
Verbosity int // Verbosity level (0 - silent, 1 - default, 2 - verbose)
|
||||
Compress bool // Compress the final binary
|
||||
CompressFlags string // Flags to pass to UPX
|
||||
AppleIdentity string
|
||||
WebView2Strategy string // WebView2 installer strategy
|
||||
RunDelve bool // Indicates if we should run delve after the build
|
||||
WailsJSDir string // Directory to generate the wailsjs module
|
||||
ForceBuild bool // Force
|
||||
WebView2Strategy string // WebView2 installer strategy
|
||||
RunDelve bool // Indicates if we should run delve after the build
|
||||
WailsJSDir string // Directory to generate the wailsjs module
|
||||
ForceBuild bool // Force
|
||||
}
|
||||
|
||||
// Build the project!
|
||||
|
@ -2,17 +2,16 @@ package build
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v2/pkg/buildassets"
|
||||
"image"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/buildassets"
|
||||
|
||||
"github.com/jackmordaunt/icns"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/wailsapp/wails/v2/internal/fs"
|
||||
@ -55,13 +54,7 @@ func packageApplication(options *Options) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Sign app if needed
|
||||
if options.AppleIdentity != "" {
|
||||
err = signApplication(options)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
options.CompiledBinary = filepath.Join(options.BuildDirectory, bundlename)
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -186,21 +179,3 @@ func processApplicationIcon(resourceDir string, iconsDir string) (err error) {
|
||||
}()
|
||||
return icns.Encode(dest, srcImg)
|
||||
}
|
||||
|
||||
func signApplication(options *Options) error {
|
||||
bundlename := filepath.Join(options.BuildDirectory, options.ProjectData.Name+".app")
|
||||
identity := fmt.Sprintf(`"%s"`, options.AppleIdentity)
|
||||
cmd := exec.Command("codesign", "--sign", identity, "--deep", "--force", "--verbose", "--timestamp", "--options", "runtime", bundlename)
|
||||
var stdo, stde bytes.Buffer
|
||||
cmd.Stdout = &stdo
|
||||
cmd.Stderr = &stde
|
||||
|
||||
// Run command
|
||||
err := cmd.Run()
|
||||
|
||||
// Format error if we have one
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s\n%s", err, string(stde.Bytes()))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user