Skip to content

Commit

Permalink
fix(android-build): check for mandatory java version
Browse files Browse the repository at this point in the history
  • Loading branch information
n0izn0iz committed Nov 28, 2019
1 parent ded566c commit 6f2a035
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build/shell/check-java.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

JAVA_VER=$(java -version 2>&1 | sed -n ';s/.* version "\(.*\)\.\(.*\)\..*"/\1\2/p;')
if [ "$JAVA_VER" != "$1" ] ; then
>&2 echo "ERROR: Invalid java version, want $1, got $JAVA_VER"
exit 1
fi
3 changes: 3 additions & 0 deletions js/packages/berty-app/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export PWD := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
export PATH := $(PWD)/node_modules/.bin:$(PATH)

berty_root ?= $(abspath $(PWD)/../../..)

react-native := $(PWD)/node_modules/.bin/react-native
pod := pod
bundle := bundle
Expand Down Expand Up @@ -76,6 +78,7 @@ start: deps
.PHONY: run
run: export PWD := $(PWD)
run: deps $(if $(filter $(target), debug), start)
$(if $(filter $(platform), android), @$(berty_root)/build/shell/check-java.sh 18)
$(if $(filter $(platform), android), \
$(if $(filter $(config), development), ANDROID_SDK_ROOT=$$HOME/.android clisim -af))
cd $(PWD) && $(react-native) run-$(platform) \
Expand Down

0 comments on commit 6f2a035

Please sign in to comment.