Simplify setup script and fix Android build when setting up from scratch

- gradle was being called without `npm install` having had a chance to execute

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2018-08-30 16:14:17 +02:00
parent 3d6c2855be
commit b7b6a252e1
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
3 changed files with 10 additions and 13 deletions

View File

@ -3,6 +3,8 @@
help: ##@other Show this help
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
OS := $(shell uname)
# This is a code for automatic help generator.
# It supports ANSI colors and categories.
# To add new item into help output, simply add comments
@ -27,7 +29,7 @@ HELP_FUN = \
# Main targets
clean: ##@prepare Remove all output folders
git clean -qdxf -f modules/react-native-status/ node_modules/ target/ desktop/modules/ desktop/node_modules/
git clean -qdxf -f android/ modules/react-native-status/ node_modules/ target/ desktop/modules/ desktop/node_modules/
setup: ##@prepare Install all the requirements for status-react
./scripts/setup
@ -38,10 +40,12 @@ prepare: ##@prepare Install dependencies and prepare workspace
prepare-ios: prepare ##@prepare Install iOS specific dependencies
mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack
cd ios && pod install && cd ..
ifeq ($(OS),Darwin)
cd ios && pod install
endif
prepare-android: prepare ##@prepare Install Android specific dependencies
cd android; ./gradlew react-native-android:installArchives
cd android && ./gradlew react-native-android:installArchives
#----------------
# Release builds

View File

@ -333,7 +333,4 @@ function install_android_ndk() {
echo "ndk.dir=$_ndkTargetDir" | tee -a $_localPropertiesPath && \
cecho "@blue[[Android NDK installation completed in $_ndkTargetDir.]]"
fi
dependency_setup \
"pushd android && ./gradlew react-native-android:installArchives && popd"
}
}

View File

@ -39,11 +39,7 @@ install_cocoapods
####
echo && setup_header "Installing dependencies..."
dependency_setup npm install
dependency_setup \
"mvn -f modules/react-native-status/ios/RCTStatus/pom.xml dependency:unpack"
using_cocoapods && dependency_setup "pushd ios && pod install && popd"
dependency_setup make prepare-android
dependency_setup make prepare-ios
setup_complete