File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -992,6 +992,13 @@ def _crate_impl(module_ctx):
992992 repo_specific_annotations = {}
993993 for annotation_tag in mod .tags .annotation :
994994 annotation_dict = structs .to_dict (annotation_tag )
995+
996+ # Watch patch files so changes trigger repository re-generation.
997+ # This must be done before patches are stringified downstream.
998+ for patch_label in annotation_dict .get ("patches" , []):
999+ if patch_label :
1000+ module_ctx .watch (module_ctx .path (patch_label ))
1001+
9951002 if "build_script_data_select" in annotation_dict :
9961003 annotation_dict ["build_script_data" ] = struct (
9971004 common = annotation_dict ["build_script_data" ],
Original file line number Diff line number Diff line change @@ -289,6 +289,14 @@ def compile_config(
289289 if unexpected :
290290 fail ("The following annotations use `additive_build_file` which is not supported for {}: {}" .format (repository_name , unexpected ))
291291
292+ # Watch patch files so changes trigger repository re-generation.
293+ if repository_ctx :
294+ for _name , data in annotations .items ():
295+ patches = data .get ("patches" , None )
296+ if patches :
297+ for patch in patches :
298+ repository_ctx .watch (repository_ctx .path (Label (patch )))
299+
292300 # Deprecated: Apply `generate_target_compatible_with` to `render_config`.
293301 if not generate_target_compatible_with :
294302 # buildifier: disable=print
You can’t perform that action at this time.
0 commit comments