Browse Source

Squashed 'MobileLibrary/go-mobile/' changes from 43a03845..2782386b

2782386b go.mod: update golang.org/x dependencies
fa72adda all: replace ALooper_pollAll with ALooper_pollOnce
a1a533f2 go.mod: update golang.org/x dependencies
09dbf076 go.mod: update golang.org/x dependencies
755f4ef7 cmd/gomobile: fix error message to reflect current build target
365c3533 cmd/gomobile: add CFBundleShortVersionString and CFBundleVersion, fixing Apple validation/distribution
268e6c3a cmd/gomobile: produce frameworks which follow Apple's specs per platform, fixing Xcode 15.3 compatibility issues
c76e57ee all: remove the repetitive words
c58ccf4b go.mod: update golang.org/x dependencies
19e4cdff cmd/gomobile: fix a compatibility issue with Xcode 15.3
d1f7d343 go.mod: update golang.org/x dependencies
c713f31d go.mod: update golang.org/x dependencies
76ac6878 go.mod: update golang.org/x dependencies
35478a0c go.mod: update golang.org/x dependencies
2b44d118 go.mod: update golang.org/x dependencies
e2f45249 cmd/gomobile: resolve symbolic links as a workaround for an Xcode bug
2077a322 go.mod: update golang.org/x dependencies
dc64209e cmd/gomobile: add go statements to autogenerated go.mod files
fbe1c053 all: update Go version to 1.18
52620a4a all: upgrade dependencies
7088062f all: upgrade x/tools and its dependencies
3c911d8e cmd/gomobile: upgrade minimal javac version to 1.8
e8d11dd0 cmd/gobind: remove repeated definite articles
e0f57694 cmd/gomobile: update the doc about the minimum Android SDK version

git-subtree-dir: MobileLibrary/go-mobile
git-subtree-split: 2782386b8afd99b366f5d2b5738af9f2c82273a5
Rod Hynes 1 year ago
parent
commit
a2ebc38c06
64 changed files with 276 additions and 178 deletions
  1. 1 2
      app/android.go
  2. 0 1
      app/app.go
  3. 0 1
      app/darwin_desktop.go
  4. 0 1
      app/darwin_ios.go
  5. 0 2
      app/internal/callfn/callfn.go
  6. 0 1
      app/internal/testapp/testapp.go
  7. 0 1
      app/shiny.go
  8. 0 1
      app/x11.go
  9. 0 1
      asset/asset.go
  10. 0 2
      asset/asset_darwin_armx.go
  11. 0 1
      asset/asset_desktop.go
  12. 1 1
      bind/genobjc.go
  13. 0 1
      bind/implicit.go
  14. 0 1
      bind/testdata/testpkg/tagged.go
  15. 1 1
      cmd/gobind/doc.go
  16. 0 1
      cmd/gobind/implicit.go
  17. 26 5
      cmd/gomobile/bind.go
  18. 1 1
      cmd/gomobile/bind_androidapp.go
  19. 117 35
      cmd/gomobile/bind_iosapp.go
  20. 85 7
      cmd/gomobile/bind_test.go
  21. 1 1
      cmd/gomobile/build.go
  22. 4 4
      cmd/gomobile/doc.go
  23. 2 3
      cmd/gomobile/gendex.go
  24. 15 9
      cmd/gomobile/main.go
  25. 0 1
      cmd/gomobile/tools.go
  26. 0 1
      example/basic/main.go
  27. 0 1
      example/basic/main_x.go
  28. 0 1
      example/flappy/game.go
  29. 0 1
      example/flappy/main.go
  30. 0 1
      example/flappy/main_x.go
  31. 0 1
      example/ivy/tools.go
  32. 0 1
      example/network/main.go
  33. 0 1
      example/network/main_x.go
  34. 0 1
      exp/app/debug/fps.go
  35. 0 1
      exp/audio/al/al.go
  36. 0 1
      exp/audio/al/al_notandroid.go
  37. 0 1
      exp/audio/al/alc.go
  38. 0 1
      exp/audio/al/alc_notandroid.go
  39. 0 1
      exp/audio/al/const.go
  40. 0 1
      exp/f32/gen.go
  41. 0 1
      exp/font/font.go
  42. 0 1
      exp/font/font_linux.go
  43. 0 1
      exp/font/font_test.go
  44. 0 1
      exp/gl/glutil/context_darwin_desktop.go
  45. 0 1
      exp/gl/glutil/context_x11.go
  46. 0 1
      exp/gl/glutil/glimage.go
  47. 0 1
      exp/gl/glutil/glimage_test.go
  48. 0 1
      exp/gl/glutil/glutil.go
  49. 1 1
      exp/sensor/android.c
  50. 0 1
      exp/sensor/android.go
  51. 0 2
      exp/sensor/darwin_armx.go
  52. 0 1
      exp/sensor/notmobile.go
  53. 0 1
      exp/sprite/glsprite/glsprite.go
  54. 1 1
      geom/geom.go
  55. 1 3
      gl/gendebug.go
  56. 0 2
      gl/gl.go
  57. 0 2
      gl/gldebug.go
  58. 0 2
      gl/types_debug.go
  59. 0 2
      gl/types_prod.go
  60. 0 1
      gl/work.go
  61. 0 2
      gl/work_other.go
  62. 7 7
      go.mod
  63. 12 41
      go.sum
  64. 0 1
      internal/binres/genarsc.go

+ 1 - 2
app/android.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build android
-// +build android
 
 /*
 Android Apps are built with -buildmode=c-shared. They are loaded by a
@@ -366,7 +365,7 @@ func runInputQueue(vm, jniEnv, ctx uintptr) error {
 
 	var q *C.AInputQueue
 	for {
-		if C.ALooper_pollAll(-1, nil, nil, nil) == C.ALOOPER_POLL_WAKE {
+		if C.ALooper_pollOnce(-1, nil, nil, nil) == C.ALOOPER_POLL_WAKE {
 			select {
 			default:
 			case p := <-pending:

+ 0 - 1
app/app.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build linux || darwin || windows
-// +build linux darwin windows
 
 package app
 

+ 0 - 1
app/darwin_desktop.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin && !ios
-// +build darwin,!ios
 
 package app
 

+ 0 - 1
app/darwin_ios.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin && ios
-// +build darwin,ios
 
 package app
 

+ 0 - 2
app/internal/callfn/callfn.go

@@ -3,8 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build android && (arm || 386 || amd64 || arm64)
-// +build android
-// +build arm 386 amd64 arm64
 
 // Package callfn provides an android entry point.
 //

+ 0 - 1
app/internal/testapp/testapp.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux
-// +build darwin linux
 
 // Small test app used by app/app_test.go.
 package main

+ 0 - 1
app/shiny.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build windows
-// +build windows
 
 package app
 

+ 0 - 1
app/x11.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build linux && !android
-// +build linux,!android
 
 package app
 

+ 0 - 1
asset/asset.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || windows
-// +build darwin linux windows
 
 package asset
 

+ 0 - 2
asset/asset_darwin_armx.go

@@ -3,8 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin && (arm || arm64)
-// +build darwin
-// +build arm arm64
 
 package asset
 

+ 0 - 1
asset/asset_desktop.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build (linux && !android) || (darwin && !arm && !arm64) || windows
-// +build linux,!android darwin,!arm,!arm64 windows
 
 package asset
 

+ 1 - 1
bind/genobjc.go

@@ -977,7 +977,7 @@ func (g *ObjcGen) genInterfaceMethodProxy(obj *types.TypeName, m *types.Func) {
 
 	if isErrorType(obj.Type()) && m.Name() == "Error" {
 		// As a special case, ObjC NSErrors are passed to Go pretending to implement the Go error interface.
-		// They don't actually have an Error method, so calls to to it needs to be rerouted.
+		// They don't actually have an Error method, so calls to it needs to be rerouted.
 		g.Printf("%s = [o localizedDescription];\n", s.retParams[0].name)
 	} else {
 		if s.ret == "void" {

+ 0 - 1
bind/implicit.go

@@ -1,7 +1,6 @@
 // This file imports implicit dependencies required by generated code.
 
 //go:build mobile_implicit
-// +build mobile_implicit
 
 package bind
 

+ 0 - 1
bind/testdata/testpkg/tagged.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build aaa && bbb
-// +build aaa,bbb
 
 // This file tests that tags work with gomobile.
 package testpkg

+ 1 - 1
cmd/gobind/doc.go

@@ -218,7 +218,7 @@ to create an Android Activity subclass MainActivity:
 Gobind also recognizes Java interfaces as well as Objective C classes and
 protocols the same way.
 
-For more details on binding the the native API, see the design proposals,
+For more details on binding the native API, see the design proposals,
 https://golang.org/issues/16876 (Java) and https://golang.org/issues/17102
 (Objective C).
 

+ 0 - 1
cmd/gobind/implicit.go

@@ -1,7 +1,6 @@
 // This file imports implicit dependencies required by generated code.
 
 //go:build mobile_implicit
-// +build mobile_implicit
 
 package main
 

+ 26 - 5
cmd/gomobile/bind.go

@@ -44,7 +44,7 @@ example, in Android Studio (1.2+), an AAR file can be imported using
 the module import wizard (File > New > New Module > Import .JAR or
 .AAR package), and setting it as a new dependency
 (File > Project Structure > Dependencies).  This requires 'javac'
-(version 1.7+) and Android SDK (API level 16 or newer) to build the
+(version 1.8+) and Android SDK (API level 16 or newer) to build the
 library for Android. The ANDROID_HOME and ANDROID_NDK_HOME environment
 variables can be used to specify the Android SDK and NDK if they are
 not in the default locations. Use the -javapkg flag to specify the Java
@@ -251,7 +251,9 @@ func getModuleVersions(targetPlatform string, targetArch string, src string) (*m
 	}
 
 	f := &modfile.File{}
-	f.AddModuleStmt("gobind")
+	if err := f.AddModuleStmt("gobind"); err != nil {
+		return nil, err
+	}
 	e := json.NewDecoder(bytes.NewReader(output))
 	for {
 		var mod *Module
@@ -266,13 +268,19 @@ func getModuleVersions(targetPlatform string, targetArch string, src string) (*m
 					// replaced by a local directory
 					p = mod.Replace.Dir
 				}
-				f.AddReplace(mod.Path, mod.Version, p, v)
+				if err := f.AddReplace(mod.Path, mod.Version, p, v); err != nil {
+					return nil, err
+				}
 			} else {
 				// When the version part is empty, the module is local and mod.Dir represents the location.
 				if v := mod.Version; v == "" {
-					f.AddReplace(mod.Path, mod.Version, mod.Dir, "")
+					if err := f.AddReplace(mod.Path, mod.Version, mod.Dir, ""); err != nil {
+						return nil, err
+					}
 				} else {
-					f.AddRequire(mod.Path, v)
+					if err := f.AddRequire(mod.Path, v); err != nil {
+						return nil, err
+					}
 				}
 			}
 		}
@@ -280,6 +288,19 @@ func getModuleVersions(targetPlatform string, targetArch string, src string) (*m
 			break
 		}
 	}
+
+	v, err := ensureGoVersion()
+	if err != nil {
+		return nil, err
+	}
+	// ensureGoVersion can return an empty string for a devel version. In this case, use the minimum version.
+	if v == "" {
+		v = fmt.Sprintf("go1.%d", minimumGoMinorVersion)
+	}
+	if err := f.AddGoStmt(strings.TrimPrefix(v, "go")); err != nil {
+		return nil, err
+	}
+
 	return f, nil
 }
 

+ 1 - 1
cmd/gomobile/bind_androidapp.go

@@ -245,7 +245,7 @@ func buildAAR(srcDir, androidDir string, pkgs []*packages.Package, targets []tar
 }
 
 const (
-	javacTargetVer = "1.7"
+	javacTargetVer = "1.8"
 	minAndroidAPI  = 16
 )
 

+ 117 - 35
cmd/gomobile/bind_iosapp.go

@@ -5,6 +5,8 @@
 package main
 
 import (
+	"bytes"
+	"encoding/xml"
 	"errors"
 	"fmt"
 	"io"
@@ -13,6 +15,7 @@ import (
 	"strconv"
 	"strings"
 	"text/template"
+	"time"
 
 	"golang.org/x/sync/errgroup"
 	"golang.org/x/tools/go/packages"
@@ -149,9 +152,12 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo)
 		frameworkDirs = append(frameworkDirs, frameworkDir)
 		frameworkArchCount[frameworkDir] = frameworkArchCount[frameworkDir] + 1
 
-		versionsDir := filepath.Join(frameworkDir, "Versions")
-		versionsADir := filepath.Join(versionsDir, "A")
-		titlePath := filepath.Join(versionsADir, title)
+		frameworkLayout, err := frameworkLayoutForTarget(t, title)
+		if err != nil {
+			return err
+		}
+
+		titlePath := filepath.Join(frameworkDir, frameworkLayout.binaryPath, title)
 		if frameworkArchCount[frameworkDir] > 1 {
 			// Not the first static lib, attach to a fat library and skip create headers
 			fatCmd := exec.Command(
@@ -164,17 +170,8 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo)
 			continue
 		}
 
-		versionsAHeadersDir := filepath.Join(versionsADir, "Headers")
-		if err := mkdir(versionsAHeadersDir); err != nil {
-			return err
-		}
-		if err := symlink("A", filepath.Join(versionsDir, "Current")); err != nil {
-			return err
-		}
-		if err := symlink("Versions/Current/Headers", filepath.Join(frameworkDir, "Headers")); err != nil {
-			return err
-		}
-		if err := symlink(filepath.Join("Versions/Current", title), filepath.Join(frameworkDir, title)); err != nil {
+		headersDir := filepath.Join(frameworkDir, frameworkLayout.headerPath)
+		if err := mkdir(headersDir); err != nil {
 			return err
 		}
 
@@ -197,7 +194,7 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo)
 		if len(fileBases) == 1 {
 			headerFiles = append(headerFiles, title+".h")
 			err := copyFile(
-				filepath.Join(versionsAHeadersDir, title+".h"),
+				filepath.Join(headersDir, title+".h"),
 				filepath.Join(gobindDir, bindPrefix+title+".objc.h"),
 			)
 			if err != nil {
@@ -207,7 +204,7 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo)
 			for _, fileBase := range fileBases {
 				headerFiles = append(headerFiles, fileBase+".objc.h")
 				err := copyFile(
-					filepath.Join(versionsAHeadersDir, fileBase+".objc.h"),
+					filepath.Join(headersDir, fileBase+".objc.h"),
 					filepath.Join(gobindDir, fileBase+".objc.h"),
 				)
 				if err != nil {
@@ -215,14 +212,14 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo)
 				}
 			}
 			err := copyFile(
-				filepath.Join(versionsAHeadersDir, "ref.h"),
+				filepath.Join(headersDir, "ref.h"),
 				filepath.Join(gobindDir, "ref.h"),
 			)
 			if err != nil {
 				return err
 			}
 			headerFiles = append(headerFiles, title+".h")
-			err = writeFile(filepath.Join(versionsAHeadersDir, title+".h"), func(w io.Writer) error {
+			err = writeFile(filepath.Join(headersDir, title+".h"), func(w io.Writer) error {
 				return appleBindHeaderTmpl.Execute(w, map[string]interface{}{
 					"pkgs": pkgs, "title": title, "bases": fileBases,
 				})
@@ -232,14 +229,22 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo)
 			}
 		}
 
-		if err := mkdir(filepath.Join(versionsADir, "Resources")); err != nil {
-			return err
-		}
-		if err := symlink("Versions/Current/Resources", filepath.Join(frameworkDir, "Resources")); err != nil {
+		frameworkInfoPlistDir := filepath.Join(frameworkDir, frameworkLayout.infoPlistPath)
+		if err := mkdir(frameworkInfoPlistDir); err != nil {
 			return err
 		}
-		err = writeFile(filepath.Join(frameworkDir, "Resources", "Info.plist"), func(w io.Writer) error {
-			_, err := w.Write([]byte(appleBindInfoPlist))
+		err = writeFile(filepath.Join(frameworkInfoPlistDir, "Info.plist"), func(w io.Writer) error {
+			fmVersion := fmt.Sprintf("0.0.%d", time.Now().Unix())
+			infoFrameworkPlistlData := infoFrameworkPlistlData{
+				BundleID:       escapePlistValue(rfc1034Label(title)),
+				ExecutableName: escapePlistValue(title),
+				Version:        escapePlistValue(fmVersion),
+			}
+			infoplist := new(bytes.Buffer)
+			if err := infoFrameworkPlistTmpl.Execute(infoplist, infoFrameworkPlistlData); err != nil {
+				return err
+			}
+			_, err := w.Write(infoplist.Bytes())
 			return err
 		})
 		if err != nil {
@@ -253,15 +258,18 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo)
 			Module:  title,
 			Headers: headerFiles,
 		}
-		err = writeFile(filepath.Join(versionsADir, "Modules", "module.modulemap"), func(w io.Writer) error {
+		modulesDir := filepath.Join(frameworkDir, frameworkLayout.modulePath)
+		err = writeFile(filepath.Join(modulesDir, "module.modulemap"), func(w io.Writer) error {
 			return appleModuleMapTmpl.Execute(w, mmVals)
 		})
 		if err != nil {
 			return err
 		}
-		err = symlink(filepath.Join("Versions/Current/Modules"), filepath.Join(frameworkDir, "Modules"))
-		if err != nil {
-			return err
+
+		for src, dst := range frameworkLayout.symlinks {
+			if err := symlink(src, filepath.Join(frameworkDir, dst)); err != nil {
+				return err
+			}
 		}
 	}
 
@@ -269,6 +277,14 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo)
 	xcframeworkArgs := []string{"-create-xcframework"}
 
 	for _, dir := range frameworkDirs {
+		// On macOS, a temporary directory starts with /var, which is a symbolic link to /private/var.
+		// And in gomobile, a temporary directory is usually used as a working directly.
+		// Unfortunately, xcodebuild in Xcode 15 seems to have a bug and might not be able to understand fullpaths with symbolic links.
+		// As a workaround, resolve the path with symbolic links by filepath.EvalSymlinks.
+		dir, err := filepath.EvalSymlinks(dir)
+		if err != nil {
+			return err
+		}
 		xcframeworkArgs = append(xcframeworkArgs, "-framework", dir)
 	}
 
@@ -278,13 +294,79 @@ func goAppleBind(gobind string, pkgs []*packages.Package, targets []targetInfo)
 	return err
 }
 
-const appleBindInfoPlist = `<?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">
-      <dict>
-      </dict>
-    </plist>
-`
+type frameworkLayout struct {
+	headerPath    string
+	binaryPath    string
+	modulePath    string
+	infoPlistPath string
+	// symlinks to create in the framework. Maps src (relative to dst) -> dst (relative to framework bundle root)
+	symlinks map[string]string
+}
+
+// frameworkLayoutForTarget generates the filestructure for a framework for the given target platform (macos, ios, etc),
+// according to Apple's spec https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle
+func frameworkLayoutForTarget(t targetInfo, title string) (*frameworkLayout, error) {
+	switch t.platform {
+	case "macos", "maccatalyst":
+		return &frameworkLayout{
+			headerPath:    "Versions/A/Headers",
+			binaryPath:    "Versions/A",
+			modulePath:    "Versions/A/Modules",
+			infoPlistPath: "Versions/A/Resources",
+			symlinks: map[string]string{
+				"A":                                      "Versions/Current",
+				"Versions/Current/Resources":             "Resources",
+				"Versions/Current/Headers":               "Headers",
+				"Versions/Current/Modules":               "Modules",
+				filepath.Join("Versions/Current", title): title,
+			},
+		}, nil
+	case "ios", "iossimulator":
+		return &frameworkLayout{
+			headerPath:    "Headers",
+			binaryPath:    ".",
+			modulePath:    "Modules",
+			infoPlistPath: ".",
+		}, nil
+	}
+
+	return nil, fmt.Errorf("unsupported platform %q", t.platform)
+}
+
+type infoFrameworkPlistlData struct {
+	BundleID       string
+	ExecutableName string
+	Version        string
+}
+
+// infoFrameworkPlistTmpl is a template for the Info.plist file in a framework.
+// Minimum OS version == 100.0 is a workaround for SPM issue
+// https://github.com/firebase/firebase-ios-sdk/pull/12439/files#diff-f4eb4ff5ec89af999cbe8fa3ffe5647d7853ffbc9c1515b337ca043c684b6bb4R679
+var infoFrameworkPlistTmpl = template.Must(template.New("infoFrameworkPlist").Parse(`<?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">
+<dict>
+  <key>CFBundleExecutable</key>
+  <string>{{.ExecutableName}}</string>
+  <key>CFBundleIdentifier</key>
+  <string>{{.BundleID}}</string>
+  <key>MinimumOSVersion</key>
+  <string>100.0</string>
+  <key>CFBundleShortVersionString</key>
+  <string>{{.Version}}</string>
+  <key>CFBundleVersion</key>
+  <string>{{.Version}}</string>
+  <key>CFBundlePackageType</key>
+  <string>FMWK</string>
+</dict>
+</plist>
+`))
+
+func escapePlistValue(value string) string {
+	var b bytes.Buffer
+	xml.EscapeText(&b, []byte(value))
+	return b.String()
+}
 
 var appleModuleMapTmpl = template.Must(template.New("iosmmap").Parse(`framework module "{{.Module}}" {
 	header "ref.h"

+ 85 - 7
cmd/gomobile/bind_test.go

@@ -6,7 +6,6 @@ package main
 
 import (
 	"bytes"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -190,7 +189,7 @@ GOOS=android CGO_ENABLED=1 gobind -lang=go,java -outdir=$WORK{{if .JavaPkg}} -ja
 mkdir -p $WORK/src-android-arm
 PWD=$WORK/src-android-arm GOMODCACHE=$GOPATH/pkg/mod GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go mod tidy
 PWD=$WORK/src-android-arm GOMODCACHE=$GOPATH/pkg/mod GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go build -x -buildmode=c-shared -o=$WORK/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind
-PWD=$WORK/java javac -d $WORK/javac-output -source 1.7 -target 1.7 -bootclasspath {{.AndroidPlatform}}/android.jar *.java
+PWD=$WORK/java javac -d $WORK/javac-output -source 1.8 -target 1.8 -bootclasspath {{.AndroidPlatform}}/android.jar *.java
 jar c -C $WORK/javac-output .
 `))
 
@@ -251,16 +250,75 @@ func TestBindAppleAll(t *testing.T) {
 	}
 }
 
+const ambiguousPathsGoMod = `module ambiguouspaths
+
+go 1.18
+
+require golang.org/x/mobile v0.0.0-20230905140555-fbe1c053b6a9
+
+require (
+	golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 // indirect
+	golang.org/x/image v0.11.0 // indirect
+	golang.org/x/sys v0.11.0 // indirect
+)
+`
+
+const ambiguousPathsGoSum = `github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg=
+golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0=
+golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo=
+golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8=
+golang.org/x/mobile v0.0.0-20230905140555-fbe1c053b6a9 h1:LaLfQUz4L1tfuOlrtEouZLZ0qHDwKn87E1NKoiudP/o=
+golang.org/x/mobile v0.0.0-20230905140555-fbe1c053b6a9/go.mod h1:2jxcxt/JNJik+N+QcB8q308+SyrE3bu43+sGZDmJ02M=
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
+golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+`
+
+const ambiguousPathsGo = `package ambiguouspaths
+
+import (
+	_ "golang.org/x/mobile/app"
+)
+
+func Dummy() {}
+`
+
 func TestBindWithGoModules(t *testing.T) {
 	if runtime.GOOS == "android" || runtime.GOOS == "ios" {
 		t.Skipf("gomobile and gobind are not available on %s", runtime.GOOS)
 	}
 
-	dir, err := ioutil.TempDir("", "gomobile-test")
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer os.RemoveAll(dir)
+	dir := t.TempDir()
 
 	if out, err := exec.Command("go", "build", "-o="+dir, "golang.org/x/mobile/cmd/gobind").CombinedOutput(); err != nil {
 		t.Fatalf("%v: %s", err, string(out))
@@ -273,7 +331,22 @@ func TestBindWithGoModules(t *testing.T) {
 		path += string(filepath.ListSeparator) + p
 	}
 
+	// Create a source package dynamically to avoid go.mod files in this repository. See golang/go#34352 for more details.
+	if err := os.Mkdir(filepath.Join(dir, "ambiguouspaths"), 0755); err != nil {
+		t.Fatal(err)
+	}
+	if err := os.WriteFile(filepath.Join(dir, "ambiguouspaths", "go.mod"), []byte(ambiguousPathsGoMod), 0644); err != nil {
+		t.Fatal(err)
+	}
+	if err := os.WriteFile(filepath.Join(dir, "ambiguouspaths", "go.sum"), []byte(ambiguousPathsGoSum), 0644); err != nil {
+		t.Fatal(err)
+	}
+	if err := os.WriteFile(filepath.Join(dir, "ambiguouspaths", "ambiguouspaths.go"), []byte(ambiguousPathsGo), 0644); err != nil {
+		t.Fatal(err)
+	}
+
 	for _, target := range []string{"android", "ios"} {
+		target := target
 		t.Run(target, func(t *testing.T) {
 			switch target {
 			case "android":
@@ -308,6 +381,11 @@ func TestBindWithGoModules(t *testing.T) {
 					Path: "./bind/testdata/cgopkg",
 					Dir:  filepath.Join("..", ".."),
 				},
+				{
+					Name: "Ambiguous Paths",
+					Path: ".",
+					Dir:  filepath.Join(dir, "ambiguouspaths"),
+				},
 			}
 
 			for _, tc := range tests {

+ 1 - 1
cmd/gomobile/build.go

@@ -160,7 +160,7 @@ func runBuildImpl(cmd *command) (*packages.Package, error) {
 			return pkg, nil
 		}
 		if buildBundleID == "" {
-			return nil, fmt.Errorf("-target=ios requires -bundleid set")
+			return nil, fmt.Errorf("-target=%s requires -bundleid set", buildTarget)
 		}
 		nmpkgs, err = goAppleBuild(pkg, buildBundleID, targets)
 		if err != nil {

+ 4 - 4
cmd/gomobile/doc.go

@@ -52,7 +52,7 @@ example, in Android Studio (1.2+), an AAR file can be imported using
 the module import wizard (File > New > New Module > Import .JAR or
 .AAR package), and setting it as a new dependency
 (File > Project Structure > Dependencies).  This requires 'javac'
-(version 1.7+) and Android SDK (API level 15 or newer) to build the
+(version 1.7+) and Android SDK (API level 16 or newer) to build the
 library for Android. The environment variable ANDROID_HOME must be set
 to the path to Android SDK. Use the -javapkg flag to specify the Java
 package prefix for the generated classes.
@@ -113,7 +113,7 @@ Flag -iosversion sets the minimal version of the iOS SDK to compile against.
 The default version is 13.0.
 
 Flag -androidapi sets the Android API version to compile against.
-The default and minimum is 15.
+The default and minimum is 16.
 
 The -bundleid flag is required for -target ios and sets the bundle ID to use
 with the app.
@@ -132,9 +132,9 @@ Usage:
 
 	gomobile clean
 
-# Clean removes object files and cached NDK files downloaded by gomobile init
+Clean removes object files and cached NDK files downloaded by gomobile init.
 
-Build OpenAL for Android
+# Build OpenAL for Android
 
 Usage:
 

+ 2 - 3
cmd/gomobile/gendex.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build ignore
-// +build ignore
 
 // Gendex generates a dex file used by Go apps created with gomobile.
 //
@@ -74,8 +73,8 @@ func gendex() error {
 	}
 	cmd := exec.Command(
 		"javac",
-		"-source", "1.7",
-		"-target", "1.7",
+		"-source", "1.8",
+		"-target", "1.8",
 		"-bootclasspath", platform+"/android.jar",
 		"-d", tmpdir+"/work",
 	)

+ 15 - 9
cmd/gomobile/main.go

@@ -9,7 +9,6 @@ package main
 import (
 	"bufio"
 	"bytes"
-	"errors"
 	"flag"
 	"fmt"
 	"html/template"
@@ -24,9 +23,11 @@ import (
 
 var (
 	gomobileName = "gomobile"
-	goVersionOut = []byte(nil)
+	goVersion    string
 )
 
+const minimumGoMinorVersion = 18
+
 func printUsage(w io.Writer) {
 	bufw := bufio.NewWriter(w)
 	if err := usageTmpl.Execute(bufw, commands); err != nil {
@@ -58,7 +59,7 @@ func main() {
 		return
 	}
 
-	if err := determineGoVersion(); err != nil {
+	if _, err := ensureGoVersion(); err != nil {
 		fmt.Fprintf(os.Stderr, "%s: %v\n", gomobileName, err)
 		os.Exit(1)
 	}
@@ -84,20 +85,25 @@ func main() {
 	os.Exit(2)
 }
 
-func determineGoVersion() error {
+func ensureGoVersion() (string, error) {
+	if goVersion != "" {
+		return goVersion, nil
+	}
+
 	goVersionOut, err := exec.Command("go", "version").CombinedOutput()
 	if err != nil {
-		return fmt.Errorf("'go version' failed: %v, %s", err, goVersionOut)
+		return "", fmt.Errorf("'go version' failed: %v, %s", err, goVersionOut)
 	}
 	var minor int
 	if _, err := fmt.Sscanf(string(goVersionOut), "go version go1.%d", &minor); err != nil {
 		// Ignore unknown versions; it's probably a devel version.
-		return nil
+		return "", nil
 	}
-	if minor < 16 {
-		return errors.New("Go 1.16 or newer is required")
+	goVersion = fmt.Sprintf("go1.%d", minor)
+	if minor < minimumGoMinorVersion {
+		return "", fmt.Errorf("Go 1.%d or newer is required", minimumGoMinorVersion)
 	}
-	return nil
+	return goVersion, nil
 }
 
 func help(args []string) {

+ 0 - 1
cmd/gomobile/tools.go

@@ -1,7 +1,6 @@
 // This file includes the tools the gomobile depends on.
 
 //go:build tools
-// +build tools
 
 package main
 

+ 0 - 1
example/basic/main.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || windows
-// +build darwin linux windows
 
 // An app that draws a green triangle on a red background.
 //

+ 0 - 1
example/basic/main_x.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build !darwin && !linux && !windows
-// +build !darwin,!linux,!windows
 
 package main
 

+ 0 - 1
example/flappy/game.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux
-// +build darwin linux
 
 package main
 

+ 0 - 1
example/flappy/main.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux
-// +build darwin linux
 
 // Flappy Gopher is a simple one-button game that uses the
 // mobile framework and the experimental sprite engine.

+ 0 - 1
example/flappy/main_x.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build !darwin && !linux
-// +build !darwin,!linux
 
 package main
 

+ 0 - 1
example/ivy/tools.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build ignore
-// +build ignore
 
 package dummy
 

+ 0 - 1
example/network/main.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || windows
-// +build darwin linux windows
 
 // An app that paints green if golang.org is reachable when the app first
 // starts, or red otherwise.

+ 0 - 1
example/network/main_x.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build !darwin && !linux && !windows
-// +build !darwin,!linux,!windows
 
 package main
 

+ 0 - 1
exp/app/debug/fps.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || windows
-// +build darwin linux windows
 
 // Package debug provides GL-based debugging tools for apps.
 package debug // import "golang.org/x/mobile/exp/app/debug"

+ 0 - 1
exp/audio/al/al.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || windows
-// +build darwin linux windows
 
 // Package al provides OpenAL Soft bindings for Go.
 //

+ 0 - 1
exp/audio/al/al_notandroid.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || (linux && !android) || windows
-// +build darwin linux,!android windows
 
 package al
 

+ 0 - 1
exp/audio/al/alc.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || windows
-// +build darwin linux windows
 
 package al
 

+ 0 - 1
exp/audio/al/alc_notandroid.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || (linux && !android) || windows
-// +build darwin linux,!android windows
 
 package al
 

+ 0 - 1
exp/audio/al/const.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || windows
-// +build darwin linux windows
 
 package al
 

+ 0 - 1
exp/f32/gen.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build ignore
-// +build ignore
 
 package main
 

+ 0 - 1
exp/font/font.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build linux || darwin
-// +build linux darwin
 
 package font
 

+ 0 - 1
exp/font/font_linux.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build !android
-// +build !android
 
 package font
 

+ 0 - 1
exp/font/font_test.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build linux || darwin
-// +build linux darwin
 
 package font
 

+ 0 - 1
exp/gl/glutil/context_darwin_desktop.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin && !ios
-// +build darwin,!ios
 
 package glutil
 

+ 0 - 1
exp/gl/glutil/context_x11.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build linux && !android
-// +build linux,!android
 
 package glutil
 

+ 0 - 1
exp/gl/glutil/glimage.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build linux || darwin || windows
-// +build linux darwin windows
 
 package glutil
 

+ 0 - 1
exp/gl/glutil/glimage_test.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || (linux && !android)
-// +build darwin linux,!android
 
 // TODO(crawshaw): Run tests on other OSs when more contexts are supported.
 

+ 0 - 1
exp/gl/glutil/glutil.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || windows
-// +build darwin linux windows
 
 package glutil // import "golang.org/x/mobile/exp/gl/glutil"
 

+ 1 - 1
exp/sensor/android.c

@@ -61,7 +61,7 @@ int GoAndroid_readQueue(int n, int32_t* types, int64_t* timestamps, float* vecto
   // Try n times read from the event queue.
   // If anytime timeout occurs, don't retry to read and immediately return.
   // Consume the event queue entirely between polls.
-  while (i < n && (id = ALooper_pollAll(GO_ANDROID_READ_TIMEOUT_MS, NULL, &events, NULL)) >= 0) {
+  while (i < n && (id = ALooper_pollOnce(GO_ANDROID_READ_TIMEOUT_MS, NULL, &events, NULL)) >= 0) {
     if (id != GO_ANDROID_SENSOR_LOOPER_ID) {
       continue;
     }

+ 0 - 1
exp/sensor/android.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build android
-// +build android
 
 package sensor
 

+ 0 - 2
exp/sensor/darwin_armx.go

@@ -3,8 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin && (arm || arm64)
-// +build darwin
-// +build arm arm64
 
 package sensor
 

+ 0 - 1
exp/sensor/notmobile.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build (linux && !android) || (darwin && !arm && !arm64) || windows
-// +build linux,!android darwin,!arm,!arm64 windows
 
 package sensor
 

+ 0 - 1
exp/sprite/glsprite/glsprite.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || windows
-// +build darwin linux windows
 
 // Package glsprite implements a sprite Engine using OpenGL ES 2.
 //

+ 1 - 1
geom/geom.go

@@ -74,7 +74,7 @@ import "fmt"
 //
 // The unit Pt is a typographical point, 1/72 of an inch (0.3527 mm).
 //
-// It can be be converted to a length in current device pixels by
+// It can be converted to a length in current device pixels by
 // multiplying with PixelsPerPt after app initialization is complete.
 type Pt float32
 

+ 1 - 3
gl/gendebug.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build ignore
-// +build ignore
 
 // The gendebug program takes gl.go and generates a version of it
 // where each function includes tracing code that writes its arguments
@@ -885,8 +884,7 @@ const preamble = `// Copyright 2014 The Go Authors.  All rights reserved.
 // Code generated from gl.go using go generate. DO NOT EDIT.
 // See doc.go for details.
 
-// +build darwin linux openbsd windows
-// +build gldebug
+//go:build (darwin || linux || openbsd || windows) && gldebug
 
 package gl
 

+ 0 - 2
gl/gl.go

@@ -3,8 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build (darwin || linux || openbsd || windows) && !gldebug
-// +build darwin linux openbsd windows
-// +build !gldebug
 
 package gl
 

+ 0 - 2
gl/gldebug.go

@@ -6,8 +6,6 @@
 // See doc.go for details.
 
 //go:build (darwin || linux || openbsd || windows) && gldebug
-// +build darwin linux openbsd windows
-// +build gldebug
 
 package gl
 

+ 0 - 2
gl/types_debug.go

@@ -3,8 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build (darwin || linux || openbsd || windows) && gldebug
-// +build darwin linux openbsd windows
-// +build gldebug
 
 package gl
 

+ 0 - 2
gl/types_prod.go

@@ -3,8 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build (darwin || linux || openbsd || windows) && !gldebug
-// +build darwin linux openbsd windows
-// +build !gldebug
 
 package gl
 

+ 0 - 1
gl/work.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build darwin || linux || openbsd
-// +build darwin linux openbsd
 
 package gl
 

+ 0 - 2
gl/work_other.go

@@ -3,8 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build (!cgo || (!darwin && !linux && !openbsd)) && !windows
-// +build !cgo !darwin,!linux,!openbsd
-// +build !windows
 
 package gl
 

+ 7 - 7
go.mod

@@ -1,13 +1,13 @@
 module golang.org/x/mobile
 
-go 1.17
+go 1.18
 
 require (
-	golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56
-	golang.org/x/image v0.0.0-20190802002840-cff245a6509b
-	golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
-	golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde
-	golang.org/x/tools v0.1.12
+	golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63
+	golang.org/x/image v0.17.0
+	golang.org/x/mod v0.18.0
+	golang.org/x/sync v0.7.0
+	golang.org/x/tools v0.22.0
 )
 
-require golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
+require golang.org/x/sys v0.21.0 // indirect

+ 12 - 41
go.sum

@@ -1,41 +1,12 @@
-github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
-github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 h1:estk1glOnSVeJ9tdEZZc5mAMDZk5lNJNyJ6DvrBkTEU=
-golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
-golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
-golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=
-golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
-golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
-golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
-golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
-golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc=
-golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
-golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
-golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
-golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 h1:3AGKexOYqL+ztdWdkB1bDwXgPBuTS/S8A4WzuTvJ8Cg=
+golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0=
+golang.org/x/image v0.17.0 h1:nTRVVdajgB8zCMZVsViyzhnMKPwYeroEERRC64JuLco=
+golang.org/x/image v0.17.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
+golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
+golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
+golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
+golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
+golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=

+ 0 - 1
internal/binres/genarsc.go

@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build ignore
-// +build ignore
 
 // Genarsc generates stripped down version of android.jar resources used
 // for validation of manifest entries.