rules_apple icon indicating copy to clipboard operation
rules_apple copied to clipboard

`apple_resource_bundle` should bundle a default Info.plist if `infoplists` isn't set

Open brentleyjones opened this issue 3 years ago • 4 comments

A resource bundle without a valid Info.plist won't work correctly (e.g. no images will be found in it). Since infoplists is optional, it's easy to create a resource bundle that doesn't work, and is really hard to debug what is wrong.

brentleyjones avatar Mar 23 '22 14:03 brentleyjones

Many other rules require this field to be set. I've generally felt like they could have defaults in some cases too. But I wonder if for now we should make that attr required? Or I wonder if it was intentional because some cases do work without it?

keith avatar Mar 23 '22 16:03 keith

Yes it is weird that it is optional, but that the docs state:

At least one file must be specified.

How do you create a Info.plist for a apple_resource_bundle? 🤔 I am trying this empty Info.plist now

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>families</key>
	<array/>
</dict>
</plist>

But I doubt it will work correctly.

louwers avatar Jun 25 '23 17:06 louwers

This is the plist we use for them:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>CFBundleIdentifier</key>
        <string>com.lyft.$(PRODUCT_NAME)</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>$(PRODUCT_NAME)</string>
        <key>CFBundleShortVersionString</key>
        <string>1.0</string>
        <key>CFBundleVersion</key>
        <string>1.0</string>
</dict>
</plist>

keith avatar Jun 25 '23 18:06 keith

Thanks for sharing! :)

louwers avatar Jun 25 '23 21:06 louwers