tulsi icon indicating copy to clipboard operation
tulsi copied to clipboard

Resources added through `apple_resource_bundle` don't show up in generated Xcode project

Open thii opened this issue 1 year ago • 0 comments

In the following example, Main.storyboard doesn't show up in the generated Xcode project if it's added through an apple_resource_bundle target, but if it's added directly via data, the file shows up.

load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application")
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
load(
    "@build_bazel_rules_apple//apple:versioning.bzl",
    "apple_bundle_version",
)

apple_resource_bundle(
    name = "Storyboard",
    resources = ["Resources/Main.storyboard"],
)

objc_library(
    name = "Sources",
    srcs = [
        "Sources/AppDelegate.h",
        "Sources/AppDelegate.m",
        "Sources/main.m",
    ],
    # Resources added through apple_resource_bundle doesn't show up in the project,
    data = [":Storyboard"],
    # but they do if they are added directly like below.
    # data = ["Resources/Main.storyboard"],
)

ios_application(
    name = "HelloWorld",
    bundle_id = "com.example.hello-world",
    families = [
        "iphone",
        "ipad",
    ],
    infoplists = [":Info.plist"],
    minimum_os_version = "8.0",
    version = ":HelloWorldVersion",
    deps = [":Sources"],
)

apple_bundle_version(
    name = "HelloWorldVersion",
    build_version = "1.0",
)

In the attached example below, run this to generate the Xcode project:

bazel run  -- @tulsi//:tulsi -- --genconfig "`pwd`/HelloWorld.tulsiproj" --outputfolder=`pwd`

tulsi-apple_resource_bundle-issue.zip

thii avatar Sep 01 '22 03:09 thii