I didn't see anything obvious in the project properties, but perhaps a small extra utility as the counter, which could be called as part of the Custom Build Step?