Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit 7807ce2

Browse files
Sergey Tyurinfacebook-github-bot
Sergey Tyurin
authored andcommitted
Add visibility to configuration targets in tests
Summary: This will be enforced later. Reviewed By: jtorkkola shipit-source-id: de08c23f5e
1 parent f2f5e44 commit 7807ce2

File tree

3 files changed

+75
-0
lines changed
  • test/com/facebook/buck
    • core/rules/configsetting/testdata
    • testutil/integration/testlibs/config/constraints

3 files changed

+75
-0
lines changed

test/com/facebook/buck/core/rules/configsetting/testdata/project_with_constraints/BUCK.fixture

+30
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ platform(
44
"buck//config/constraints:osx",
55
"buck//config/constraints:x86_64",
66
],
7+
visibility = [
8+
"PUBLIC",
9+
],
710
)
811

912
platform(
@@ -12,6 +15,9 @@ platform(
1215
"buck//config/constraints:linux",
1316
"buck//config/constraints:aarch64",
1417
],
18+
visibility = [
19+
"PUBLIC",
20+
],
1521
)
1622

1723
platform(
@@ -20,13 +26,19 @@ platform(
2026
"buck//config/constraints:arm",
2127
"buck//config/constraints:linux",
2228
],
29+
visibility = [
30+
"PUBLIC",
31+
],
2332
)
2433

2534
config_setting(
2635
name = "osx_config",
2736
constraint_values = [
2837
"buck//config/constraints:osx",
2938
],
39+
visibility = [
40+
"PUBLIC",
41+
],
3042
)
3143

3244
config_setting(
@@ -35,6 +47,9 @@ config_setting(
3547
"buck//config/constraints:osx",
3648
"buck//config/constraints:x86_64",
3749
],
50+
visibility = [
51+
"PUBLIC",
52+
],
3853
)
3954

4055
config_setting(
@@ -46,6 +61,9 @@ config_setting(
4661
values = {
4762
"cat.file": "a",
4863
},
64+
visibility = [
65+
"PUBLIC",
66+
],
4967
)
5068

5169
config_setting(
@@ -58,6 +76,9 @@ config_setting(
5876
"cat.file": "a",
5977
"cat.file2": "b",
6078
},
79+
visibility = [
80+
"PUBLIC",
81+
],
6182
)
6283

6384
config_setting(
@@ -66,6 +87,9 @@ config_setting(
6687
"buck//config/constraints:linux",
6788
"buck//config/constraints:aarch64",
6889
],
90+
visibility = [
91+
"PUBLIC",
92+
],
6993
)
7094

7195
config_setting(
@@ -76,6 +100,9 @@ config_setting(
76100
values = {
77101
"cat.file": "a",
78102
},
103+
visibility = [
104+
"PUBLIC",
105+
],
79106
)
80107

81108
config_setting(
@@ -87,6 +114,9 @@ config_setting(
87114
values = {
88115
"cat.file": "b",
89116
},
117+
visibility = [
118+
"PUBLIC",
119+
],
90120
)
91121

92122
genrule(

test/com/facebook/buck/core/rules/configsetting/testdata/simple_project/BUCK.fixture

+18
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,19 @@ config_setting(
3434
values = {
3535
"cat.file": "a",
3636
},
37+
visibility = [
38+
"PUBLIC",
39+
],
3740
)
3841

3942
config_setting(
4043
name = "b",
4144
values = {
4245
"cat.file": "b",
4346
},
47+
visibility = [
48+
"PUBLIC",
49+
],
4450
)
4551

4652
config_setting(
@@ -49,6 +55,9 @@ config_setting(
4955
"cat.file": "b",
5056
"cat.file2": "c",
5157
},
58+
visibility = [
59+
"PUBLIC",
60+
],
5261
)
5362

5463
genrule(
@@ -70,6 +79,9 @@ config_setting(
7079
values = {
7180
"another.option": "c",
7281
},
82+
visibility = [
83+
"PUBLIC",
84+
],
7385
)
7486

7587
genrule(
@@ -95,13 +107,19 @@ config_setting(
95107
values = {
96108
"java.version": "7",
97109
},
110+
visibility = [
111+
"PUBLIC",
112+
],
98113
)
99114

100115
config_setting(
101116
name = "java_version_8",
102117
values = {
103118
"java.version": "8",
104119
},
120+
visibility = [
121+
"PUBLIC",
122+
],
105123
)
106124

107125
java_library(
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,69 @@
11
os_constraint_detector(
22
name = "os-detector",
3+
visibility = [
4+
"PUBLIC",
5+
],
36
)
47

58
constraint_setting(
69
name = "os",
710
host_constraint_detector = ":os-detector",
11+
visibility = [
12+
"PUBLIC",
13+
],
814
)
915

1016
constraint_value(
1117
name = "linux",
1218
constraint_setting = ":os",
19+
visibility = [
20+
"PUBLIC",
21+
],
1322
)
1423

1524
constraint_value(
1625
name = "osx",
1726
constraint_setting = ":os",
27+
visibility = [
28+
"PUBLIC",
29+
],
1830
)
1931

2032
cpu_constraint_detector(
2133
name = "cpu-detector",
34+
visibility = [
35+
"PUBLIC",
36+
],
2237
)
2338

2439
constraint_setting(
2540
name = "cpu",
2641
host_constraint_detector = ":cpu-detector",
42+
visibility = [
43+
"PUBLIC",
44+
],
2745
)
2846

2947
constraint_value(
3048
name = "x86_64",
3149
constraint_setting = ":cpu",
50+
visibility = [
51+
"PUBLIC",
52+
],
3253
)
3354

3455
constraint_value(
3556
name = "aarch64",
3657
constraint_setting = ":cpu",
58+
visibility = [
59+
"PUBLIC",
60+
],
3761
)
3862

3963
constraint_value(
4064
name = "arm",
4165
constraint_setting = ":cpu",
66+
visibility = [
67+
"PUBLIC",
68+
],
4269
)

0 commit comments

Comments
 (0)