Bazel 生成静态Framework , 并且打包一个Bundle资源文件
BUILD
文件
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_static_framework")
load("@build_bazel_rules_apple//apple/internal/resource_rules:apple_resource_bundle.bzl", "apple_resource_bundle")
ios_static_framework( #生成静态framework, 如果用ios_framework生成的是动态库
name = "test_framework",
families = [
"iphone",
],
minimum_os_version = "9.0",
deps = [
":static_lib",
],
bundle_name = "TestStatic",
hdrs = ["universal/TestStaticFramework.h"]
)
objc_library(
name = "static_lib",
srcs = ["universal/TestStaticFramework.m"],
hdrs = glob([
"universal/TestStaticFramework.h"
]),
data = [
":static_bundle",
],
)
#创建bundle资源文件, 资源文件包含一张图片
apple_resource_bundle(
name = "static_bundle",
resources = [":222.jpg"],
)
编译
bazel build //universal:test_framework
网友评论