-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't generate CFBundleExecutable for targets of type bundle #689
Don't generate CFBundleExecutable for targets of type bundle #689
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks!
@@ -8,20 +8,26 @@ public class InfoPlistGenerator { | |||
Default info plist attributes taken from: | |||
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/Project Templates/Base/Base_DefinitionsInfoPlist.xctemplate/TemplateInfo.plist | |||
*/ | |||
var defaultInfoPlist: [String: Any] = { | |||
private func generateDefaultInfoPlist(target: Target) -> [String: Any] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the naming guideline, I prefer to be more grammatical name like generateDefaultInfoPlist(for:)
expectedInfoPlist["CFBundleDevelopmentRegion"] = "$(DEVELOPMENT_LANGUAGE)" | ||
expectedInfoPlist["CFBundleShortVersionString"] = "1.0" | ||
expectedInfoPlist["CFBundleVersion"] = "1" | ||
expectedInfoPlist["CFBundlePackageType"] = "BNDL" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make it be immutable variable.
let expectedInfoPlist: [String: Any] = [
"CFBundleIdentifier": "$(PRODUCT_BUNDLE_IDENTIFIER)",
// ...
]
dictionary["CFBundleName"] = "$(PRODUCT_NAME)" | ||
dictionary["CFBundleDevelopmentRegion"] = "$(DEVELOPMENT_LANGUAGE)" | ||
dictionary["CFBundleShortVersionString"] = "1.0" | ||
dictionary["CFBundleVersion"] = "1" | ||
|
||
// Bundles should not contain any CFBundleExecutable otherwise they will be rejected when uploading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update ProjectSpec documentation too?
https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md#target
The following properties are generated automatically
@giginet Thanks for your review, I addressed your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks @FranzBusch!
When declaring a target like this
The generated Info.plist file contains a key
CFBundleExecutable
by default. This key indicates that the bundle has a executable. When uploading an application with such a bundle that contains the Info.plist AppStore connect will decline the binary since a bundle by default doesn't contain any executable but rather only resources. Therefore, I suggest we do not generate theCFBundleExecutable
by default for targets of typebundle
.