Procházet zdrojové kódy

Merge pull request #39 from bslack/next

Fixes majority of issues with the gameplay template script
Sean Paul Taylor před 14 roky
rodič
revize
20640512a4

+ 19 - 16
gameplay-newproject.sh

@@ -20,7 +20,7 @@ echo "   This name will be given to the project"
 echo "   executable and a folder with this name"
 echo "   will be created to store all project files."
 echo
-read -p "Project Name: " "" projName 
+read -p "Project Name: " projName 
 if [[ "$projName" == "" ]]; then
 	echo
 	echo "ERROR: No project name specified."
@@ -36,7 +36,7 @@ echo "   On some platforms, this title is used to"
 echo "   identify the game during installation and"
 echo "   on shortcuts/icons."
 echo
-read -p "Title: " "" title 
+read -p "Title: " title 
 if [[ "$title" == "" ]]; then
 	echo
 	echo "ERROR: No game title specified."
@@ -48,7 +48,7 @@ echo
 echo
 echo "3. Enter a short game description."
 echo
-read -p "Description: " "" desc
+read -p "Description: " desc
 if [[ "$desc" == "" ]]; then
 	desc=$title
 fi
@@ -61,7 +61,7 @@ echo "   This should be a human readable package name,"
 echo "   containing at least two words separated by a"
 echo "   period (eg. com.surname.gamename)."
 echo
-read -p "Unique ID: " "" uuid
+read -p "Unique ID: " uuid
 if [[ "$uuid" == "" ]]; then
 	echo
 	echo "ERROR: No uuid specified."
@@ -77,7 +77,7 @@ echo "   On BlackBerry targets, this is used for"
 echo "   signing and must match the developer name"
 echo "   of your development certificate."
 echo
-read -p "Author: " "" author
+read -p "Author: " author
 if [[ "$author" == "" ]]; then
 	echo
 	echo "ERROR: No author specified."
@@ -93,7 +93,7 @@ echo "   Your initial game header and source file"
 echo "   will be given this name and a class with"
 echo "   this name will be created in these files."
 echo
-read -p "Class name: " "" className
+read -p "Class name: " className
 if [[ "$className" == "" ]]; then
 	echo
 	echo "ERROR: No class name specified."
@@ -110,7 +110,7 @@ echo "   or empty for the current folder. Note that"
 echo "   a project folder named $projName will also"
 echo "   be created inside this folder."
 echo
-read -p "Path: " "" location
+read -p "Path: " location
 if [[ "$location" == "" ]]; then
 	projPath=$projName
 else
@@ -118,7 +118,6 @@ else
 fi
 echo
 
-
 # Verify Path and eliminate double '//'
 projPath=`echo "$projPath" | sed 's_//_/_g'`
 if [ -e $projPath ]; then
@@ -129,14 +128,18 @@ if [ -e $projPath ]; then
 fi
 
 # Generate relative path from project folder to gameplay folder
-gpPathAbs=`pwd`
-common_path=$projPath
-back=
-while [ "${gpPathAbs#$common_path}" = "${gpPathAbs}" ]; do
-	common_path=$(dirname $common_path)
-	back="../${back}"
-done
-gpPath=${back}${gpPathAbs#$common_path/}
+if [[ ${projPath:0:1} == "/" ]]; then
+	gpPathAbs=`pwd`
+	common_path=$projPath
+	back=
+	while [ "${gpPathAbs#$common_path}" = "${gpPathAbs}" ]; do
+		common_path=$(dirname $common_path)
+		back="../${back}"
+	done
+	gpPath=${back}${gpPathAbs#$common_path/}
+else
+	gpPath=$projPath
+fi
 
 # Make required source folder directories
 mkdir -p "$projPath/src"

+ 5 - 9
gameplay-template/gameplay-template.xcodeproj/project.pbxproj

@@ -22,7 +22,6 @@
 		42C933291491A6E50098216A /* libvorbisfile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C933251491A6E50098216A /* libvorbisfile.a */; };
 		42C9332C1491A7680098216A /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C9332A1491A7390098216A /* libpng.a */; };
 		42C9332F1491A78D0098216A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C9332D1491A7810098216A /* libz.dylib */; };
-		5B61611314CCC2200073B857 /* TEMPLATE_PROJECT-macos.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5B61611214CCC2200073B857 /* TEMPLATE_PROJECT-macos.plist */; };
 		5B61611614CCC24C0073B857 /* TemplateGame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C932EF1491A5160098216A /* TemplateGame.cpp */; };
 		5B61611814CCC24C0073B857 /* libgameplay.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42438B521491AD2000D218B8 /* libgameplay.a */; };
 		5B61611914CCC24C0073B857 /* libbullet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C933201491A6C70098216A /* libbullet.a */; };
@@ -34,7 +33,6 @@
 		5B61611F14CCC24C0073B857 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C9332D1491A7810098216A /* libz.dylib */; };
 		5B61612614CCC24C0073B857 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 42C932ED1491A4CB0098216A /* icon.png */; };
 		5B61612714CCC24C0073B857 /* res in Resources */ = {isa = PBXBuildFile; fileRef = 42C932F21491A53E0098216A /* res */; };
-		5B61612814CCC24C0073B857 /* TEMPLATE_PROJECT-macos.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5B61611214CCC2200073B857 /* TEMPLATE_PROJECT-macos.plist */; };
 		5B61613114CCC33A0073B857 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B61612F14CCC33A0073B857 /* OpenAL.framework */; };
 		5B61613214CCC33A0073B857 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B61613014CCC33A0073B857 /* OpenGLES.framework */; };
 		5B61613414CCC3420073B857 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B61613314CCC3420073B857 /* UIKit.framework */; };
@@ -62,7 +60,7 @@
 		42C9332D1491A7810098216A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
 		5B61611214CCC2200073B857 /* TEMPLATE_PROJECT-macos.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "TEMPLATE_PROJECT-macos.plist"; sourceTree = "<group>"; };
 		5B61612C14CCC24C0073B857 /* TEMPLATE_PROJECT-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TEMPLATE_PROJECT-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
-		5B61612E14CCC24D0073B857 /* TEMPLATE_PROJECT-ios.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "TEMPLATE_PROJECT-ios.plist"; path = "/Users/bslack/src/git/GamePlay/gameplay-template/TEMPLATE_PROJECT-ios.plist"; sourceTree = "<absolute>"; };
+		5B61612E14CCC24D0073B857 /* TEMPLATE_PROJECT-ios.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TEMPLATE_PROJECT-ios.plist"; sourceTree = "<group>"; };
 		5B61612F14CCC33A0073B857 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/OpenAL.framework; sourceTree = DEVELOPER_DIR; };
 		5B61613014CCC33A0073B857 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };
 		5B61613314CCC3420073B857 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
@@ -264,7 +262,6 @@
 			files = (
 				42C932EE1491A4CB0098216A /* icon.png in Resources */,
 				42C932F31491A53E0098216A /* res in Resources */,
-				5B61611314CCC2200073B857 /* TEMPLATE_PROJECT-macos.plist in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -274,7 +271,6 @@
 			files = (
 				5B61612614CCC24C0073B857 /* icon.png in Resources */,
 				5B61612714CCC24C0073B857 /* res in Resources */,
-				5B61612814CCC24C0073B857 /* TEMPLATE_PROJECT-macos.plist in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -393,7 +389,7 @@
 					"GAMEPLAY_PATH/external-deps/bullet/include",
 					"GAMEPLAY_PATH/external-deps/oggvorbis/include",
 				);
-				INFOPLIST_FILE = "gameplay-template-macos.plist";
+				INFOPLIST_FILE = "TEMPLATE_PROJECT-macos.plist";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"GAMEPLAY_PATH/external-deps/libpng/lib/macos\"",
@@ -419,7 +415,7 @@
 					"GAMEPLAY_PATH/external-deps/bullet/include",
 					"GAMEPLAY_PATH/external-deps/oggvorbis/include",
 				);
-				INFOPLIST_FILE = "gameplay-template-macos.plist";
+				INFOPLIST_FILE = "TEMPLATE_PROJECT-macos.plist";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"GAMEPLAY_PATH/external-deps/libpng/lib/macos\"",
@@ -444,7 +440,7 @@
 					"GAMEPLAY_PATH/external-deps/bullet/include",
 					"GAMEPLAY_PATH/external-deps/oggvorbis/include",
 				);
-				INFOPLIST_FILE = "gameplay-template-ios.plist";
+				INFOPLIST_FILE = "TEMPLATE_PROJECT-ios.plist";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"GAMEPLAY_PATH/external-deps/libpng/lib/ios/$(CURRENT_ARCH)\"",
@@ -469,7 +465,7 @@
 					"GAMEPLAY_PATH/external-deps/bullet/include",
 					"GAMEPLAY_PATH/external-deps/oggvorbis/include",
 				);
-				INFOPLIST_FILE = "gameplay-template-ios.plist";
+				INFOPLIST_FILE = "TEMPLATE_PROJECT-ios.plist";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"GAMEPLAY_PATH/external-deps/libpng/lib/ios/$(CURRENT_ARCH)\"",