Browse Source

Added Script to increment build number

Thomas Buck 8 years ago
parent
commit
417e1e7c45
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      CaseLights.xcodeproj/project.pbxproj

+ 19
- 0
CaseLights.xcodeproj/project.pbxproj View File

@@ -78,6 +78,7 @@
78 78
 			isa = PBXNativeTarget;
79 79
 			buildConfigurationList = E9F13E0F1C28B3D3004C6B95 /* Build configuration list for PBXNativeTarget "CaseLights" */;
80 80
 			buildPhases = (
81
+				E9AB17FC1C28B43B00BF3C51 /* Increment build number */,
81 82
 				E9F13DFA1C28B3D3004C6B95 /* Sources */,
82 83
 				E9F13DFB1C28B3D3004C6B95 /* Frameworks */,
83 84
 				E9F13DFC1C28B3D3004C6B95 /* Resources */,
@@ -135,6 +136,23 @@
135 136
 		};
136 137
 /* End PBXResourcesBuildPhase section */
137 138
 
139
+/* Begin PBXShellScriptBuildPhase section */
140
+		E9AB17FC1C28B43B00BF3C51 /* Increment build number */ = {
141
+			isa = PBXShellScriptBuildPhase;
142
+			buildActionMask = 2147483647;
143
+			files = (
144
+			);
145
+			inputPaths = (
146
+			);
147
+			name = "Increment build number";
148
+			outputPaths = (
149
+			);
150
+			runOnlyForDeploymentPostprocessing = 0;
151
+			shellPath = /bin/sh;
152
+			shellScript = "#!/bin/sh\n\nplist=\"${PROJECT_DIR}/${INFOPLIST_FILE}\"\ndir=\"$(dirname \"$plist\")\"\n\n# Only increment the build number if source files have changed\nif [ -n \"$(find \"$dir\" \\! -path \"*xcuserdata*\" \\! -path \"*.git*\" \\! -name .DS_Store \\! -path \"*Website*\" -newer \"$plist\")\" ]; then\nbuildnum=$(/usr/libexec/Plistbuddy -c \"Print CFBundleVersion\" \"$plist\")\nif [ -z \"$buildnum\" ]; then\necho \"No build number in $plist\"\nexit 2\nfi\nbuildnum=$(expr $buildnum + 1)\n/usr/libexec/Plistbuddy -c \"Set CFBundleVersion $buildnum\" \"$plist\"\necho \"Incremented build number to $buildnum\"\nelse\necho \"Not incrementing build number as source files have not changed\"\nfi\n";
153
+		};
154
+/* End PBXShellScriptBuildPhase section */
155
+
138 156
 /* Begin PBXSourcesBuildPhase section */
139 157
 		E9F13DFA1C28B3D3004C6B95 /* Sources */ = {
140 158
 			isa = PBXSourcesBuildPhase;
@@ -281,6 +299,7 @@
281 299
 				E9F13E111C28B3D3004C6B95 /* Release */,
282 300
 			);
283 301
 			defaultConfigurationIsVisible = 0;
302
+			defaultConfigurationName = Release;
284 303
 		};
285 304
 /* End XCConfigurationList section */
286 305
 	};

Loading…
Cancel
Save