cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/2] ios commit: Add --shared optional parameter to create script
Date Wed, 03 Oct 2012 17:50:47 GMT
Updated Branches:
  refs/heads/master a07ed8dad -> fb9169bd5


Add --shared optional parameter to create script

for including CordovaLib directly instead of using a copy of it.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/fb9169bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/fb9169bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/fb9169bd

Branch: refs/heads/master
Commit: fb9169bd5d247d8801b19cabaf31d03576679570
Parents: d78514e
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Wed Oct 3 13:50:05 2012 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Wed Oct 3 13:50:05 2012 -0400

----------------------------------------------------------------------
 bin/create |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/fb9169bd/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index b1e9af1..2b8a3d6 100755
--- a/bin/create
+++ b/bin/create
@@ -31,13 +31,20 @@
 set -e
 
 function usage() {
-  echo "Usage: $0 <path_to_new_project> <package_name> <project_name>"
+  echo "Usage: $0 [--shared] <path_to_new_project> <package_name> <project_name>"
+  echo "	--shared (optional): Link directly against the shared copy of the CordovaLib instead
of a copy of it."
   echo "	<path_to_new_project>: Path to your new Cordova iOS project"
   echo "	<package_name>: Package name, following reverse-domain style convention"
   echo "	<project_name>: Project name"
   exit 1
 }
 
+USE_SHARED=0
+if [[ $1 == "--shared" ]]; then
+    USE_SHARED=1
+    shift;
+fi
+
 # check whether it is a proper create command (at least 3 arguments)
 if [ $# -lt 3 ]; then
 	usage
@@ -106,12 +113,17 @@ R=$PROJECT_PATH/$PROJECT_NAME
 
 "$BINDIR/replaces" "$R/$PROJECT_NAME-Info.plist" --ID-- $PACKAGE
 
-# Copy in the CordovaLib directory.
-mkdir -p "$PROJECT_PATH/CordovaLib/CordovaLib.xcodeproj"
-cp -r "$BINDIR/../CordovaLib/Classes" "$PROJECT_PATH/CordovaLib"
-cp "$BINDIR/../CordovaLib/VERSION" "$PROJECT_PATH/CordovaLib"
-cp "$BINDIR/../CordovaLib/CordovaLib_Prefix.pch" "$PROJECT_PATH/CordovaLib"
-cp "$BINDIR/../CordovaLib/CordovaLib.xcodeproj/project.pbxproj" "$PROJECT_PATH/CordovaLib/CordovaLib.xcodeproj"
+if [[ $USE_SHARED = 1 ]]; then
+    # Make the sub-project reference to Cordova have the correct path.
+    "$BINDIR/update_cordova_subproject" "$R.xcodeproj/project.pbxproj" > /dev/null
+else
+    # Copy in the CordovaLib directory.
+    mkdir -p "$PROJECT_PATH/CordovaLib/CordovaLib.xcodeproj"
+    cp -r "$BINDIR/../CordovaLib/Classes" "$PROJECT_PATH/CordovaLib"
+    cp "$BINDIR/../CordovaLib/VERSION" "$PROJECT_PATH/CordovaLib"
+    cp "$BINDIR/../CordovaLib/CordovaLib_Prefix.pch" "$PROJECT_PATH/CordovaLib"
+    cp "$BINDIR/../CordovaLib/CordovaLib.xcodeproj/project.pbxproj" "$PROJECT_PATH/CordovaLib/CordovaLib.xcodeproj"
+    # Make the sub-project reference to Cordova have the correct path.
+    "$BINDIR/update_cordova_subproject" "$R.xcodeproj/project.pbxproj" "$PROJECT_PATH/CordovaLib/CordovaLib.xcodeproj/project.pbxproj"
> /dev/null
+fi
 
-# Make the sub-project reference to Cordova have the correct path.
-"$BINDIR/update_cordova_subproject" "$R.xcodeproj/project.pbxproj" "$PROJECT_PATH/CordovaLib/CordovaLib.xcodeproj/project.pbxproj"
> /dev/null


Mime
View raw message