JPS: exclude source roots from other targets

Previously `findJavaRootDescriptor` was return source root for random
module. This cause build errors for mpp (same file may appear in
multiple source roots of common and platform modules)

#KT-28988 Fixed
This commit is contained in:
Sergey Rostov
2019-01-10 16:23:08 +03:00
parent 8a0057b387
commit 75e59fdc46
7 changed files with 61 additions and 4 deletions
@@ -594,6 +594,11 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
runTest("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg/");
}
@TestMetadata("complementaryFiles")
public void testComplementaryFiles() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/multiplatform/custom/complementaryFiles/");
}
@TestMetadata("notSameCompiler")
public void testNotSameCompiler() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/multiplatform/custom/notSameCompiler/");
@@ -638,6 +643,19 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/multiplatform/custom/complementaryFiles")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ComplementaryFiles extends AbstractIncrementalJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInComplementaryFiles() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/complementaryFiles"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/multiplatform/custom/notSameCompiler")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)