This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
forked from envoyproxy/envoy-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD
119 lines (107 loc) · 2.8 KB
/
BUILD
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
load("@io_bazel_rules_kotlin//kotlin/internal:toolchains.bzl", "define_kt_toolchain")
licenses(["notice"]) # Apache 2
alias(
name = "ios_framework",
actual = "//library/swift:ios_framework",
visibility = ["//visibility:public"],
)
genrule(
name = "ios_dist",
srcs = [":ios_framework"],
outs = ["ios_out"],
cmd = """
unzip -o $< -d dist/
touch $@
""",
stamp = True,
# This action writes to a non-hermetic output location, so it needs to run
# locally.
tags = ["local"],
)
alias(
name = "android_aar",
actual = "//library/kotlin/io/envoyproxy/envoymobile:envoy_aar",
visibility = ["//visibility:public"],
)
genrule(
name = "android_dist_ci",
srcs = [
"//library/kotlin/io/envoyproxy/envoymobile:envoy_aar_with_artifacts",
],
outs = ["envoy_mobile.zip"],
cmd = """
for artifact in $(SRCS); do
chmod 755 $$artifact
cp $$artifact dist/
done
touch $@
""",
local = True,
stamp = True,
tools = ["//bazel:zipper"],
visibility = ["//visibility:public"],
)
genrule(
name = "android_dist",
srcs = [
"//library/kotlin/io/envoyproxy/envoymobile:envoy_aar",
"//library/kotlin/io/envoyproxy/envoymobile:envoy_aar_pom_xml",
"//library/kotlin/io/envoyproxy/envoymobile:envoy_aar_objdump_collector",
],
outs = ["output_in_dist_directory"],
cmd = """
set -- $(SRCS)
chmod 755 $$1
chmod 755 $$2
cp $$1 dist/envoy.aar
cp $$2 dist/envoy-pom.xml
shift 2
mkdir -p dist/symbols
if [[ -n "$$@" ]]; then
chmod 755 $$@
cp $$@ dist/symbols
tar -cvf dist/symbols.tar dist/symbols
fi
touch $@
""",
stamp = True,
# This action writes to a non-hermetic output location, so it needs to run
# locally.
tags = ["local"],
)
define_kt_toolchain(
name = "kotlin_toolchain",
jvm_target = "1.8",
)
filegroup(
name = "kotlin_lint_config",
srcs = [".kotlinlint.yml"],
visibility = ["//visibility:public"],
)
filegroup(
name = "editor_config",
srcs = [".editorconfig"],
visibility = ["//visibility:public"],
)
genrule(
name = "kotlin_format",
srcs = ["//:editor_config"],
outs = ["kotlin_format.txt"],
cmd = """
$(location @kotlin_formatter//file) --android "**/*.kt" \
--reporter=plain --reporter=checkstyle,output=$@ \
--editorconfig=$(location //:editor_config)
""",
tools = ["@kotlin_formatter//file"],
)
genrule(
name = "kotlin_format_fix",
srcs = ["//:editor_config"],
outs = ["kotlin_format_fix.txt"],
cmd = """
$(location @kotlin_formatter//file) -F --android "**/*.kt" \
--reporter=plain --reporter=checkstyle,output=$@ \
--editorconfig=$(location //:editor_config)
""",
tools = ["@kotlin_formatter//file"],
)