Skip to content

Commit

Permalink
[chore]: CI - Check CFBundleShortVersionString in Info.plist (#1006)
Browse files Browse the repository at this point in the history
* add check that CFBundleShortVersionString exists in Info.plist

* fix naming,  add PR reference

* add comments to script

* move to non generated Info.plist file

* add copyright to xcconfigs

* migrate to non-generated Info.plist for remaining targets
  • Loading branch information
lukepistrol authored Jan 21, 2023
1 parent efd18ec commit fd2c961
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 14 deletions.
21 changes: 21 additions & 0 deletions .github/scripts/test_version_number.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# get the version number from the Info.plist file using agvtool
VERS=$(xcrun agvtool mvers -terse1)

# if the version number is empty, exit with an error
if [ "$VERS" == "" ]; then
echo "No version number found"
echo "Make sure Info.plist has a CFBundleShortVersionString key"
echo ""
echo "If Info.plist does not have a CFBundleShortVersionString key, add the following to your Info.plist file:"
echo ""
echo "<key>CFBundleShortVersionString</key>"
echo "<string>0.0.1</string>"
echo ""
echo "For more information see https://github.com/CodeEditApp/CodeEdit/pull/1006"
exit 1 # exit with an error
else
echo "Version number is $VERS"
exit 0 # exit with no error
fi
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check Version Number exists
run: exec ./.github/scripts/test_version_number.sh
- name: Testing App
run: exec ./.github/scripts/test_app.sh arm
24 changes: 12 additions & 12 deletions CodeEdit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3004,7 +3004,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = CodeEdit/Info.plist;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022-2023 CodeEdit";
INFOPLIST_KEY_NSPrincipalClass = CodeEdit.CodeEditApplication;
Expand All @@ -3013,7 +3013,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 0.0.1;
MARKETING_VERSION = "Change in Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = austincondiff.CodeEdit;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3091,7 +3091,7 @@
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = OpenWithCodeEdit/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = OpenWithCodeEdit;
INFOPLIST_KEY_LSUIElement = YES;
Expand Down Expand Up @@ -3189,7 +3189,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = CodeEdit/Info.plist;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022-2023 CodeEdit";
INFOPLIST_KEY_NSPrincipalClass = CodeEdit.CodeEditApplication;
Expand All @@ -3198,7 +3198,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 0.0.1;
MARKETING_VERSION = "Change in Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = austincondiff.CodeEdit;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3276,7 +3276,7 @@
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = OpenWithCodeEdit/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = OpenWithCodeEdit;
INFOPLIST_KEY_LSUIElement = YES;
Expand Down Expand Up @@ -3309,7 +3309,7 @@
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = OpenWithCodeEdit/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = OpenWithCodeEdit;
INFOPLIST_KEY_LSUIElement = YES;
Expand Down Expand Up @@ -3342,7 +3342,7 @@
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = OpenWithCodeEdit/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = OpenWithCodeEdit;
INFOPLIST_KEY_LSUIElement = YES;
Expand Down Expand Up @@ -3507,7 +3507,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = CodeEdit/Info.plist;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022-2023 CodeEdit";
INFOPLIST_KEY_NSPrincipalClass = CodeEdit.CodeEditApplication;
Expand All @@ -3516,7 +3516,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 0.0.1;
MARKETING_VERSION = "Change in Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = austincondiff.CodeEdit;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -3542,7 +3542,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = CodeEdit/Info.plist;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022-2023 CodeEdit";
INFOPLIST_KEY_NSPrincipalClass = CodeEdit.CodeEditApplication;
Expand All @@ -3551,7 +3551,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 0.0.1;
MARKETING_VERSION = "Change in Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = austincondiff.CodeEdit;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
18 changes: 18 additions & 0 deletions CodeEdit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>NSPrincipalClass</key>
<string>CodeEdit.CodeEditApplication</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>NSHumanReadableCopyright</key>
<string>${CE_COPYRIGHT}</string>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
<key>CE_VERSION_POSTFIX</key>
Expand Down
1 change: 1 addition & 0 deletions Configs/Alpha.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

CE_APPICON_NAME = AppIconAlpha
CE_VERSION_POSTFIX = -alpha
CE_COPYRIGHT = Copyright © 2022-2023 CodeEdit
1 change: 1 addition & 0 deletions Configs/Beta.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

CE_APPICON_NAME = AppIconBeta
CE_VERSION_POSTFIX = -beta
CE_COPYRIGHT = Copyright © 2022-2023 CodeEdit
1 change: 1 addition & 0 deletions Configs/Debug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

CE_APPICON_NAME = AppIconDev
CE_VERSION_POSTFIX = -dev
CE_COPYRIGHT = Copyright © 2022-2023 CodeEdit
1 change: 1 addition & 0 deletions Configs/Release.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

CE_APPICON_NAME = AppIcon
// CE_VERSION_POSTFIX = // this is a placeholder since we don't want a postfix in final release
CE_COPYRIGHT = Copyright © 2022-2023 CodeEdit
24 changes: 22 additions & 2 deletions OpenWithCodeEdit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand All @@ -13,5 +11,27 @@
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).CEOpenWith</string>
</dict>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleDisplayName</key>
<string>OpenWithCodeEdit</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>LSUIElement</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>NSHumanReadableCopyright</key>
<string>${CE_COPYRIGHT}</string>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
</dict>
</plist>

0 comments on commit fd2c961

Please sign in to comment.