cmd/gomobile: find a better name for the app if import path is "."
Fixes golang/go#15779. Change-Id: I762e5ce12b8b76da80af73ddae26dbd46241f134 Reviewed-on: https://go-review.googlesource.com/23307 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
2922272407
commit
7c31375cc4
@ -106,7 +106,17 @@ func goIOSBuild(pkg *build.Package) (map[string]bool, error) {
|
|||||||
|
|
||||||
// TODO(jbd): Fallback to copying if renaming fails.
|
// TODO(jbd): Fallback to copying if renaming fails.
|
||||||
if buildO == "" {
|
if buildO == "" {
|
||||||
buildO = path.Base(pkg.ImportPath) + ".app"
|
n := pkg.ImportPath
|
||||||
|
if n == "." {
|
||||||
|
// use cwd name
|
||||||
|
cwd, err := os.Getwd()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("cannot create .app; cannot get the current working dir: %v", err)
|
||||||
|
}
|
||||||
|
n = cwd
|
||||||
|
}
|
||||||
|
n = path.Base(n)
|
||||||
|
buildO = n + ".app"
|
||||||
}
|
}
|
||||||
if buildX {
|
if buildX {
|
||||||
printcmd("mv %s %s", tmpdir+"/build/Release-iphoneos/main.app", buildO)
|
printcmd("mv %s %s", tmpdir+"/build/Release-iphoneos/main.app", buildO)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user