diff --git a/packages/react-native-codegen/DEFS.bzl b/packages/react-native-codegen/DEFS.bzl index 7f52f314861930..606db2c3eb86fd 100644 --- a/packages/react-native-codegen/DEFS.bzl +++ b/packages/react-native-codegen/DEFS.bzl @@ -77,7 +77,7 @@ def rn_codegen_cli(): bash = r""" set -euo pipefail mkdir -p "$OUT" - cp -r "$SRCDIR/." "$OUT/" + rsync -rLptgoD "$SRCDIR/" "$OUT" cd "$OUT" yarn install 2> >(grep -v '^warning' 1>&2) yarn run build diff --git a/scripts/validate-android-test-env.sh b/scripts/validate-android-test-env.sh index 5f6be9956cba97..121c832128de96 100755 --- a/scripts/validate-android-test-env.sh +++ b/scripts/validate-android-test-env.sh @@ -11,6 +11,8 @@ # the android sdk that is actually installed. Also, we must have the # right version of Java. +THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd) + # Check that Buck is working. if [ -z "$(which buck)" ]; then echo "You need to install Buck." @@ -115,3 +117,14 @@ if [ -z "$JAVA_HOME" ]; then echo "You will also want to add \$JAVA_HOME/bin to your path." exit 1 fi + +# Assuming Android SDK/NDK has been set up, set up `local.properties` file +# to force Gradle to use the provided versions. This is necessary before +# the side-by-side NDK installation is supported for Circle CI runs. +LOCAL_PROPERTIES="$THIS_DIR/../local.properties" +if [ ! -f "$LOCAL_PROPERTIES" ]; then + echo "Setting up local.properties for NDK builds." + touch "$LOCAL_PROPERTIES" + echo "sdk.dir=$ANDROID_HOME" >> "$LOCAL_PROPERTIES" + echo "ndk.dir=$ANDROID_NDK" >> "$LOCAL_PROPERTIES" +fi