buck icon indicating copy to clipboard operation
buck copied to clipboard

[App Clips]How we use buck to generate app clips?

Open dingjingpisces2015 opened this issue 4 years ago • 2 comments

Found this PR. But when try write BUCK as test file did, it can not work properly. @Lcsmarcal Could you help to provide some usage document? Thanks! 🙏

dingjingpisces2015 avatar Mar 15 '21 13:03 dingjingpisces2015

Sure! @dingjingpisces2015. Sorry for not publish a documentation about it yet. Soon I'll open a PR updating the documentation.

For now you can:

Create a normal application that will be the app clips and add it as dependency of the main app bundle. You only need to set the AppleBundle's is_app_clip property to true and xcode_product_type to com.apple.product-type.application.on-demand-install-capable, this one just for Xcode project compatibility.

apple_bundle(
     name = "AppClip",
     visibility = ["PUBLIC"],
     extension = "app",
     binary = ":ClipBinary",
     product_name = "Clip",
     info_plist = "Info.plist",
     is_app_clip = True,
     xcode_product_type = "com.apple.product-type.application.on-demand-install-capable"
 )

also you need to create a entitlements file for your app clip

apple_binary(
     name = "ClipBinary",
     visibility = ["PUBLIC"],
     ...
     entitlements_file = "Clip.entitlements"
 )

With following content:

<?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>com.apple.developer.parent-application-identifiers</key>
     <array>
         <string>$(AppIdentifierPrefix)com.buck.test.appclipapp</string>
     </array>
 </dict>
 </plist>

And that's it.

If you have any problem, specially if there's something wrong with the code sign phase, please let me know.

Lcsmarcal avatar Mar 19 '21 23:03 Lcsmarcal

I see that you was guided by the integration test. Can you say what exactly didn’t worked properly? So, if theres a problem with the implementation knowing what’s going on will help me to submit a fix for that.

Lcsmarcal avatar Mar 20 '21 14:03 Lcsmarcal