Tune module graph dependencies building

This commit is contained in:
Mikhael Bogdanov
2021-11-08 07:06:43 +01:00
committed by Space
parent 409d36c911
commit ae81aaa7b0
2 changed files with 10 additions and 4 deletions
@@ -47,9 +47,14 @@ class JavaModuleGraph(finder: JavaModuleFinder) {
// Do nothing; all automatic modules should be added to compilation roots at call site as per java.lang.module javadoc // Do nothing; all automatic modules should be added to compilation roots at call site as per java.lang.module javadoc
} }
is JavaModule.Explicit -> { is JavaModule.Explicit -> {
for ((dependencyModuleName) in module.moduleInfo.requires) { if (module.isJdkModule) {
if (visited.add(dependencyModuleName)) { //ct.sym can miss some internal modules from non-transitive dependencies
dfs(dependencyModuleName) dfs(moduleName)
} else {
for ((dependencyModuleName) in module.moduleInfo.requires) {
if (visited.add(dependencyModuleName)) {
dfs(dependencyModuleName)
}
} }
} }
} }
@@ -83,7 +83,8 @@ interface JavaModule {
class Explicit( class Explicit(
val moduleInfo: JavaModuleInfo, val moduleInfo: JavaModuleInfo,
override val moduleRoots: List<Root>, override val moduleRoots: List<Root>,
override val moduleInfoFile: VirtualFile override val moduleInfoFile: VirtualFile,
val isJdkModule: Boolean = false
) : JavaModule { ) : JavaModule {
override val name: String override val name: String
get() = moduleInfo.moduleName get() = moduleInfo.moduleName