0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

bazelでcarthageで入れたframeworkをimportする

Posted at

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"
    ]
)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?