Code Monkey home page Code Monkey logo

mobile's Introduction

A gomobile fork compatible with Go-Module

Gomobile generates code in a temporary directory(/tmp/gomobile-work-xxxx) outside current project, so the generated code can't import go packages from project not under GOPATH.

To add support for Go Module, a simple and temporary solution is to generate wrapper code inside current project, let the generated code be a part of the project, so packages can be referenced correctly.

Modifications

  1. Add flag '-outdir' in gomobile and pass it to godind
  2. Gobind generates wrapper code in 'outdir', not in 'outdir/src/gobind'
  3. Invoke go build for code generated by gobind without modified GOPATH env
  4. Use pkg.Types as type package, remove imp.Import, because imp.Import failed with Go Module, and also it is extremely slow on my MacBook Pro.
  5. Reserve contents in 'outdir', for ease of diagnoisis

RISK

This program is not tested extensively, and only 'gomobile bind' is tested, other commands may not work, you should use it with care.

mobile's People

Contributors

crawshaw avatar hyangah avatar rakyll avatar nigeltao avatar dskinner avatar eliasnaur avatar hajimehoshi avatar adg avatar karalabe avatar tadovas avatar robpike avatar minux avatar meirf avatar alexbrainman avatar dsymonds avatar egonelbre avatar champo avatar rsc avatar pankona avatar timcooijmans avatar zllak avatar tenntenn avatar sridharv avatar kruffin avatar i9 avatar yjh0502 avatar gordonklaus avatar dmitshur avatar db47h avatar dopsilva avatar

Watchers

James Cloos avatar

Forkers

cestlavieliu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.