Serge Bazanski | 394b67e | 2023-07-19 17:34:34 +0200 | [diff] [blame] | 1 | BuildKindProvider = provider(fields = ['type']) |
| 2 | |
| 3 | def _impl(ctx): |
| 4 | values = ['full', 'lite'] |
| 5 | value = ctx.build_setting_value |
| 6 | if value not in values: |
| 7 | fail(str(ctx.label) + " build setting allowed to take values {full, lite} but was set to " + value) |
| 8 | |
| 9 | return BuildKindProvider(type = value) |
| 10 | |
| 11 | buildkind = rule( |
| 12 | implementation = _impl, |
| 13 | build_setting = config.string(flag = True), |
| 14 | doc = """ |
| 15 | Build kind for userspace tools, either full (will have a direct |
| 16 | dependency on data files) or lite (will not have a direct dependency on |
| 17 | data files and will not attempt to load them). |
| 18 | """, |
| 19 | ) |