30d0cc3a34
In some cases IC needs to perform a rebuild. Before this change IC was not clearing output directories besides destination dir for classes, so for example kapt stubs were not cleared. Stalled stubs might lead to compile errors. For example: 1. foo/XGen.java is generated from annotated class foo/X (XGen also references X). 2. foo/X is moved to bar/X and some other change forces IC to rebuild. 3. kapt generates bar/X stub, but foo/X stub was not removed because stubs dir is not cleared. 4. kapt runs annotation processors, foo/XGen.java is generated from foo/X stub, bar/XGen.java is generated from bar/X stub. 5. kotlinc rebuilds. Since destination dir is cleared properly, only bar/X.class exists. 6. javac tries to compile foo/XGen and fails, because it compiles against actual Kotlin classes, not stubs. This commit fixes the issue by passing all output directories of a task from Gradle to Kotlin IC. #KT-21735 fixed