From 4457e0ce5099a81f8e6a366e353561b886725532 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sat, 13 Aug 2011 19:49:56 -0400 Subject: Added automatic versioning A shell script that is run before building now automatically sets the build number of the package to the current revision number, plus a value that increments on every build if the code is dirty (a.k.a. has been modified since being committed). Also changed the project to automatically use the correct provisioning profile when codesigning instead of having to change it every time the provisioning profile changed. --- .hgignore | 1 + Cart Collect.xcodeproj/project.pbxproj | 142 ++++++++++++++++----------------- Resources/Info.plist | 2 + 3 files changed, 74 insertions(+), 71 deletions(-) diff --git a/.hgignore b/.hgignore index e53858e..d30fb8d 100644 --- a/.hgignore +++ b/.hgignore @@ -14,3 +14,4 @@ xcuserdata *~.nib .DS_Store +Versioning.h diff --git a/Cart Collect.xcodeproj/project.pbxproj b/Cart Collect.xcodeproj/project.pbxproj index ebc6afe..bd63c09 100755 --- a/Cart Collect.xcodeproj/project.pbxproj +++ b/Cart Collect.xcodeproj/project.pbxproj @@ -6,6 +6,20 @@ objectVersion = 46; objects = { +/* Begin PBXAggregateTarget section */ + 6C263DDB13F6F4A000116746 /* Versioning */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 6C263DDC13F6F4A000116746 /* Build configuration list for PBXAggregateTarget "Versioning" */; + buildPhases = ( + 6C263DDF13F6F4AB00116746 /* ShellScript */, + ); + dependencies = ( + ); + name = Versioning; + productName = Versioning; + }; +/* End PBXAggregateTarget section */ + /* Begin PBXBuildFile section */ 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 3F03221613D78F8C00E6A708 /* HighscoreListController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F03221513D78F8C00E6A708 /* HighscoreListController.m */; }; @@ -290,6 +304,13 @@ remoteGlobalIDString = 506EE05D10304ED200A389B3; remoteInfo = "cocos2d libraries"; }; + 6C263DE013F6F6E800116746 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6C263DDB13F6F4A000116746; + remoteInfo = Versioning; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -1247,6 +1268,7 @@ buildRules = ( ); dependencies = ( + 6C263DE113F6F6E800116746 /* PBXTargetDependency */, 506EE1A81030507B00A389B3 /* PBXTargetDependency */, ); name = "Cart Collect"; @@ -1295,6 +1317,7 @@ targets = ( 1D6058900D05DD3D006BFB54 /* Cart Collect */, 506EE05D10304ED200A389B3 /* cocos2d libraries */, + 6C263DDB13F6F4A000116746 /* Versioning */, ); }; /* End PBXProject section */ @@ -1345,6 +1368,22 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 6C263DDF13F6F4AB00116746 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "hg=\"/opt/local/bin/hg\"\ntouch Resources/Info.plist\nversion=`$hg tip --template {rev}`\ndirty=`$hg status`\nif [ -n \"${dirty}\" ]; then\n rev=`cat Versioning.h | sed -e \"s/.define BUILD_NUMBER ${version}\\.\\([0-9]*\\)/\\1/g\"`\n if [ -z \"${rev}\" ]; then\n rev=\"1\"\n else\n rev=`expr ${rev} + 1`\n fi\n version=\"${version}.${rev}\"\nfi\necho \"#define BUILD_NUMBER ${version}\" > Versioning.h"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 1D60588E0D05DD3D006BFB54 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -1479,6 +1518,11 @@ target = 506EE05D10304ED200A389B3 /* cocos2d libraries */; targetProxy = 506EE1A71030507B00A389B3 /* PBXContainerItemProxy */; }; + 6C263DE113F6F6E800116746 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6C263DDB13F6F4A000116746 /* Versioning */; + targetProxy = 6C263DE013F6F6E800116746 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -1487,8 +1531,8 @@ buildSettings = { ALTERNATE_MODE = Entitlements.plist; ALWAYS_SEARCH_USER_PATHS = YES; - CODE_SIGN_IDENTITY = "iPhone Developer: Elizabeth Solomon (ZHW46MT484)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Elizabeth Solomon (ZHW46MT484)"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_DYNAMIC_NO_PIC = NO; @@ -1498,13 +1542,13 @@ GCC_TREAT_WARNINGS_AS_ERRORS = NO; HEADER_SEARCH_PATHS = libs; INFOPLIST_FILE = Resources/Info.plist; + INFOPLIST_PREFIX_HEADER = Versioning.h; + INFOPLIST_PREPROCESS = YES; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); PRODUCT_NAME = "Cart Collect"; - PROVISIONING_PROFILE = "42DE7CBA-2166-4560-9EE8-5D227F4278B1"; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "42DE7CBA-2166-4560-9EE8-5D227F4278B1"; TARGETED_DEVICE_FAMILY = 1; WARNING_CFLAGS = "-Wall"; }; @@ -1515,8 +1559,8 @@ buildSettings = { ALTERNATE_MODE = Entitlements.plist; ALWAYS_SEARCH_USER_PATHS = YES; - CODE_SIGN_IDENTITY = "iPhone Developer: Elizabeth Solomon (ZHW46MT484)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Elizabeth Solomon (ZHW46MT484)"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1524,13 +1568,13 @@ GCC_TREAT_WARNINGS_AS_ERRORS = NO; HEADER_SEARCH_PATHS = libs; INFOPLIST_FILE = Resources/Info.plist; + INFOPLIST_PREFIX_HEADER = Versioning.h; + INFOPLIST_PREPROCESS = YES; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); PRODUCT_NAME = "Cart Collect"; - PROVISIONING_PROFILE = "42DE7CBA-2166-4560-9EE8-5D227F4278B1"; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "42DE7CBA-2166-4560-9EE8-5D227F4278B1"; TARGETED_DEVICE_FAMILY = 1; WARNING_CFLAGS = "-Wall"; }; @@ -1540,6 +1584,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -1557,6 +1602,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_PREPROCESSOR_DEFINITIONS = ""; @@ -1571,72 +1617,19 @@ }; name = Release; }; - 6CC89DDA13F2F51E003704F7 /* Ad Hoc */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = ( - NS_BLOCK_ASSERTIONS, - NDEBUG, - ); - "GCC_THUMB_SUPPORT[arch=armv6]" = NO; - "GCC_THUMB_SUPPORT[arch=armv7]" = YES; - GCC_UNROLL_LOOPS = YES; - GCC_VERSION = com.apple.compilers.llvmgcc42; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.0; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = "Ad Hoc"; - }; - 6CC89DDB13F2F51E003704F7 /* Ad Hoc */ = { + 6C263DDD13F6F4A000116746 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALTERNATE_MODE = Entitlements.plist; - ALWAYS_SEARCH_USER_PATHS = YES; - CODE_SIGN_IDENTITY = "iPhone Developer: Elizabeth Solomon (ZHW46MT484)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Elizabeth Solomon (ZHW46MT484)"; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Cart_Collect_Prefix.pch; - GCC_TREAT_WARNINGS_AS_ERRORS = NO; - HEADER_SEARCH_PATHS = libs; - INFOPLIST_FILE = Resources/Info.plist; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_NAME = "Cart Collect"; - PROVISIONING_PROFILE = "42DE7CBA-2166-4560-9EE8-5D227F4278B1"; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "42DE7CBA-2166-4560-9EE8-5D227F4278B1"; - TARGETED_DEVICE_FAMILY = 1; - WARNING_CFLAGS = "-Wall"; + PRODUCT_NAME = "$(TARGET_NAME)"; }; - name = "Ad Hoc"; + name = Debug; }; - 6CC89DDC13F2F51E003704F7 /* Ad Hoc */ = { + 6C263DDE13F6F4A000116746 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_TREAT_WARNINGS_AS_ERRORS = NO; - HEADER_SEARCH_PATHS = ( - libs/Chipmunk/include/chipmunk, - libs, - ); - PRODUCT_NAME = "cocos2d libraries"; - SKIP_INSTALL = YES; - ZERO_LINK = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; }; - name = "Ad Hoc"; + name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; @@ -1644,7 +1637,7 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CODE_SIGN_IDENTITY = "Don't Code Sign"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_C_LANGUAGE_STANDARD = c99; GCC_PREPROCESSOR_DEFINITIONS = ( DEBUG, @@ -1658,6 +1651,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 3.0; ONLY_ACTIVE_ARCH = YES; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -1694,7 +1688,6 @@ buildConfigurations = ( 1D6058940D05DD3E006BFB54 /* Debug */, 1D6058950D05DD3E006BFB54 /* Release */, - 6CC89DDB13F2F51E003704F7 /* Ad Hoc */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1704,7 +1697,15 @@ buildConfigurations = ( 506EE05F10304ED500A389B3 /* Debug */, 506EE06010304ED500A389B3 /* Release */, - 6CC89DDC13F2F51E003704F7 /* Ad Hoc */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6C263DDC13F6F4A000116746 /* Build configuration list for PBXAggregateTarget "Versioning" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6C263DDD13F6F4A000116746 /* Debug */, + 6C263DDE13F6F4A000116746 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1714,7 +1715,6 @@ buildConfigurations = ( C01FCF4F08A954540054247B /* Debug */, C01FCF5008A954540054247B /* Release */, - 6CC89DDA13F2F51E003704F7 /* Ad Hoc */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Resources/Info.plist b/Resources/Info.plist index ed33cda..9f3118a 100755 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -32,6 +32,8 @@ ???? CFBundleURLTypes + CFBundleVersion + BUILD_NUMBER LSRequiresIPhoneOS UIPrerenderedIcon -- cgit 1.4.1