def _path_in_contents_dir(ctx, path):
  """Makes a path relative to where the bundle's contents are stored.

  Contents include files such as:
  * A directory of resources (which itself might be flattened into contents)
  * A directory for the binary (which might be flattened)
  * Directories for Frameworks and PlugIns (extensions)
  * The bundle's Info.plist and PkgInfo
  * The code signature

  Args:
    ctx: The Skylark context.
    path: The path to make relative to where the bundle's contents are stored.
  Returns:
    The path, made relative to where the bundle's contents are stored.
  """
  return ctx.attr._bundle_contents_path_format % (path or "")