Skip to content

Commit

Permalink
Added support for building mobile library without docker
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Dec 29, 2015
1 parent ce2a900 commit 8d401d4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,20 @@ android-lib: docker-mobile
echo "cp -v $(LANTERN_MOBILE_DIR)/$(LANTERN_MOBILE_LIBRARY) \$$FIRETWEET_MAIN_DIR"; \
fi

android-lib-local:
@source setenv.bash && \
cd $(LANTERN_MOBILE_DIR) && \
gomobile bind -target=android -o=$(LANTERN_MOBILE_LIBRARY) -ldflags="$(LDFLAGS)" . && \
if [ -d "$(FIRETWEET_MAIN_DIR)" ]; then \
cp -v $(LANTERN_MOBILE_DIR)/$(LANTERN_MOBILE_LIBRARY) $(FIRETWEET_MAIN_DIR)/libs/$(LANTERN_MOBILE_LIBRARY); \
else \
echo ""; \
echo "Either no FIRETWEET_MAIN_DIR variable was passed or the given value is not a";\
echo "directory. You'll have to copy the $(LANTERN_MOBILE_LIBRARY) file manually:"; \
echo ""; \
echo "cp -v $(LANTERN_MOBILE_DIR)/$(LANTERN_MOBILE_LIBRARY) \$$FIRETWEET_MAIN_DIR"; \
fi

android-lib-dist: genconfig android-lib

clean:
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,29 @@ FIRETWEET_MAIN_DIR=/path/to/firetweet/src/main make android-lib
You can also override this environment variable if you want to use the
[Flashlight Android Tester](https://github.com/getlantern/lantern-mobile-single-app-example) app.

#### Creating the Android library without docker

1. Install Java JDK 7 or 8
2. Install [Android SDK Tools](http://developer.android.com/sdk/index.html#Other)
3. Install NDK(http://developer.android.com/ndk/downloads/index.html)
4. Install lantern's [fork of gomobile](https://github.com/getlantern/mobile)

Useful environment variables (replace the paths based on wherever you've
installed the Android SDK and NDK).

```bash
export ANDROID_HOME=/opt/adt-bundle-mac-x86_64-20130917/sdk
export PATH=$ANDROID_HOME/tools:$PATH
export NDK_HOME=/opt/android-ndk-r10e
export PATH=$NDK_HOME:$PATH
```
)

Then to build the library:

```bash
make android-lib-local
```

### Generating assets

Expand Down

0 comments on commit 8d401d4

Please sign in to comment.