Skip to content

Commit aecdae1

Browse files
Generate build numbers based on build time
1 parent e9fa0ea commit aecdae1

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

CommentWrapper.xcodeproj/project.pbxproj

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@
297297
675737B820912B0C00F42A2C /* Swift Lint */,
298298
67A3C069207822B000E93876 /* Frameworks */,
299299
67A3C06A207822B000E93876 /* Resources */,
300+
67F2723C2095B4BC004EC9C4 /* Set Build Number */,
300301
67A3C0A2207822DD00E93876 /* Embed App Extensions */,
301302
1B85D0C23929E647A7C8F553 /* [CP] Embed Pods Frameworks */,
302303
F70358CD9481A29EC6CB1052 /* [CP] Copy Pods Resources */,
@@ -339,6 +340,7 @@
339340
677995442092599D00B460E7 /* Swift Lint */,
340341
67A3C08E207822DD00E93876 /* Frameworks */,
341342
67A3C08F207822DD00E93876 /* Resources */,
343+
675DC4002095B8F7007142A7 /* Set Build Number */,
342344
D0815EFBAF800DD6791C4E0D /* [CP] Copy Pods Resources */,
343345
);
344346
buildRules = (
@@ -477,6 +479,20 @@
477479
shellPath = /bin/sh;
478480
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
479481
};
482+
675DC4002095B8F7007142A7 /* Set Build Number */ = {
483+
isa = PBXShellScriptBuildPhase;
484+
buildActionMask = 2147483647;
485+
files = (
486+
);
487+
inputPaths = (
488+
);
489+
name = "Set Build Number";
490+
outputPaths = (
491+
);
492+
runOnlyForDeploymentPostprocessing = 0;
493+
shellPath = /bin/sh;
494+
shellScript = "# Generate the build number using current date and time\nbuildNumber=$(date \"+%Y_%m_%d_%H_%M\")\n\n# Set the build number in plist file\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"";
495+
};
480496
677995432092598C00B460E7 /* Swift Lint */ = {
481497
isa = PBXShellScriptBuildPhase;
482498
buildActionMask = 2147483647;
@@ -505,6 +521,20 @@
505521
shellPath = /bin/sh;
506522
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
507523
};
524+
67F2723C2095B4BC004EC9C4 /* Set Build Number */ = {
525+
isa = PBXShellScriptBuildPhase;
526+
buildActionMask = 2147483647;
527+
files = (
528+
);
529+
inputPaths = (
530+
);
531+
name = "Set Build Number";
532+
outputPaths = (
533+
);
534+
runOnlyForDeploymentPostprocessing = 0;
535+
shellPath = /bin/sh;
536+
shellScript = "# Generate the build number using current date and time\nbuildNumber=$(date \"+%Y_%m_%d_%H_%M\")\n\n# Set the build number in plist file\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}\"";
537+
};
508538
74D53C4ECE91B9663A0CF99C /* [CP] Check Pods Manifest.lock */ = {
509539
isa = PBXShellScriptBuildPhase;
510540
buildActionMask = 2147483647;
@@ -755,6 +785,7 @@
755785
COMBINE_HIDPI_IMAGES = YES;
756786
DEVELOPMENT_TEAM = VAA3W4LPY2;
757787
INFOPLIST_FILE = CommentWrapper/Info.plist;
788+
INFOPLIST_PREPROCESS = YES;
758789
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
759790
PRODUCT_BUNDLE_IDENTIFIER = com.stevebarnegren.xcodecommentwrapper;
760791
PRODUCT_NAME = "Comment Wrapper";
@@ -776,6 +807,7 @@
776807
COMBINE_HIDPI_IMAGES = YES;
777808
DEVELOPMENT_TEAM = VAA3W4LPY2;
778809
INFOPLIST_FILE = CommentWrapper/Info.plist;
810+
INFOPLIST_PREPROCESS = YES;
779811
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
780812
PRODUCT_BUNDLE_IDENTIFIER = com.stevebarnegren.xcodecommentwrapper;
781813
PRODUCT_NAME = "Comment Wrapper";

CommentWrapper/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>1</string>
22+
<string>Set at build time</string>
23+
<key>LSApplicationCategoryType</key>
24+
<string>public.app-category.developer-tools</string>
2325
<key>LSMinimumSystemVersion</key>
2426
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2527
<key>NSHumanReadableCopyright</key>
@@ -28,7 +30,5 @@
2830
<string>Main</string>
2931
<key>NSPrincipalClass</key>
3032
<string>NSApplication</string>
31-
<key>LSApplicationCategoryType</key>
32-
<string>public.app-category.developer-tools</string>
3333
</dict>
3434
</plist>

CommentWrapperExt/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>1</string>
22+
<string>Set at build time</string>
2323
<key>LSMinimumSystemVersion</key>
2424
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2525
<key>NSExtension</key>

0 commit comments

Comments
 (0)