| Tim Windelschmidt | 6cca932 | 2025-04-15 21:13:32 +0200 | [diff] [blame^] | 1 | TargetInfo = provider( |
| 2 | "A simple provider to hold target information.", | ||||
| 3 | fields = { | ||||
| 4 | "value": "The value of the target information.", | ||||
| 5 | }, | ||||
| 6 | ) | ||||
| 7 | |||||
| 8 | def _target_info_impl(ctx): | ||||
| 9 | return [ | ||||
| 10 | TargetInfo( | ||||
| 11 | value = ctx.attr.value, | ||||
| 12 | ), | ||||
| 13 | ] | ||||
| 14 | |||||
| 15 | target_info = rule( | ||||
| 16 | implementation = _target_info_impl, | ||||
| 17 | attrs = { | ||||
| 18 | "value": attr.string( | ||||
| 19 | mandatory = True, | ||||
| 20 | ), | ||||
| 21 | }, | ||||
| 22 | doc = "A simple rule to determine a target information based on selects.", | ||||
| 23 | ) | ||||