iOS framework配置指令碼

來源:互聯網
上載者:User

# Sets the target folders and the final framework product.

FMK_NAME=HovnVoipEngine

FMK_VERSION=1.0


# Install dir will be the final output to the framework.

# The following line create it in the root folder of the current project.

INSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}.framework


# Working dir will be deleted after the framework creation.

WRK_DIR=build

DEVICE_DIR=${WRK_DIR}/Release-iphoneos/${FMK_NAME}.framework

SIMULATOR_DIR=${WRK_DIR}/Release-iphonesimulator/${FMK_NAME}.framework


# Building both architectures.

xcodebuild -configuration "Release" -target "${FMK_NAME}" -sdk iphoneos

xcodebuild -configuration "Release" -target "${FMK_NAME}" -sdk iphonesimulator


# Cleaning the oldest.

if [ -d "${INSTALL_DIR}" ]

then

rm -rf "${INSTALL_DIR}"

fi


# Creates and renews the final product folder.

mkdir -p "${INSTALL_DIR}"

mkdir -p "${INSTALL_DIR}/Versions"

mkdir -p "${INSTALL_DIR}/Versions/${FMK_VERSION}"

mkdir -p "${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources"

mkdir -p "${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers"


# Creates the internal links.

# It MUST uses relative path, otherwise will not work when the folder is copied/moved.

ln -s "${FMK_VERSION}""${INSTALL_DIR}/Versions/Current"

ln -s "Versions/Current/Headers""${INSTALL_DIR}/Headers"

ln -s "Versions/Current/Resources""${INSTALL_DIR}/Resources"

ln -s "Versions/Current/${FMK_NAME}""${INSTALL_DIR}/${FMK_NAME}"


# Copies the headers and resources files to the final product folder.

cp -R "${DEVICE_DIR}/Headers/""${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers/"

cp -R "${DEVICE_DIR}/""${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/"


# Removes the binary and header from the resources folder.

rm -r "${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/Headers""${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/${FMK_NAME}"


# Uses the Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.

lipo -create "${DEVICE_DIR}/${FMK_NAME}""${SIMULATOR_DIR}/${FMK_NAME}" -output "${INSTALL_DIR}/Versions/${FMK_VERSION}/${FMK_NAME}"


rm -r "${WRK_DIR}"

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.