Feature request from nextend, posted on GitHub Jun 10, 2016
It would be great if you could add extend the setup:di:compile command with hooks to be able to exclude specific directories in our extensions. My extension is a crossplatform application and the compiler always fails as it uses custom autoloader and lot of special things. With the current Magento 2 compiler I can not release it.
As far as I see the test folders excluded only and there is no hooks anywhere to intercept the excludes and place mine in place.
Related stackexchange question: http://magento.stackexchange.com/questions/119967/magento2-custom-autoloader