Skip to content

Commit

Permalink
Updating readme and CLI options to support linux+android development. (
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusdrw authored Mar 24, 2017
1 parent c4aa9b8 commit d739e3d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,32 @@

```
./setup_macos.sh
echo "ndk.dir=$NDK_HOME" > android/local.properties
echo "sdk.dir=$ANDROID_HOME" >> android/local.properties
```
- linux
```
./setup_linux.sh
echo "ndk.dir=$NDK_HOME" > android/local.properties
echo "sdk.dir=$ANDROID_HOME" >> android/local.properties
```
### usage
- iOS
```
make -C rust/signer ios
react-native run-ios
npm run ios
```
- Android
```
make -C rust/signer android
react-native run-android
npm run android
```
### Example
Expand Down
4 changes: 2 additions & 2 deletions create-ndk-standalone.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/bash

# based on https://github.com/kennytm/rust-ios-android

Expand All @@ -13,7 +13,7 @@ fi
MAKER="$NDK_HOME/build/tools/make_standalone_toolchain.py"

if [ -x "$MAKER" ]; then
MAKER="$(brew --prefix android-ndk)/build/tools/make_standalone_toolchain.py"
MAKER="$NDK_HOME/build/tools/make_standalone_toolchain.py"
fi

if [ -x "$MAKER" ]; then
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
"version": "0.0.1",
"private": true,
"scripts": {
"build-rust": "cd rust/signer && make ios",
"start": "npm run build-rust && node node_modules/react-native/local-cli/cli.js run-ios",
"build-rust-ios": "cd rust/signer && make ios",
"ios": "npm run build-rust-ios && npm run cli run-ios",
"build-rust-android": "cd rust/signer && make android",
"android": "npm run build-rust-android && npm run cli run-android",
"cli": "node node_modules/react-native/local-cli/cli.js",
"start": "npm run ios",
"test": "jest",
"lint": "standard",
"commit": "commit-wizard"
Expand Down
2 changes: 2 additions & 0 deletions setup_linux.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#! /bin/bash

set -e

# android
multirust add-target stable aarch64-linux-android
multirust add-target stable armv7-linux-androideabi
Expand Down
2 changes: 2 additions & 0 deletions setup_macos.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#! /bin/bash

set -e

# ios
multirust add-target stable i386-apple-ios
multirust add-target stable x86_64-apple-ios
Expand Down

0 comments on commit d739e3d

Please sign in to comment.