• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

bazel-ios/rules_ios: Bazel rules for building iOS applications and frameworks

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

bazel-ios/rules_ios

开源软件地址:

https://github.com/bazel-ios/rules_ios

开源编程语言:

Starlark 62.7%

开源软件介绍:

iOS Rules for Bazel

master

These rules provide some macros and rules that make it easier to build iOS application with Bazel. The heavy lifting of compiling, and packaging is still done by the existing objc_library rule in Bazel, and by the swift_library rule available from rules_swift.

The goal of rules_ios has always been to allow seamlessly transitioning a set of targets from being built in Xcode to being built in bazel, with minimal-to-no code changes. In that vein, it acts as glue between the underlying rules (rules_apple and rules_swift and the native objc rules), applying defaults that mirror what Xcode does. Additionally, rules_ios comes built-in with extension points that act as a quasi-toolchain, allowing users to customize things such as generated modulemaps.

Bazel version required by current rules is here

Xcode 12 and above supported, to find the last SHA with support for older versions see the list of git tags.

Reference documentation

Click here for the documentation.

Quick setup

Add the following lines to your WORKSPACE file. Note that since rules_swift and rules_apple no longer create releases, the versions are hardcoded to commit sha's that are known to work. You can see the particular commit sha's in repositories.bzl.

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
    name = "build_bazel_rules_ios",
    remote = "https://github.com/bazel-ios/rules_ios.git",
    branch = "master",
)

load(
    "@build_bazel_rules_ios//rules:repositories.bzl",
    "rules_ios_dependencies"
)

rules_ios_dependencies()

load(
    "@build_bazel_rules_apple//apple:repositories.bzl",
    "apple_rules_dependencies",
)

apple_rules_dependencies()

load(
    "@build_bazel_rules_swift//swift:repositories.bzl",
    "swift_rules_dependencies",
)

swift_rules_dependencies()

load(
    "@build_bazel_apple_support//lib:repositories.bzl",
    "apple_support_dependencies",
)

apple_support_dependencies()

load(
    "@com_google_protobuf//:protobuf_deps.bzl",
    "protobuf_deps",
)

protobuf_deps()

Examples

Minimal example:

load("@build_bazel_rules_ios//rules:app.bzl", "ios_application")

ios_application(
    name = "iOS-App",
    srcs = glob(["*.m"]),
    bundle_id = "com.example.ios-app",
    entitlements = "ios.entitlements",
    families = [
        "iphone",
        "ipad",
    ],
    launch_storyboard = "LaunchScreen.storyboard",
    minimum_os_version = "12.0",
    visibility = ["//visibility:public"],
)

See the tests directory for sample applications.

Special notes about debugging xcode projects

Debugging does not work in sandbox mode, due to issue #108. The workaround for now is to disable sandboxing in the .bazelrc file.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap