-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
119 lines (106 loc) · 3.3 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
119
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load(
"@cgrindel_bazel_starlib//bzlformat:defs.bzl",
"bzlformat_missing_pkgs",
"bzlformat_pkg",
)
load("@cgrindel_bazel_starlib//bzltidy:defs.bzl", "tidy", "tidy_all")
load(
"@cgrindel_bazel_starlib//updatesrc:defs.bzl",
"updatesrc_update_all",
)
load(
"@rules_bazel_integration_test//bazel_integration_test:defs.bzl",
"integration_test_utils",
)
bzlformat_pkg(name = "bzlformat")
bzlformat_missing_pkgs(
name = "bzlformat_missing_pkgs",
)
tidy(
name = "tidy",
targets = [
# Remove the child workspace symlinks before doing some of the other
# operations that my experience infinite symlink expansion errors.
"@rules_bazel_integration_test//tools:remove_child_wksp_bazel_symlinks",
"@rules_bazel_integration_test//tools:update_deleted_packages",
":bzlformat_missing_pkgs_fix",
":update_all",
":update_build_files",
],
)
tidy_all(name = "tidy_all")
tidy_all(
name = "tidy_modified",
mode = "modified",
)
updatesrc_update_all(
name = "update_all",
targets_to_run = [
"//doc:update",
":bzlformat_missing_pkgs_fix",
],
)
# This declaration builds a Gazelle binary that incorporates all of the Gazelle
# plugins for the languages that you use in your workspace.
gazelle_binary(
name = "gazelle_bin",
languages = [
"@bazel_skylib_gazelle_plugin//bzl",
],
)
# This target updates the Bazel build files for your project. Run this target
# whenever you add or remove source files from your project.
gazelle(
name = "update_build_files",
gazelle = ":gazelle_bin",
)
# MARK: - Related to Integration Tests
# Provides the *.bazlerc files for the example workspace integration tests.
filegroup(
name = "shared_bazelrc_files",
srcs = glob(["*.bazelrc"]),
visibility = ["//:__subpackages__"],
)
# The example workspaces use local_repository_files to reference this workspace.
# This target collects all of the files needed for the child workspaces.
filegroup(
name = "local_repository_files",
srcs = [
"BUILD.bazel",
"MODULE.bazel",
"WORKSPACE",
"//swiftformat:all_files",
"//swiftformat/internal:all_files",
"//swifttidy:all_files",
"//swifttidy/bzlmod:all_files",
"//swifttidy/internal:all_files",
"//swifttidy/toolchains:all_files",
],
visibility = ["//:__subpackages__"],
)
test_suite(
name = "all_integration_tests",
tags = integration_test_utils.DEFAULT_INTEGRATION_TEST_TAGS,
tests = [
"//examples:integration_tests",
],
visibility = ["//:__subpackages__"],
)
# In February 2024, the following tests started failing in CI on the GitHub
# macos-13 runner.
# //examples:exclude_files_test
# //examples:rules_swift_helpers_test
# There is no output in the failure. Debugging on the runner shows that xctest
# is failing with exit code 83. I have not found a solution to this problem.
# We will not run these tests on MacOS.
# NOTE: These tests succeed when run locally.
test_suite(
name = "macos_ci_integration_tests",
tags = integration_test_utils.DEFAULT_INTEGRATION_TEST_TAGS,
tests = [
"//examples:legacy_test",
"//examples:simple_test",
],
visibility = ["//:__subpackages__"],
)