Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. #CONFIG=${CONFIGURATION}
  2. CONFIG=Release
  3.  
  4. # Step 1. Make sure the output directory exists
  5. UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIG}-universal
  6. mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
  7.  
  8. # Step 2. Build Device and Simulator versions
  9. xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIG} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
  10. xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIG} -sdk iphonesimulator -arch x86_64 -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
  11.  
  12. # Step 3. Copy the framework structure to the universal folder. Subsequently opy the files of the swiftmodule (in Modules directory) of -iphonesimulator to the swiftmodule of universal framework directory.
  13. cp -R "${BUILD_DIR}/${CONFIG}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"
  14. cp -R "${BUILD_DIR}/${CONFIG}-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule"
  15.  
  16. # Step 4. Create universal binary file using lipo and place the combined executable in the copied framework directory
  17. lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIG}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIG}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"
  18.  
  19. # This next bit will copy the framework to a convenient location, so that we can be sure it is always up-to-date
  20. FRAMEWORK_PATH="${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework"
  21. FRAMEWORKS_PATH="/Users/ahmed/Frameworks"
  22. mkdir -p ${FRAMEWORKS_PATH}
  23. cp -pr ${FRAMEWORK_PATH} ${FRAMEWORKS_PATH}
  24. #open ${FRAMEWORKS_PATH}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement