Buck: apple_resource()
Support Ukraine. Help Provide Humanitarian Aid to Ukraine.

apple_resource()

This is liable to change in the future.

An apple_resource() rule contains sets of resource directories, files and file variants that can be bundled in an application bundle. This rule does not have any output on its own and can be built only as a dependency (either direct or transitive) of an apple_bundle() rule.

Arguments

  • name (required) #

    The short name for this build target.

  • dirs (required) #

    Set of paths of resource directories that should be placed in an application bundle.

  • files (required) #

    Set of paths of resource files that should be placed in an application bundle.

  • variants (defaults to []) #

    Set of paths of resource file variants that should be placed in an application bundle. The files mentioned here should be placed in a directory named $VARIANT_NAME.lproj, where $VARIANT_NAME is the name of the variant (e.g. Base, en). This argument makes it possible to use different resource files based on the active locale.

  • resources_from_deps (defaults to []) #

    Set of build targets whose transitive apple_resources should be considered as part of the current resource when collecting resources for bundles. Usually, an apple_bundle collects all apple_resource rules transitively reachable through apple_library rules. This field allows for resources which are not reachable using the above traversal strategy to be considered for inclusion in the bundle.

  • destination (defaults to resources) #

    Specifies the destination in the final application bundle where resource will be copied. Possible values: "resources", "frameworks", "executables", "plugins", "xpcservices".

  • codesign_on_copy (defaults to False) #

    Indicates whether the files specified in the files arg in this resource should be code signed with the identity used to sign the overall bundle. This is useful for e.g. dylibs or other additional binaries copied into the bundle. The caller is responsible to ensure that the file format is valid for codesigning.

  • visibility (defaults to []) #

    List of build target patterns that identify the build rules that can include this rule as a dependency, for example, by listing it in their deps or exported_deps attributes. For more information, see visibility.

  • licenses (defaults to []) #

    Set of license files for this library. To get the list of license files for a given build rule and all of its dependencies, you can use buck query.

  • labels (defaults to []) #

    Set of arbitrary strings which allow you to annotate a build rule with tags that can be searched for over an entire dependency tree using buck query attrfilter().

Examples

apple_resource(
  name = 'Images',
  files = glob([
    '*.png',
  ]),
  dirs = [
    'PrettyImages',
  ],
)