Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix validate-android-test-env.sh #22961

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ aliases:

- &compile-native-libs
name: Compile Native Libs for Unit and Integration Tests
command: ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS -Pcom.android.build.threadPoolSize=1
command: ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS
no_output_timeout: 6m

- &run-android-unit-tests
Expand Down
2 changes: 1 addition & 1 deletion ContainerShip/Dockerfile.android
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ADD react.gradle /app/react.gradle
RUN ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSC

# compile native libs with Gradle script, we need bridge for unit and integration tests
RUN ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=1 -Pcom.android.build.threadPoolSize=1
RUN ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=1

# add all react-native code
ADD . /app
Expand Down
9 changes: 3 additions & 6 deletions scripts/validate-android-test-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ else
fi
fi

# BUILD_TOOLS_VERSION is in a format like "23.0.1"
BUILD_TOOLS_VERSION=`grep buildToolsVersion $(dirname $0)/../ReactAndroid/build.gradle | sed 's/^[^"]*\"//' | sed 's/"//'`

# MAJOR is something like "23"
MAJOR=`grep compileSdkVersion $(dirname $0)/../ReactAndroid/build.gradle | sed 's/[^[:digit:]]//g'`

Expand All @@ -74,15 +71,15 @@ if [ ! -e "$PLATFORM_DIR" ]; then
fi

# Check that we have the right version of the build tools.
BT_DIR="$ANDROID_HOME/build-tools/$BUILD_TOOLS_VERSION"
BT_DIR="$ANDROID_HOME/build-tools/$ANDROID_SDK_BUILD_TOOLS_REVISION"
if [ ! -e "$BT_DIR" ]; then
echo "Error: could not find version $BUILD_TOOLS_VERSION of the Android build tools."
echo "Error: could not find version $ANDROID_SDK_BUILD_TOOLS_REVISION of the Android build tools."
echo "Specifically, the directory $BT_DIR does not exist."
echo "You probably need to explicitly install the correct version of the Android SDK Build Tools from within Android Studio."
echo "See https://facebook.github.io/react-native/docs/getting-started.html for details."
echo "If you are using Android SDK Tools from the command line, you may need to run:"
echo
echo " sdkmanager \"platform-tools\" \"build-tools;android-$BUILD_TOOLS_VERSION\""
echo " sdkmanager \"platform-tools\" \"build-tools;android-$ANDROID_SDK_BUILD_TOOLS_REVISION\""
echo
echo "Check out https://developer.android.com/studio/command-line/sdkmanager.html for details."
exit 1
Expand Down