[JPS] Fix KotlinJvmModuleBuildTarget.findJavaSourceRoots to only return Java source roots

This change is needed because otherwise, source files that are not Java will be added as `JavaSourceRoot`, this is incorrect and causes assertion error in `com.intellij.core.JavaCoreProjectEnvironment.addSourcesToClasspath`. Refer to KT-65325 for more context.


Merge-request: KT-MR-14088
Merged-by: Xuan Son Trinh <xuanson.trinh@jetbrains.com>
This commit is contained in:
Xuan-Son Trinh
2024-01-31 16:52:42 +00:00
committed by Space Team
parent d69deb97fe
commit f4f009cb9a
5 changed files with 39 additions and 3 deletions
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/src/test1.kt">
<sourceFolder url="file://$MODULE_DIR$/src/test1.kt" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="IDEA_JDK" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="kotlinProject" />
</component>
</module>