@@ -66,7 +66,8 @@ def _volcano_impl(ctx):
66
66
height = ctx.attr.height[BuildSettingInfo].value,
67
67
active = ctx.attr.active[BuildSettingInfo].value,
68
68
namer = ctx.attr.namer[BuildSettingInfo].value,
69
- nicknames = ctx.attr.nicknames[BuildSettingInfo].value
69
+ nicknames = ctx.attr.nicknames[BuildSettingInfo].value,
70
+ hazards = ctx.attr.hazards[BuildSettingInfo].value
70
71
)
71
72
print(description)
72
73
@@ -77,6 +78,7 @@ volcano = rule(
77
78
"active" : attr.label(),
78
79
"namer": attr.label(),
79
80
"nicknames": attr.label(),
81
+ "hazards": attr.label(),
80
82
}
81
83
)
82
84
EOF
89
91
"bool_flag",
90
92
"string_flag",
91
93
"string_list_flag",
94
+ "string_list_repeatable_flag",
92
95
)
93
96
load("//volcano:rules.bzl", "volcano")
94
97
@@ -113,6 +116,11 @@ string_list_flag(
113
116
build_setting_default = ["loowit", "loowitiatkla", "lavelatla"]
114
117
)
115
118
119
+ string_list_repeatable_flag(
120
+ name = "hazards-flag",
121
+ build_setting_default = ["lava", "pyroclastic-flow", "ash"]
122
+ )
123
+
116
124
int_setting(
117
125
name = "height-setting",
118
126
build_setting_default = 9677
@@ -124,6 +132,7 @@ volcano(
124
132
active = ":active-flag",
125
133
namer = ":namer-flag",
126
134
nicknames = ":nicknames-flag",
135
+ hazards = ":hazards-flag",
127
136
)
128
137
EOF
129
138
@@ -136,12 +145,15 @@ function test_can_set_flags() {
136
145
bazel build volcano:mt-st-helens --//volcano:height-flag=8366 \
137
146
--//volcano:active-flag=False --//volcano:namer-flag=puyallup-tribe \
138
147
--//volcano:nicknames-flag=volcano-mc-volcanoface \
148
+ --//volcano:hazards-flag=lava \
149
+ --//volcano:hazards-flag=hydrogen-sulfide \
139
150
> " $TEST_log " 2>&1 || fail " Expected test to pass"
140
151
141
152
expect_log " active = False"
142
153
expect_log " height = 8366"
143
154
expect_log " namer = \" puyallup-tribe\" "
144
155
expect_log " nicknames = \[\" volcano-mc-volcanoface\" \]"
156
+ expect_log " hazards = \[\" lava\" \, \" hydrogen-sulfide\" ]"
145
157
}
146
158
147
159
function test_cannot_set_settings() {
0 commit comments