Guest User

Untitled

a guest
Dec 12th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. # Name of the resource we're selectively copying
  2. GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist
  3.  
  4. # Get references to dev and prod versions of the GoogleService-Info.plist
  5. # NOTE: These should only live on the file system and should NOT be part of the target (since we'll be adding them to the target manually)
  6. GOOGLESERVICE_INFO_DEV=${PROJECT_DIR}/${TARGET_NAME}/Firebase/Debug/${GOOGLESERVICE_INFO_PLIST}
  7. GOOGLESERVICE_INFO_STAGING=${PROJECT_DIR}/${TARGET_NAME}/Firebase/Staging/${GOOGLESERVICE_INFO_PLIST}
  8. GOOGLESERVICE_INFO_PROD=${PROJECT_DIR}/${TARGET_NAME}/Firebase/Release/${GOOGLESERVICE_INFO_PLIST}
  9.  
  10. # Make sure the dev version of GoogleService-Info.plist exists
  11. echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_DEV}"
  12. if [ ! -f $GOOGLESERVICE_INFO_DEV ]
  13. then
  14. echo "No Development GoogleService-Info.plist found. Please ensure it's in the proper directory."
  15. exit 1
  16. fi
  17.  
  18. # Make sure the staging version of GoogleService-Info.plist exists
  19. echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_STAGING}"
  20. if [ ! -f $GOOGLESERVICE_INFO_STAGING ]
  21. then
  22. echo "No Stating GoogleService-Info.plist found. Please ensure it's in the proper directory."
  23. exit 1
  24. fi
  25.  
  26. # Make sure the prod version of GoogleService-Info.plist exists
  27. echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_PROD}"
  28. if [ ! -f $GOOGLESERVICE_INFO_PROD ]
  29. then
  30. echo "No Production GoogleService-Info.plist found. Please ensure it's in the proper directory."
  31. exit 1
  32. fi
  33.  
  34. # Get a reference to the destination location for the GoogleService-Info.plist
  35. PLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
  36. echo "Will copy ${GOOGLESERVICE_INFO_PLIST} to final destination: ${PLIST_DESTINATION}"
  37.  
  38. # Copy over the prod GoogleService-Info.plist for Release builds
  39. if [ "${CONFIGURATION}" == "Release" ]
  40. then
  41. echo "Using ${GOOGLESERVICE_INFO_PROD}"
  42. cp "${GOOGLESERVICE_INFO_PROD}" "${PLIST_DESTINATION}"
  43. elif [ "${CONFIGURATION}" == "Staging" ]
  44. then
  45. echo "Using ${GOOGLESERVICE_INFO_STAGING}"
  46. cp "${GOOGLESERVICE_INFO_STAGING}" "${PLIST_DESTINATION}"
  47. else
  48. echo "Using ${GOOGLESERVICE_INFO_DEV}"
  49. cp "${GOOGLESERVICE_INFO_DEV}" "${PLIST_DESTINATION}"
  50. fi
Add Comment
Please, Sign In to add comment