-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
118 lines (98 loc) · 2.91 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
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
package(default_visibility = ["//visibility:public"])
alias(
name = "keyderivation",
actual = "//src/main/kotlin/nl/tulipsolutions/keyderivation",
)
alias(
name = "byteutils",
actual = "//src/main/kotlin/nl/tulipsolutions/byteutils",
)
alias(
name = "mnemonic",
actual = "//src/main/kotlin/nl/tulipsolutions/mnemonic",
)
alias(
name = "keyderivation-deps.bzl",
actual = "//src/main/kotlin/nl/tulipsolutions/keyderivation/deps.bzl",
)
### Formatter
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "define_kt_toolchain")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@nl_tulipsolutions_bazel_tools//rules_ktlint:def.bzl", "ktlint")
load("@nl_tulipsolutions_bazel_tools//rules_intellij_formatter:def.bzl", "intellij_formatter")
load("@nl_tulipsolutions_bazel_tools//rules_addlicense:def.bzl", "addlicense")
load("@bazel_gazelle//:def.bzl", "gazelle")
define_kt_toolchain(
name = "kotlin_toolchain",
api_version = "1.3",
jvm_target = "11",
language_version = "1.3",
)
exclude_patterns = [
".*.git/*",
".*.project/*",
".*idea/*",
"./.ijwb/*",
]
# Formatting for BUILD, BUILD.bazel and WORKSPACE files
buildifier(
name = "buildifier_check",
diff_command = "diff -u",
exclude_patterns = exclude_patterns,
mode = "diff",
verbose = True,
)
buildifier(
name = "buildifier_format",
exclude_patterns = exclude_patterns,
mode = "fix",
)
# Formatting for *.kt and *.kts files
ktlint(
name = "ktlint_check",
)
ktlint(
name = "ktlint_format",
format = True,
)
intellij_formatter(
name = "intellij_format",
exclude_patterns = exclude_patterns,
)
intellij_formatter(
name = "intellij_check",
exclude_patterns = exclude_patterns,
mode = "check",
)
# Force Gazelle to create one rule per proto package using go_package option
# Until https://github.com/bazelbuild/bazel-gazelle/issues/138 is resolved
# gazelle:proto package
# gazelle:proto_group go_package
# gazelle:prefix gerrit/protocol
# gazelle:resolve proto proto validate/validate.proto @com_envoyproxy_protoc_gen_validate//validate:validate_proto
# gazelle:resolve proto go validate/validate.proto @com_envoyproxy_protoc_gen_validate//validate:go_default_library
# gazelle:resolve go go google.golang.org/grpc @org_golang_google_grpc//:go_default_library
# gazelle:ignore
# gazelle:exclude third_party
# gazelle:exclude node_modules
# gazelle:exclude tecl/examples/node/node_modules
gazelle(
name = "gazelle",
gazelle = "//bazel/gazelle",
)
addlicense_excludes = exclude_patterns + [
"*.yml",
]
addlicense(
name = "addlicense_format",
copyright_holder = "Tulip Solutions B.V.",
exclude_patterns = addlicense_excludes,
license_type = "apache",
)
addlicense(
name = "addlicense_check",
copyright_holder = "Tulip Solutions B.V.",
exclude_patterns = addlicense_excludes,
license_type = "apache",
mode = "check",
)