Support for multiple source sets and project configuration dependencies

Thanks to @matsuimp

Dependencies on project configurations are related to 345cfaef70438ea9d144af1161d850f81b318204