You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write to one or more files or folders in the source tree. Stamp out tests that ensure the sources exist and are up to date.
@@ -89,6 +90,7 @@ If you have many sources that you want to update as a group, we recommend wrappi
89
90
| <aid="write_source_files-files"></a>files | A dict where the keys are source files or folders to write to and the values are labels pointing to the desired content. Sources must be within the same bazel package as the target. | <code>{}</code> |
90
91
| <aid="write_source_files-additional_update_targets"></a>additional_update_targets | (Optional) List of other write_source_file or other executable updater targets to call in the same run | <code>[]</code> |
91
92
| <aid="write_source_files-suggested_update_target"></a>suggested_update_target | (Optional) Label of the write_source_file target to suggest running when files are out of date | <code>None</code> |
93
+
| <aid="write_source_files-diff_test"></a>diff_test | (Optional) Generate a test target to check that the source file(s) exist and are up to date with the generated files(s). | <code>True</code> |
92
94
| <aid="write_source_files-kwargs"></a>kwargs | Other common named parameters such as <code>tags</code> or <code>visibility</code> | none |
fail("out file %s (in package '%s') must be a source file within the target's package: '%s'"% (ctx.attr.out_file.label, ctx.attr.out_file.label.package, ctx.label.package))
130
-
247
+
ifctx.attr.out_fileandnotctx.attr.in_file:
248
+
fail("in_file must be specified if out_file is set")
131
249
ifctx.attr.in_fileandnotctx.attr.out_file:
132
-
ifnotctx.attr.in_file:
133
-
fail("out_file must be specified if in_file is set")
250
+
fail("out_file must be specified if in_file is set")
0 commit comments