mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
cmd/gio: expand usage document
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+5
-5
@@ -23,10 +23,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
target = flag.String("target", "", "specify target (ios, tvos, android, js)")
|
target = flag.String("target", "", "specify target (ios, tvos, android, js).\n")
|
||||||
archNames = flag.String("arch", "", "specify architecture(s) to include")
|
archNames = flag.String("arch", "", "specify architecture(s) to include (arm, arm64, amd64).")
|
||||||
buildMode = flag.String("buildmode", "exe", "specify buildmode: archive or exe")
|
buildMode = flag.String("buildmode", "exe", "specify buildmode (archive, exe)")
|
||||||
destPath = flag.String("o", "", `output path. Specify a path with the ".app" suffix for iOS simulators.`)
|
destPath = flag.String("o", "", "output file or directory.\nFor -target ios or tvos, use the .app suffix to target simulators.")
|
||||||
appID = flag.String("appid", "org.gioui.app", "app identifier (for -buildmode=exe)")
|
appID = flag.String("appid", "org.gioui.app", "app identifier (for -buildmode=exe)")
|
||||||
version = flag.Int("version", 1, "app version (for -buildmode=exe)")
|
version = flag.Int("version", 1, "app version (for -buildmode=exe)")
|
||||||
printCommands = flag.Bool("x", false, "print the commands")
|
printCommands = flag.Bool("x", false, "print the commands")
|
||||||
@@ -46,7 +46,7 @@ type buildInfo struct {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Usage = func() {
|
flag.Usage = func() {
|
||||||
mainUsage(os.Stderr)
|
fmt.Fprintf(os.Stderr, mainUsage)
|
||||||
}
|
}
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
if err := mainErr(); err != nil {
|
if err := mainErr(); err != nil {
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
// SPDX-License-Identifier: Unlicense OR MIT
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
const mainUsage = `The Gio command builds and packages Gio (gioui.org) programs.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
gio -target <target> [flags] <package> [run arguments]
|
||||||
|
|
||||||
|
The go tool is sufficient to build, install and run Gio programs on platforms
|
||||||
|
where a single executable is sufficient. The gio tool can build and package Gio
|
||||||
|
programs for platforms where additional metadata or support files are required.
|
||||||
|
|
||||||
|
The package argument specifies an import path or a single Go source file to
|
||||||
|
package. Any run arguments are appended to os.Args at runtime.
|
||||||
|
|
||||||
|
If the package contains an appicon.png file, it is used as the app icon on
|
||||||
|
supported platforms.
|
||||||
|
|
||||||
|
The mandatory -target flag selects the target platform: ios or android for the
|
||||||
|
mobile platforms, tvos for Apple's tvOS, js for WebAssembly/WebGL.
|
||||||
|
|
||||||
|
The -arch flag specifies a comma separated list of GOARCHs to include. The
|
||||||
|
default is all supported architectures.
|
||||||
|
|
||||||
|
The -o flag specifies an output file or directory, depending on the target.
|
||||||
|
|
||||||
|
The -buildmode flag selects the build mode. Two build modes are available, exe
|
||||||
|
and archive. Buildmode exe outputs an .ipa file for iOS or tvOS, an .apk file
|
||||||
|
for Android or a directory with the WebAssembly module and support files for
|
||||||
|
a browser.
|
||||||
|
|
||||||
|
As a special case for iOS or tvOS, specifying a path that ends with ".app"
|
||||||
|
will output an app directory suitable for a simulator.
|
||||||
|
|
||||||
|
The other buildmode is archive, which will output an .aar library for Android
|
||||||
|
or a .framework for iOS and tvOS.
|
||||||
|
|
||||||
|
The -appid flag specifies the package name for Android or the bundle id for
|
||||||
|
iOS and tvOS. A bundle id must be provisioned through Xcode before the gio
|
||||||
|
tool can use it.
|
||||||
|
|
||||||
|
The -version flag specifies the integer version for Android and the last
|
||||||
|
component of the 1.0.X version for iOS and tvOS.
|
||||||
|
|
||||||
|
The -work flag prints the path to the working directory and suppress
|
||||||
|
its deletion.
|
||||||
|
|
||||||
|
The -x flag will print all the external commands executed by the gio tool.
|
||||||
|
`
|
||||||
Reference in New Issue
Block a user