A macro feature is good for this kind of thing. They can execute code on every rebuild. See
for an example of what a macro to create a macro feature looks like.