HV-907 Fixing unwanted generated classes after build

This seems to fix the problem though. I want to apply some other changes as well though. I will create a superseding pull request later.