Skip to content

Instantly share code, notes, and snippets.

@becka11y
Created March 1, 2012 20:25
Show Gist options
  • Save becka11y/1952942 to your computer and use it in GitHub Desktop.
Save becka11y/1952942 to your computer and use it in GitHub Desktop.
Build Phase for Cordova Library based xcode project
# get the CordovaLib version
CDVER=`head -1 "${CORDOVALIB}/VERSION"`
SRC1="${CORDOVALIB}/javascripts/cordova-${CDVER}.js"
TARGET="${PROJECT_DIR}/www"
# compile and copy CordovaLib
make -C "${CORDOVALIB}"
cp "${SRC1}" "${TARGET}"
# replace [src="cordova*.js"] in all files in www
#find "${TARGET}" | xargs grep 'src[ ]*=[ ]*[\\'\"]cordova-*.*.js[\\'\"]' -sl | xargs -L1 sed -i "" "s/src[ ]*=[ ]*[\\'\"]cordova-*.*.js[\\'\"]/src=\"cordova-${CDVER}.js\"/g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment