Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.43 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Creates the .env-file required for build.
  4. # These variables are defined in the branch build configuration
  5. echo "API_URL=$API_URL" >> .env.production
  6. echo "ACCOUNT=$ACCOUNT" >> .env.production
  7. echo "SUPPORT_URL=$SUPPORT_URL" >> .env.production
  8. echo "READ_INVOICES=$READ_INVOICES" >> .env.production
  9. echo "PICTURE_URL=$PICTURE_URL" >> .env.production
  10.  
  11. if [ "$APPCENTER_ANDROID_VARIANT" == "release" ];
  12. then
  13.     # Reverts the Android NDK version to r16b from r17 to resolve a react native compile issue:
  14.     # https://github.com/facebook/react-native/issues/19321
  15.     # https://github.com/android-ndk/ndk/issues/700
  16.     echo "Hotfix for Android: Change Android NDK Version to r16"
  17.     set -ex
  18.  
  19.     # set env vars
  20.     export ANDROID_NDK_VERSION='r16b'
  21.  
  22.     # create a temp working directory
  23.     mkdir ./android-ndk-tmp
  24.     cd ./android-ndk-tmp
  25.  
  26.     # download ndk
  27.     wget -q https://dl.google.com/android/repository/android-ndk-$ANDROID_NDK_VERSION-darwin-x86_64.zip
  28.  
  29.     # uncompress
  30.     unzip -o android-ndk-$ANDROID_NDK_VERSION-darwin-x86_64.zip
  31.  
  32.     # move to its final location
  33.     mv ./android-ndk-$ANDROID_NDK_VERSION $ANDROID_HOME/ndk-bundle
  34.  
  35.     # remove temp dir
  36.     cd ..
  37.     rm -rf ./android-ndk-tmp
  38.  
  39.     # add to PATH
  40.     export PATH=${PATH}:$ANDROID_HOME/ndk-bundle
  41. else
  42.     echo "This should be an iOS-build"
  43. fi
  44.  
  45. # TODO: Remove this line if it works without it
  46. # source npm run ios:build
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement