forked from material-components/material-components-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
material_components_ios.bzl
48 lines (42 loc) · 1.52 KB
/
material_components_ios.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""Bazel macros for building MDC component libraries."""
load("@bazel_ios_warnings//:strict_warnings_objc_library.bzl", "strict_warnings_objc_library")
def mdc_objc_library(
name,
copts = [],
**kwargs):
"""Declare an Objective-C library with strict_warnings_objc_library."""
strict_warnings_objc_library(
name = name,
copts = copts,
**kwargs)
def mdc_public_objc_library(
name,
deps = [],
extra_srcs = [],
sdk_frameworks = [],
visibility = ["//visibility:public"],
**kwargs):
"""Declare a public MDC component as a Objective-C library according to MDC's conventions.
The conventions for an MDC component are:
- The public implementation lives inside of src.
- The private implementation lives inside of src/private.
The default visibility of "//visibility:public" can be overridden, for
example, "//some/package:__subpackages__".
Args:
name: The name of the library.
deps: The dependencies of the library.
extra_srcs: Extra sources to add to the standard ones.
sdk_frameworks: The SDK frameworks needed, e.g. "CoreGraphics".
visibility: The visibility of the package.
**kwargs: Any arguments accepted by _mdc_objc_library().
"""
mdc_objc_library(
name = name,
deps = deps,
sdk_frameworks = sdk_frameworks,
visibility = visibility,
srcs = native.glob(["src/*.m", "src/private/*.h", "src/private/*.m"]) + extra_srcs,
hdrs = native.glob(["src/*.h"]),
includes = ["src"],
enable_modules = 1,
**kwargs)