Skip to content
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

Merged

Conversation

FranzBusch
Copy link
Contributor

When declaring a target like this

  BundleTarget:
    platform: iOS
    type: bundle
    info:
      path: some/path/Info.plist
    sources: [some/path/sources]

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 the CFBundleExecutable by default for targets of type bundle.

Copy link
Collaborator

@giginet giginet left a 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] {
Copy link
Collaborator

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:)

@giginet giginet requested a review from yonaskolb October 22, 2019 08:07
expectedInfoPlist["CFBundleDevelopmentRegion"] = "$(DEVELOPMENT_LANGUAGE)"
expectedInfoPlist["CFBundleShortVersionString"] = "1.0"
expectedInfoPlist["CFBundleVersion"] = "1"
expectedInfoPlist["CFBundlePackageType"] = "BNDL"
Copy link
Collaborator

@giginet giginet Oct 22, 2019

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.
Copy link
Collaborator

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

@FranzBusch
Copy link
Contributor Author

@giginet Thanks for your review, I addressed your comments.

Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks @FranzBusch!

@yonaskolb yonaskolb merged commit 7d2e5f3 into yonaskolb:master Oct 22, 2019
@FranzBusch FranzBusch deleted the bugfix/bundle-CFBundleExecutable branch October 22, 2019 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants