You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2012/11/08 03:46:21 UTC
[4/6] Move cordova-VERSION.js from bin/templates to CordovaLib.
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/c65aadf5/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj b/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj
index cfbcac9..d8f7ea3 100644
--- a/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj
+++ b/CordovaLibTests/CordovaTests.xcodeproj/project.pbxproj
@@ -260,8 +260,8 @@
buildPhases = (
303A4064152124BB00182201 /* Sources */,
303A4065152124BB00182201 /* Frameworks */,
- 30F8AE1615212883006625B3 /* Copy cordova.ios.js into www directory */,
303A4066152124BB00182201 /* Resources */,
+ 30F8AE1615212883006625B3 /* Copy cordova.ios.js into www directory */,
);
buildRules = (
);
@@ -373,7 +373,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "cp \"${PROJECT_DIR}\"/../bin/templates/project/www/cordova*.js \"${PROJECT_DIR}\"/CordovaLibApp/www/cordova.ios.js";
+ shellScript = "cp ../CordovaLib/cordova.ios.js \"$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/www/cordova.ios.js\"";
showEnvVarsInLog = 0;
};
686357A7141002F100DF4CF2 /* ShellScript */ = {
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/c65aadf5/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index c0aea40..b8f6a38 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,6 @@ CORDOVA_LIB = $(PWD)/CordovaLib
DEVELOPER ?= '$(shell xcode-select -print-path)'
XC_APP ?= '$(shell mdfind "kMDItemFSName=='Xcode.app' && kMDItemKind=='Application'" | head -1)'
XC = $(DEVELOPER)/usr/bin/xcodebuild
-CDV_VER = $(shell head -1 CordovaLib/VERSION)
XCODE4_TEMPLATE_FOLDER=$(HOME)/Library/Developer/Xcode/Templates/Project\ Templates/Application
EXISTING_XCODE4_TEMPLATE=$(XCODE4_TEMPLATE_FOLDER)/Cordova-based\ Application.xctemplate
RENAMED_XCODE4_TEMPLATE=$(XCODE4_TEMPLATE_FOLDER)/Cordova-based\ \(pre\ 2.0\)\ Application.xctemplate
@@ -67,7 +66,7 @@ check-utils:
echo -e "\033[31mError: Xcode is running! Please close Xcode and try again.\033[m" ; exit 1; \
fi
-install: check-utils clean update-template
+install: check-utils clean
@# rename the existing Xcode 4 template
@if [ -d $(EXISTING_XCODE4_TEMPLATE) ]; then \
mv $(EXISTING_XCODE4_TEMPLATE) $(RENAMED_XCODE4_TEMPLATE) ; \
@@ -86,7 +85,3 @@ uninstall:
if [ "$$REPLY" == "y" ]; then \
$(RM_RF) /Users/Shared/Cordova/Frameworks/Cordova.framework/ ; $(RM_RF) ~/Library/Frameworks/Cordova.framework ; \
fi
-
-update-template:
- @mv bin/templates/project/www/cordova-*.js bin/templates/project/www/cordova-$(CDV_VER).js
- @find "bin/templates/project/www/index.html" | xargs grep 'src[ ]*=[ ]*[\\'\"]cordova-*.*.js[\\'\"]' -sl | xargs -L1 sed -i "" "s/src[ ]*=[ ]*[\\'\"]cordova-*.*.js[\\'\"]/src=\"cordova-${CDV_VER}.js\"/g"
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/c65aadf5/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 2b8a3d6..3234f1c 100755
--- a/bin/create
+++ b/bin/create
@@ -58,6 +58,7 @@ while [ -h "$SCRIPT" ] ; do
done
BINDIR=$( cd "$( dirname "$SCRIPT" )" && pwd )
+CORDOVALIB_DIR="$BINDIR/../CordovaLib"
PROJECT_PATH=$1
PACKAGE=$2
@@ -74,6 +75,9 @@ fi
# copy the files in; then modify them
cp -r "$BINDIR/templates/project/" "$PROJECT_PATH"
+# Copy in the JS.
+cp "$CORDOVALIB_DIR/cordova.ios.js" "$PROJECT_PATH/www"
+
# I've tried to be thorough in my documentation of the manual actions below...
# on first brush it would seem that the right solution would be to brute force
# recurse the directory tree renaming instances of __ID__ and __TESTING__ ...however this is a little blunt