Android can only run c-shared libraries which means that every
Gio program must create its window and event loop from an init
function.
The same applies to iOS but for a more benign reason: the gio tool
builds programs in c-archive mode for iOS and links the binary with
a Objective-C driver.
Allow Gio programs to run off its main function by linking to and
invoking main even from Android libraries and iOS ditto.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Before this change `go list <pkg>` was used to sanitize the import
path of the package argument. That doesn't work well for building
Go source files directly:
gio -target android helloworld.go
where `go list helloworld.go` simply returns "command-line-arguments".
A better way is to leave the package path alone, and compute the
output file separately from the import path, as reported by
`go list -f {{.ImportPath}} <pkg>`.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Compressing resources.arsc result in warnings such as
"resources.arsc in APK '...' is compressed."
in the adb logs.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The verbose flag only triggered printing of commands, which is
traditionally named -x by other Go tools.
The -work flag will print and preserve the temporary directory.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
64-bit support was added in iOS 8 on iPhone 5S and newer,
32-bit support was dropped from iOS 12.
Gio is new and we have an opportunity to see if we can live without it.
We can always add 32-bit support back; it's harder to break users
later.
Signed-off-by: Elias Naur <mail@eliasnaur.com>