cmd/gio: use the import path as basis for the output file

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>
This commit is contained in:
Elias Naur
2019-07-13 20:19:25 +02:00
parent 41990e3275
commit cde040369c
4 changed files with 13 additions and 9 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ import (
)
func buildIOS(tmpDir, target string, bi *buildInfo) error {
appName := filepath.Base(bi.pkg)
appName := bi.name
switch *buildMode {
case "archive":
framework := *destPath
@@ -174,7 +174,7 @@ int main(int argc, char * argv[]) {
if _, err := runCmd(lipo); err != nil {
return err
}
appName := strings.Title(filepath.Base(bi.pkg))
appName := strings.Title(bi.name)
infoPlistSrc := fmt.Sprintf(`<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">