You've already forked gomobile-tvos-fork
mirror of
https://github.com/netbirdio/gomobile-tvos-fork.git
synced 2026-05-22 18:43:29 -07:00
Update module path and rename binaries to netbird-specific names
- Changed module path from golang.org/x/mobile to github.com/netbirdio/gomobile-tvos-fork - Renamed gomobile → gomobile-netbird - Renamed gobind → gobind-netbird - Updated all internal imports - Updated README.md with new installation and usage instructions
This commit is contained in:
@@ -20,26 +20,26 @@ This fork extends gomobile to support building Go libraries for tvOS and tvOS Si
|
||||
### Building for tvOS
|
||||
|
||||
```bash
|
||||
gomobile bind -target=tvos ./package
|
||||
gomobile-netbird bind -target=tvos ./package
|
||||
```
|
||||
|
||||
### Building for tvOS Simulator
|
||||
|
||||
```bash
|
||||
gomobile bind -target=tvossimulator ./package
|
||||
gomobile-netbird bind -target=tvossimulator ./package
|
||||
```
|
||||
|
||||
### Building an XCFramework with tvOS Support
|
||||
|
||||
```bash
|
||||
gomobile bind -target=ios,iossimulator,tvos,tvossimulator -o MyFramework.xcframework ./package
|
||||
gomobile-netbird bind -target=ios,iossimulator,tvos,tvossimulator -o MyFramework.xcframework ./package
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
go install github.com/netbirdio/gomobile-tvos-fork/cmd/gomobile@latest
|
||||
go install github.com/netbirdio/gomobile-tvos-fork/cmd/gobind@latest
|
||||
go install github.com/netbirdio/gomobile-tvos-fork/cmd/gomobile-netbird@latest
|
||||
go install github.com/netbirdio/gomobile-tvos-fork/cmd/gobind-netbird@latest
|
||||
```
|
||||
|
||||
## Original Project
|
||||
|
||||
+8
-8
@@ -51,14 +51,14 @@ import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/mobile/app/internal/callfn"
|
||||
"golang.org/x/mobile/event/key"
|
||||
"golang.org/x/mobile/event/lifecycle"
|
||||
"golang.org/x/mobile/event/paint"
|
||||
"golang.org/x/mobile/event/size"
|
||||
"golang.org/x/mobile/event/touch"
|
||||
"golang.org/x/mobile/geom"
|
||||
"golang.org/x/mobile/internal/mobileinit"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/app/internal/callfn"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/key"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/lifecycle"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/paint"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/size"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/touch"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/geom"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/mobileinit"
|
||||
)
|
||||
|
||||
// RunOnJVM runs fn on a new goroutine locked to an OS thread with a JNIEnv.
|
||||
|
||||
+5
-5
@@ -7,10 +7,10 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"golang.org/x/mobile/event/lifecycle"
|
||||
"golang.org/x/mobile/event/size"
|
||||
"golang.org/x/mobile/gl"
|
||||
_ "golang.org/x/mobile/internal/mobileinit"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/lifecycle"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/size"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/gl"
|
||||
_ "github.com/netbirdio/gomobile-tvos-fork/internal/mobileinit"
|
||||
)
|
||||
|
||||
// Main is called by the main.main function to run the mobile application.
|
||||
@@ -30,7 +30,7 @@ type App interface {
|
||||
// - paint.Event
|
||||
// - size.Event
|
||||
// - touch.Event
|
||||
// from the golang.org/x/mobile/event/etc packages. Other packages may
|
||||
// from the github.com/netbirdio/gomobile-tvos-fork/event/etc packages. Other packages may
|
||||
// define other event types that are carried on this channel.
|
||||
Events() <-chan interface{}
|
||||
|
||||
|
||||
+3
-3
@@ -16,8 +16,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"golang.org/x/mobile/app/internal/apptest"
|
||||
"golang.org/x/mobile/event/size"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/app/internal/apptest"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/size"
|
||||
)
|
||||
|
||||
// TestAndroidApp tests the lifecycle, event, and window semantics of a
|
||||
@@ -66,7 +66,7 @@ func TestAndroidApp(t *testing.T) {
|
||||
}
|
||||
defer os.Chdir(origWD)
|
||||
|
||||
run(t, "gomobile", "install", "golang.org/x/mobile/app/internal/testapp")
|
||||
run(t, "gomobile", "install", "github.com/netbirdio/gomobile-tvos-fork/app/internal/testapp")
|
||||
|
||||
ln, err := net.Listen("tcp4", "localhost:0")
|
||||
if err != nil {
|
||||
|
||||
@@ -28,12 +28,12 @@ import (
|
||||
"runtime"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/mobile/event/key"
|
||||
"golang.org/x/mobile/event/lifecycle"
|
||||
"golang.org/x/mobile/event/paint"
|
||||
"golang.org/x/mobile/event/size"
|
||||
"golang.org/x/mobile/event/touch"
|
||||
"golang.org/x/mobile/geom"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/key"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/lifecycle"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/paint"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/size"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/touch"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/geom"
|
||||
)
|
||||
|
||||
var initThreadID uint64
|
||||
|
||||
+5
-5
@@ -29,11 +29,11 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/mobile/event/lifecycle"
|
||||
"golang.org/x/mobile/event/paint"
|
||||
"golang.org/x/mobile/event/size"
|
||||
"golang.org/x/mobile/event/touch"
|
||||
"golang.org/x/mobile/geom"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/lifecycle"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/paint"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/size"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/touch"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/geom"
|
||||
)
|
||||
|
||||
var initThreadID uint64
|
||||
|
||||
+10
-10
@@ -10,7 +10,7 @@ is to write a Go library and use `gomobile bind` to generate language
|
||||
bindings for Java and Objective-C. Building a library does not
|
||||
require the app package. The `gomobile bind` command produces output
|
||||
that you can include in an Android Studio or Xcode project. For more
|
||||
on language bindings, see https://golang.org/x/mobile/cmd/gobind.
|
||||
on language bindings, see https://github.com/netbirdio/gomobile-tvos-fork/cmd/gobind.
|
||||
|
||||
The second way is to write an app entirely in Go. The APIs are limited
|
||||
to those that are portable between both Android and iOS, in particular
|
||||
@@ -25,7 +25,7 @@ with `gomobile build`, which directly produces runnable output for
|
||||
Android and iOS.
|
||||
|
||||
The gomobile tool can get installed with go get. For reference, see
|
||||
https://golang.org/x/mobile/cmd/gomobile.
|
||||
https://github.com/netbirdio/gomobile-tvos-fork/cmd/gomobile.
|
||||
|
||||
For detailed instructions and documentation, see
|
||||
https://golang.org/wiki/Mobile.
|
||||
@@ -47,9 +47,9 @@ goroutine as other code that calls OpenGL.
|
||||
import (
|
||||
"log"
|
||||
|
||||
"golang.org/x/mobile/app"
|
||||
"golang.org/x/mobile/event/lifecycle"
|
||||
"golang.org/x/mobile/event/paint"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/app"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/lifecycle"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/paint"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -69,11 +69,11 @@ goroutine as other code that calls OpenGL.
|
||||
An event is represented by the empty interface type interface{}. Any value can
|
||||
be an event. Commonly used types include Event types defined by the following
|
||||
packages:
|
||||
- golang.org/x/mobile/event/lifecycle
|
||||
- golang.org/x/mobile/event/mouse
|
||||
- golang.org/x/mobile/event/paint
|
||||
- golang.org/x/mobile/event/size
|
||||
- golang.org/x/mobile/event/touch
|
||||
- github.com/netbirdio/gomobile-tvos-fork/event/lifecycle
|
||||
- github.com/netbirdio/gomobile-tvos-fork/event/mouse
|
||||
- github.com/netbirdio/gomobile-tvos-fork/event/paint
|
||||
- github.com/netbirdio/gomobile-tvos-fork/event/size
|
||||
- github.com/netbirdio/gomobile-tvos-fork/event/touch
|
||||
|
||||
For example, touch.Event is the type that represents touch events. Other
|
||||
packages may define their own events, and send them on an app's event channel.
|
||||
|
||||
@@ -11,13 +11,13 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
|
||||
"golang.org/x/mobile/app"
|
||||
"golang.org/x/mobile/app/internal/apptest"
|
||||
"golang.org/x/mobile/event/lifecycle"
|
||||
"golang.org/x/mobile/event/paint"
|
||||
"golang.org/x/mobile/event/size"
|
||||
"golang.org/x/mobile/event/touch"
|
||||
"golang.org/x/mobile/gl"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/app"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/app/internal/apptest"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/lifecycle"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/paint"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/size"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/touch"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/gl"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
+4
-4
@@ -11,10 +11,10 @@ import (
|
||||
|
||||
"golang.org/x/exp/shiny/driver/gldriver"
|
||||
"golang.org/x/exp/shiny/screen"
|
||||
"golang.org/x/mobile/event/lifecycle"
|
||||
"golang.org/x/mobile/event/mouse"
|
||||
"golang.org/x/mobile/event/touch"
|
||||
"golang.org/x/mobile/gl"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/lifecycle"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/mouse"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/touch"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/gl"
|
||||
)
|
||||
|
||||
func main(f func(a App)) {
|
||||
|
||||
+5
-5
@@ -24,11 +24,11 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"golang.org/x/mobile/event/lifecycle"
|
||||
"golang.org/x/mobile/event/paint"
|
||||
"golang.org/x/mobile/event/size"
|
||||
"golang.org/x/mobile/event/touch"
|
||||
"golang.org/x/mobile/geom"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/lifecycle"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/paint"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/size"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/event/touch"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/geom"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -38,7 +38,7 @@ import (
|
||||
"sync"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/mobile/internal/mobileinit"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/mobileinit"
|
||||
)
|
||||
|
||||
var assetOnce sync.Once
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
//
|
||||
// See the documentation on the gobind command for usage details
|
||||
// and the list of currently supported types.
|
||||
// (http://godoc.org/golang.org/x/mobile/cmd/gobind)
|
||||
// (http://godoc.org/github.com/netbirdio/gomobile-tvos-fork/cmd/gobind)
|
||||
package bind
|
||||
|
||||
// TODO(crawshaw): slice support
|
||||
|
||||
+3
-3
@@ -24,9 +24,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/mobile/internal/importers"
|
||||
"golang.org/x/mobile/internal/importers/java"
|
||||
"golang.org/x/mobile/internal/importers/objc"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/importers"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/importers/java"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/importers/objc"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
+3
-3
@@ -12,8 +12,8 @@ import (
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"golang.org/x/mobile/internal/importers"
|
||||
"golang.org/x/mobile/internal/importers/java"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/importers"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/importers/java"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -940,7 +940,7 @@ import "C"
|
||||
|
||||
import (
|
||||
"Java"
|
||||
_seq "golang.org/x/mobile/bind/seq"
|
||||
_seq "github.com/netbirdio/gomobile-tvos-fork/bind/seq"
|
||||
)
|
||||
|
||||
`
|
||||
|
||||
+1
-1
@@ -516,7 +516,7 @@ func (g *goGen) genPreamble() {
|
||||
g.Printf(goPreamble, pkgName, pkgPath)
|
||||
g.Printf("import (\n")
|
||||
g.Indent()
|
||||
g.Printf("_seq \"golang.org/x/mobile/bind/seq\"\n")
|
||||
g.Printf("_seq \"github.com/netbirdio/gomobile-tvos-fork/bind/seq\"\n")
|
||||
for _, imp := range g.imports {
|
||||
g.Printf("%s\n", imp)
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/mobile/internal/importers/java"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/importers/java"
|
||||
)
|
||||
|
||||
// TODO(crawshaw): disallow basic android java type names in exported symbols.
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import (
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/mobile/internal/importers/objc"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/importers/objc"
|
||||
)
|
||||
|
||||
// TODO(hyangah): handle method name conflicts.
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/mobile/internal/importers/objc"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/importers/objc"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -318,7 +318,7 @@ func (g *ObjcWrapper) GenGo() {
|
||||
g.Printf("// #include \"interfaces.h\"\n")
|
||||
g.Printf("import \"C\"\n\n")
|
||||
g.Printf("import \"ObjC\"\n")
|
||||
g.Printf("import _seq \"golang.org/x/mobile/bind/seq\"\n")
|
||||
g.Printf("import _seq \"github.com/netbirdio/gomobile-tvos-fork/bind/seq\"\n")
|
||||
|
||||
for _, n := range g.types {
|
||||
for _, f := range n.Funcs {
|
||||
|
||||
+1
-1
@@ -5,5 +5,5 @@
|
||||
package bind
|
||||
|
||||
import (
|
||||
_ "golang.org/x/mobile/bind/seq"
|
||||
_ "github.com/netbirdio/gomobile-tvos-fork/bind/seq"
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/mobile/internal/mobileinit"
|
||||
"github.com/netbirdio/gomobile-tvos-fork/internal/mobileinit"
|
||||
)
|
||||
|
||||
//export setContext
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user