Skip to content

Commit

Permalink
Add a CMAKE_BIN_PATH variable to the PATH (#164)
Browse files Browse the repository at this point in the history
* Add a `CMAKE_BIN_PATH` variable to the PATH

* Configure `KOTLIN_HOME`
  • Loading branch information
cortinico committed Mar 8, 2022
1 parent b843502 commit 428ca23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Expand Up @@ -28,15 +28,17 @@ ARG ANDROID_TOOLS_VERSION=31.0.0
ARG NDK_VERSION=21.4.7075529
ARG NODE_VERSION=14.x
ARG WATCHMAN_VERSION=4.9.0
ARG CMAKE_VERSION=3.18.1

# set default environment variables, please don't remove old env for compatibilty issue
ENV ADB_INSTALL_TIMEOUT=10
ENV ANDROID_HOME=/opt/android
ENV ANDROID_SDK_ROOT=${ANDROID_HOME}
ENV ANDROID_NDK=${ANDROID_HOME}/ndk/$NDK_VERSION
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
ENV CMAKE_BIN_PATH=${ANDROID_HOME}/cmake/$CMAKE_VERSION/bin

ENV PATH=${ANDROID_NDK}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/emulator:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:/opt/buck/bin/:${PATH}
ENV PATH=${ANDROID_NDK}:${CMAKE_BIN_PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/emulator:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:/opt/buck/bin/:${PATH}

COPY --from=buck /tmp/buck.pex /usr/local/bin/buck

Expand Down Expand Up @@ -109,7 +111,7 @@ RUN curl -sS https://dl.google.com/android/repository/${SDK_VERSION} -o /tmp/sdk
"emulator" \
"platforms;android-$ANDROID_BUILD_VERSION" \
"build-tools;$ANDROID_TOOLS_VERSION" \
"cmake;3.18.1" \
"cmake;$CMAKE_VERSION" \
"system-images;android-21;google_apis;armeabi-v7a" \
"ndk;$NDK_VERSION" \
&& rm -rf ${ANDROID_HOME}/.android \
Expand Down
8 changes: 6 additions & 2 deletions scripts/test-react-native-setup.sh
Expand Up @@ -2,12 +2,16 @@

set -e

echo "Check Buck setup"
export KOTLIN_HOME="third-party/kotlin"

echo "Download Buck dependencies"
./scripts/circleci/buck_fetch.sh

echo "Build React Native via Buck"
buck build ReactAndroid/src/main/java/com/facebook/react
buck build ReactAndroid/src/main/java/com/facebook/react/shell

echo "Build React Native"
echo "Build React Native via Gradle"
yarn install
./gradlew --no-daemon :ReactAndroid:packageReactNdkLibsForBuck

Expand Down

0 comments on commit 428ca23

Please sign in to comment.