From cb339726f13f804b591b344b84554b493965d25c Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Thu, 26 Nov 2020 19:33:22 +0000 Subject: [PATCH] Start work for macOS packager, this gets the format right Transporter now recognises the package and can match it to pending releases --- cmd/fyne/commands/release.go | 9 +++++ cmd/fyne/internal/templates/bundled.go | 2 +- cmd/fyne/internal/templates/data/Info.plist | 40 +++++++++++---------- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/cmd/fyne/commands/release.go b/cmd/fyne/commands/release.go index 6bfd7faf28..1473c3f617 100644 --- a/cmd/fyne/commands/release.go +++ b/cmd/fyne/commands/release.go @@ -80,6 +80,9 @@ func (r *releaser) afterPackage() error { } return r.signAndroid(apk) } + if r.os == "darwin" { + return r.packageMacOSRelease() + } if r.os == "ios" { return r.packageIOSRelease() } @@ -156,6 +159,12 @@ func (r *releaser) packageIOSRelease() error { return exec.Command("zip", "-r", appName[:len(appName)-4]+".ipa", "Payload/").Run() } +func (r *releaser) packageMacOSRelease() error { + cmd := exec.Command("productbuild", "--component", r.name+".app", "/Applications/", + "--product", r.name+".app/Contents/Info.plist", r.name+".pkg") + return cmd.Run() +} + func (r *releaser) packageWindowsRelease(outFile string) error { payload := filepath.Join(r.dir, "Payload") os.Mkdir(payload, 0750) diff --git a/cmd/fyne/internal/templates/bundled.go b/cmd/fyne/internal/templates/bundled.go index 1c3d382f3d..f3cf32a6e2 100644 --- a/cmd/fyne/internal/templates/bundled.go +++ b/cmd/fyne/internal/templates/bundled.go @@ -7,7 +7,7 @@ import "fyne.io/fyne" var resourceInfoPlist = &fyne.StaticResource{ StaticName: "Info.plist", StaticContent: []byte{ - 60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 10, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 112, 108, 105, 115, 116, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 65, 112, 112, 108, 101, 32, 67, 111, 109, 112, 117, 116, 101, 114, 47, 47, 68, 84, 68, 32, 80, 76, 73, 83, 84, 32, 49, 46, 48, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 97, 112, 112, 108, 101, 46, 99, 111, 109, 47, 68, 84, 68, 115, 47, 80, 114, 111, 112, 101, 114, 116, 121, 76, 105, 115, 116, 45, 49, 46, 48, 46, 100, 116, 100, 34, 62, 10, 60, 112, 108, 105, 115, 116, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 62, 10, 60, 100, 105, 99, 116, 62, 10, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 78, 97, 109, 101, 60, 47, 107, 101, 121, 62, 10, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 78, 97, 109, 101, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 69, 120, 101, 99, 117, 116, 97, 98, 108, 101, 60, 47, 107, 101, 121, 62, 10, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 69, 120, 101, 78, 97, 109, 101, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 100, 101, 110, 116, 105, 102, 105, 101, 114, 60, 47, 107, 101, 121, 62, 10, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 65, 112, 112, 73, 68, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 99, 111, 110, 70, 105, 108, 101, 60, 47, 107, 101, 121, 62, 10, 60, 115, 116, 114, 105, 110, 103, 62, 105, 99, 111, 110, 46, 105, 99, 110, 115, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 83, 104, 111, 114, 116, 86, 101, 114, 115, 105, 111, 110, 83, 116, 114, 105, 110, 103, 60, 47, 107, 101, 121, 62, 10, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 86, 101, 114, 115, 105, 111, 110, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 86, 101, 114, 115, 105, 111, 110, 60, 47, 107, 101, 121, 62, 10, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 66, 117, 105, 108, 100, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 107, 101, 121, 62, 78, 83, 72, 105, 103, 104, 82, 101, 115, 111, 108, 117, 116, 105, 111, 110, 67, 97, 112, 97, 98, 108, 101, 60, 47, 107, 101, 121, 62, 10, 60, 116, 114, 117, 101, 47, 62, 10, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 110, 102, 111, 68, 105, 99, 116, 105, 111, 110, 97, 114, 121, 86, 101, 114, 115, 105, 111, 110, 60, 47, 107, 101, 121, 62, 10, 60, 115, 116, 114, 105, 110, 103, 62, 54, 46, 48, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 80, 97, 99, 107, 97, 103, 101, 84, 121, 112, 101, 60, 47, 107, 101, 121, 62, 10, 60, 115, 116, 114, 105, 110, 103, 62, 65, 80, 80, 76, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 47, 100, 105, 99, 116, 62, 10, 60, 47, 112, 108, 105, 115, 116, 62}} + 60, 63, 120, 109, 108, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 32, 101, 110, 99, 111, 100, 105, 110, 103, 61, 34, 85, 84, 70, 45, 56, 34, 63, 62, 10, 60, 33, 68, 79, 67, 84, 89, 80, 69, 32, 112, 108, 105, 115, 116, 32, 80, 85, 66, 76, 73, 67, 32, 34, 45, 47, 47, 65, 112, 112, 108, 101, 32, 67, 111, 109, 112, 117, 116, 101, 114, 47, 47, 68, 84, 68, 32, 80, 76, 73, 83, 84, 32, 49, 46, 48, 47, 47, 69, 78, 34, 32, 34, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 97, 112, 112, 108, 101, 46, 99, 111, 109, 47, 68, 84, 68, 115, 47, 80, 114, 111, 112, 101, 114, 116, 121, 76, 105, 115, 116, 45, 49, 46, 48, 46, 100, 116, 100, 34, 62, 10, 60, 112, 108, 105, 115, 116, 32, 118, 101, 114, 115, 105, 111, 110, 61, 34, 49, 46, 48, 34, 62, 10, 60, 100, 105, 99, 116, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 78, 97, 109, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 78, 97, 109, 101, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 69, 120, 101, 99, 117, 116, 97, 98, 108, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 69, 120, 101, 78, 97, 109, 101, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 100, 101, 110, 116, 105, 102, 105, 101, 114, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 65, 112, 112, 73, 68, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 99, 111, 110, 70, 105, 108, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 105, 99, 111, 110, 46, 105, 99, 110, 115, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 83, 104, 111, 114, 116, 86, 101, 114, 115, 105, 111, 110, 83, 116, 114, 105, 110, 103, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 86, 101, 114, 115, 105, 111, 110, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 83, 117, 112, 112, 111, 114, 116, 101, 100, 80, 108, 97, 116, 102, 111, 114, 109, 115, 60, 47, 107, 101, 121, 62, 10, 9, 60, 97, 114, 114, 97, 121, 62, 10, 9, 9, 60, 115, 116, 114, 105, 110, 103, 62, 77, 97, 99, 79, 83, 88, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 47, 97, 114, 114, 97, 121, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 86, 101, 114, 115, 105, 111, 110, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 123, 123, 46, 66, 117, 105, 108, 100, 125, 125, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 78, 83, 72, 105, 103, 104, 82, 101, 115, 111, 108, 117, 116, 105, 111, 110, 67, 97, 112, 97, 98, 108, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 116, 114, 117, 101, 47, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 73, 110, 102, 111, 68, 105, 99, 116, 105, 111, 110, 97, 114, 121, 86, 101, 114, 115, 105, 111, 110, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 54, 46, 48, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 9, 60, 107, 101, 121, 62, 67, 70, 66, 117, 110, 100, 108, 101, 80, 97, 99, 107, 97, 103, 101, 84, 121, 112, 101, 60, 47, 107, 101, 121, 62, 10, 9, 60, 115, 116, 114, 105, 110, 103, 62, 65, 80, 80, 76, 60, 47, 115, 116, 114, 105, 110, 103, 62, 10, 60, 47, 100, 105, 99, 116, 62, 10, 60, 47, 112, 108, 105, 115, 116, 62}} var resourceMakefile = &fyne.StaticResource{ StaticName: "Makefile", diff --git a/cmd/fyne/internal/templates/data/Info.plist b/cmd/fyne/internal/templates/data/Info.plist index 4903536b73..18ad740985 100644 --- a/cmd/fyne/internal/templates/data/Info.plist +++ b/cmd/fyne/internal/templates/data/Info.plist @@ -2,23 +2,27 @@ -CFBundleName -{{.Name}} -CFBundleExecutable -{{.ExeName}} -CFBundleIdentifier -{{.AppID}} -CFBundleIconFile -icon.icns -CFBundleShortVersionString -{{.Version}} -CFBundleVersion -{{.Build}} -NSHighResolutionCapable - -CFBundleInfoDictionaryVersion -6.0 -CFBundlePackageType -APPL + CFBundleName + {{.Name}} + CFBundleExecutable + {{.ExeName}} + CFBundleIdentifier + {{.AppID}} + CFBundleIconFile + icon.icns + CFBundleShortVersionString + {{.Version}} + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + {{.Build}} + NSHighResolutionCapable + + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL \ No newline at end of file