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

Fix resource bundle's CFBundleName #728

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

jszumski
Copy link
Collaborator

@jszumski jszumski commented Jun 2, 2023

Fix issue where a resource bundle's Info.plist value for CFBundleName incorrectly included the bundle extension.

In the generated plist:

-   "CFBundleName" => "ATMFinderResourcesbundle"
+   "CFBundleName" => "ATMFinderResources"

@@ -121,7 +121,7 @@ def _precompiled_apple_resource_bundle_impl(ctx):
control_files = []
input_files = []
output_files = []
output_bundle_dir = ctx.actions.declare_directory(paths.join(ctx.attr.name, bundle_name + ".bundle"))
output_bundle_dir = ctx.actions.declare_directory(paths.join(ctx.attr.name, bundle_name + ctx.attr.bundle_extension))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This wasn't a functional change but seemed appropriate if the attribute exists already

@@ -252,7 +252,7 @@ _precompiled_apple_resource_bundle = rule(
),
bundle_extension = attr.string(
mandatory = False,
default = "bundle",
default = ".bundle",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without the leading period this call to paths.replace_extension in rules_apple fails to remove the extension:

    bundle_name_with_extension = bundle_name + bundle_extension
    product_name = paths.replace_extension(bundle_name_with_extension, "")

    # Values for string replacement substitutions to perform in the merged
    # Info.plist
    substitutions = {
        "BUNDLE_NAME": bundle_name_with_extension,
        "PRODUCT_NAME": product_name,
    }

@jszumski jszumski requested a review from luispadron June 2, 2023 14:28
@jszumski jszumski force-pushed the jszumski/fix-bundle-product-name branch from 1c8aea9 to 3f45612 Compare June 2, 2023 20:06
@jszumski jszumski enabled auto-merge (squash) June 2, 2023 20:08
@jszumski jszumski merged commit cfcb0bf into master Jun 2, 2023
@jszumski jszumski deleted the jszumski/fix-bundle-product-name branch June 2, 2023 21:12
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.

5 participants