-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.bazel
70 lines (60 loc) · 1.81 KB
/
BUILD.bazel
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
load("@build_bazel_rules_apple//apple:macos.bzl", "macos_command_line_application")
load("@rules_cc//cc:defs.bzl", "objc_library")
SWIFT_VERSION = "5"
MACOS_VERSION = "10.15.4"
objc_library(
name = "ObjcSupport",
srcs = glob(["Sources/ObjcSupport/*.m"]),
hdrs = glob(["Sources/ObjcSupport/include/*"]),
includes = ["Sources/ObjcSupport/include"]
)
# Logger
swift_library(
name = "Logger",
srcs = glob(["Sources/Logger/**/*.swift"]),
copts = ["-swift-version", SWIFT_VERSION],
)
# BazelPods
macos_command_line_application(
name = "bazelpods",
minimum_os_version = MACOS_VERSION,
deps = [":BazelPodsLib"],
visibility = ["//visibility:public"]
)
swift_library(
name = "BazelPodsLib",
srcs = glob([
"Sources/BazelPods/**/*.swift",
"Sources/Shared/**/*.swift"
]),
deps = [":BazelPodsCore", ":Logger", "@bazelpods_swift_argument_parser//:ArgumentParser"],
copts = ["-swift-version", SWIFT_VERSION]
)
# BazelPodsCore is a core library enabling Starlark code generation
swift_library(
name = "BazelPodsCore",
srcs = glob([
"Sources/BazelPodsCore/**/*.swift",
"Sources/Shared/**/*.swift"
]),
deps = [":ObjcSupport", ":Logger"],
copts = ["-swift-version", SWIFT_VERSION],
visibility = ["//Tests:__pkg__"]
)
# Analyzer
macos_command_line_application(
name = "Analyzer",
minimum_os_version = MACOS_VERSION,
deps = [":AnalyzerLib"],
visibility = ["//visibility:public"]
)
swift_library(
name = "AnalyzerLib",
srcs = glob([
"Sources/Analyzer/**/*.swift",
"Sources/Shared/**/*.swift"
]),
deps = [":BazelPodsCore", ":Logger", "@bazelpods_swift_argument_parser//:ArgumentParser"],
copts = ["-swift-version", SWIFT_VERSION],
)