2
0
mirror of synced 2025-02-24 07:18:15 +00:00
mobile/misc/androidstudio
Elias Naur d8b1e1aab8 bind,misc: guard reverse generated import with mobile os tags
Running go get golang.org/x/mobile/... results in errors because the
go tool fails to find the reverse generated Java ("Java/...") and
Objective-C ("ObjC/...") packages. Work around the errors by adding
the android and ios tags, respectively, to files importing those
packages.

The gobind gradle plugin is updated to pass along GOOS=android to
ensure the gobind tool continues to build Android reverse packages.

Fixes golang/go#17750

Change-Id: Id66a3c6cdfe249c6ed494192eb12195d6509332f
Reviewed-on: https://go-review.googlesource.com/34956
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-01-17 14:22:42 +00:00
..

gobindPlugin invokes gomobile bind command on the specified package.

Usage

build.gradle:

plugins {
  id "org.golang.mobile.bind" version "0.2.6"
}

gobind {
  // Package to bind. Separate multiple packages with spaces.
  pkg="github.com/someone/somepackage"

  // GOPATH
  GOPATH="/home/gopher"

  // Optional list of architectures. Defaults to all supported architectures.
  GOARCH="arm amd64"

  // Absolute path to the gomobile binary. Optional.
  GOMOBILE="/mypath/bin/gomobile"

  // Absolute path to the gobind binary. Optional.
  GOBIND="/mypath/bin/gobind"

  // Absolute path to the go binary. Optional.
  GO="/usr/local/go/bin/go"

  // Pass extra parameters to command line. Optional.
  GOMOBILEFLAGS="-javapkg my.java.package"
}

For details: https://plugins.gradle.org/plugin/org.golang.mobile.bind

TODO

  • Find the stale aar file (how?)