From a12912c944314f5549200b90d5f2b5ec265fbb89 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 18 Sep 2019 22:42:31 +0200 Subject: [PATCH] cmd/gogio: rename the gio too to gogio The `gio` name clashes with a widely deployed GNOME tool. Rename our tool to `gogio`, "the go tool for gio programs". Fixes gio#20 Signed-off-by: Elias Naur --- README.md | 16 ++++++++-------- cmd/gio/doc.go | 10 ---------- cmd/{gio => gogio}/androidbuild.go | 0 cmd/gogio/doc.go | 10 ++++++++++ cmd/{gio => gogio}/gio.go | 10 +++++----- cmd/{gio => gogio}/gio_test.go | 0 cmd/{gio => gogio}/help.go | 10 +++++----- cmd/{gio => gogio}/iosbuild.go | 0 cmd/{gio => gogio}/jsbuild.go | 0 9 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 cmd/gio/doc.go rename cmd/{gio => gogio}/androidbuild.go (100%) create mode 100644 cmd/gogio/doc.go rename cmd/{gio => gogio}/gio.go (97%) rename cmd/{gio => gogio}/gio_test.go (100%) rename cmd/{gio => gogio}/help.go (87%) rename cmd/{gio => gogio}/iosbuild.go (100%) rename cmd/{gio => gogio}/jsbuild.go (100%) diff --git a/README.md b/README.md index 0c3b5192..a958a154 100644 --- a/README.md +++ b/README.md @@ -46,25 +46,25 @@ with the `-token` flag: ## Running on mobiles -For Android, iOS, tvOS the `gio` tool can build and package a Gio program for you. +For Android, iOS, tvOS the `gogio` tool can build and package a Gio program for you. To build an Android .apk file from the `gophers` example: - $ go run gioui.org/cmd/gio -target android gioui.org/apps/gophers + $ go run gioui.org/cmd/gogio -target android gioui.org/apps/gophers The apk can be installed to a running emulator or attached device with adb: $ adb install gophers.apk -The gio tool passes command line arguments to os.Args at runtime: +The `gogio` tool passes command line arguments to os.Args at runtime: - $ go run gioui.org/cmd/gio -target android gioui.org/apps/gophers -token + $ go run gioui.org/cmd/gogio -target android gioui.org/apps/gophers -token The `-appid` flag specifies the iOS bundle id or Android package id. The flag is required for creating signed .ipa files for iOS and tvOS devices, because the bundle id must match an id previously provisioned in Xcode. For example, - $ go run gioui.org/cmd/gio -target ios -appid gioui.org/apps/gophers + $ go run gioui.org/cmd/gogio -target ios -appid gioui.org/apps/gophers Use the `Window->Devices and Simulators` option in Xcode to install the ipa file to the device. If you have [ideviceinstaller](https://github.com/libimobiledevice/ideviceinstaller) installed, @@ -75,7 +75,7 @@ you can install the app from the command line: If you just want to run a program on the iOS simulator, use the `-o` flag to specify a .app directory: - $ go run gioui.org/cmd/gio/ -o gophers.app -target ios gioui.org/apps/gophers + $ go run gioui.org/cmd/gogio -o gophers.app -target ios gioui.org/apps/gophers Install the app to a running simulator with simctl: @@ -84,10 +84,10 @@ Install the app to a running simulator with simctl: ## Webassembly/WebGL -To run a Gio program in a compatible browser, the `gio` tool can output a directory ready to +To run a Gio program in a compatible browser, the `gogio` tool can output a directory ready to serve. With the `goxec` tool you don't even need a web server: - $ go run gioui.org/cmd/gio -target js gioui.org/apps/gophers + $ go run gioui.org/cmd/gogio -target js gioui.org/apps/gophers $ go get github.com/shurcooL/goexec $ goexec 'http.ListenAndServe(":8080", http.FileServer(http.Dir("gophers")))' diff --git a/cmd/gio/doc.go b/cmd/gio/doc.go deleted file mode 100644 index 8e6e8795..00000000 --- a/cmd/gio/doc.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: Unlicense OR MIT - -/* -The gio tool builds and packages Gio programs for Android, iOS/tvOS -and WebAssembly. - -Run gio with no arguments for instructions, or see the examples at -https://gioui.org. -*/ -package main diff --git a/cmd/gio/androidbuild.go b/cmd/gogio/androidbuild.go similarity index 100% rename from cmd/gio/androidbuild.go rename to cmd/gogio/androidbuild.go diff --git a/cmd/gogio/doc.go b/cmd/gogio/doc.go new file mode 100644 index 00000000..82da8129 --- /dev/null +++ b/cmd/gogio/doc.go @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: Unlicense OR MIT + +/* +The gogio tool builds and packages Gio programs for Android, iOS/tvOS +and WebAssembly. + +Run gogio with no arguments for instructions, or see the examples at +https://gioui.org. +*/ +package main diff --git a/cmd/gio/gio.go b/cmd/gogio/gio.go similarity index 97% rename from cmd/gio/gio.go rename to cmd/gogio/gio.go index 58dd2633..dc4d6416 100644 --- a/cmd/gio/gio.go +++ b/cmd/gogio/gio.go @@ -49,7 +49,7 @@ func main() { } flag.Parse() if err := mainErr(); err != nil { - fmt.Fprintln(os.Stderr, err) + fmt.Fprintf(os.Stderr, "gogio: %v\n", err) os.Exit(1) } os.Exit(0) @@ -76,11 +76,11 @@ func mainErr() error { // Find package name. pkgPath, err := runCmd(exec.Command("go", "list", "-f", "{{.ImportPath}}", pkg)) if err != nil { - return fmt.Errorf("gio: %v", err) + return err } dir, err := runCmd(exec.Command("go", "list", "-f", "{{.Dir}}", pkg)) if err != nil { - return fmt.Errorf("gio: %v", err) + return err } elems := strings.Split(pkgPath, "/") name := elems[len(elems)-1] @@ -113,7 +113,7 @@ func mainErr() error { bi.ldflags = fmt.Sprintf("-X gioui.org/ui/app.extraArgs=%s", strings.Join(appArgs, "|")) } if err := build(bi); err != nil { - return fmt.Errorf("gio: %v", err) + return err } return nil } @@ -151,7 +151,7 @@ func appIDFromPackage(pkgPath string) string { } func build(bi *buildInfo) error { - tmpDir, err := ioutil.TempDir("", "gio-") + tmpDir, err := ioutil.TempDir("", "gogio-") if err != nil { return err } diff --git a/cmd/gio/gio_test.go b/cmd/gogio/gio_test.go similarity index 100% rename from cmd/gio/gio_test.go rename to cmd/gogio/gio_test.go diff --git a/cmd/gio/help.go b/cmd/gogio/help.go similarity index 87% rename from cmd/gio/help.go rename to cmd/gogio/help.go index 48d6a3b5..b9815263 100644 --- a/cmd/gio/help.go +++ b/cmd/gogio/help.go @@ -2,14 +2,14 @@ package main -const mainUsage = `The Gio command builds and packages Gio (gioui.org) programs. +const mainUsage = `The gogio command builds and packages Gio (gioui.org) programs. Usage: - gio -target [flags] [run arguments] + gogio -target [flags] [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 +where a single executable is sufficient. The gogio 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 @@ -38,7 +38,7 @@ 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 +iOS and tvOS. A bundle id must be provisioned through Xcode before the gogio tool can use it. The -version flag specifies the integer version for Android and the last @@ -47,5 +47,5 @@ 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. +The -x flag will print all the external commands executed by the gogio tool. ` diff --git a/cmd/gio/iosbuild.go b/cmd/gogio/iosbuild.go similarity index 100% rename from cmd/gio/iosbuild.go rename to cmd/gogio/iosbuild.go diff --git a/cmd/gio/jsbuild.go b/cmd/gogio/jsbuild.go similarity index 100% rename from cmd/gio/jsbuild.go rename to cmd/gogio/jsbuild.go