fyne package

One exception is the Fyne project as it aims to provide APIs for full application life cycle, and so the tools support distributing complete desktop apps across multiple platforms. While the project is still early it does have a tool that can help with application packaging (even if you've not used Fyne in your code). The fyne package command is designed to generate and package all the required metadata for an application to distribute on macOS, Linux, or Windows. Invoking with the -os <platform> parameter (using one of "darwin", "linux", or "windows") will create a fully packaged application in the current directory. Before executing this command the application should already be compiled for release.

For example, we can create a macOS application bundle from a Linux computer using fyne package -os linux. There are many additional parameters that can change the contents of the application, and the most useful will be the -icon <filename> parameter (which is required). If you were not already using Fyne, then the command should be installed using go get fyne.io/fyne/cmd/fyne, as follows:

Building a macOS application bundle on Linux with "fyne package"

As you can see in the preceding screenshot, the tool generated an .app directory structure (which defines a macOS application) from a Linux Terminal. We used the same platform name for the GOOS environment and the -os parameter to fyne package. It's recommended to build for one platform and then package it before changing the target operating system to avoid potential errors in the output package.

The applications we have built in this section could be distributed right away. Uploading to a website or sharing the files in some other manner would work, but we want to make the process completely seamless for users. Let's wrap up this chapter by looking at the various distribution channels that exist for desktop application delivery directly to end users.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.55.198