Carthageのframeworkの直下にBUILDを置くと便利そう。
Carthage/Build/iOS/BUILD
package(default_visibility = ["//visibility:public"])
load(
"@build_bazel_rules_apple//apple:apple.bzl",
"apple_dynamic_framework_import",
"apple_static_framework_import",
)
apple_dynamic_framework_import(
name = "Closures",
framework_imports = glob(["Closures.framework/**"]),
)
こんな感じ。visibilityをpublicにしないとアプリのBUILDから参照できないので注意
あとはアプリ側のBUILDはこんな感じ
swift_library(
name = "Sources",
srcs = glob(["*.swift"]),
data = [
"Base.lproj/LaunchScreen.storyboard",
"Base.lproj/Main.storyboard",
],
deps = [
"//Carthage/Build/iOS:Closures"
]
)