AA: use partition to group directory/jar library roots
This commit is contained in:
committed by
Ilya Kirillov
parent
a2da690afd
commit
9ba6cf47ea
+1
-5
@@ -98,8 +98,7 @@ internal fun buildKtModuleProviderByCompilerConfiguration(
|
|||||||
val moduleName = compilerConfig.get(CommonConfigurationKeys.MODULE_NAME) ?: "<no module name provided>"
|
val moduleName = compilerConfig.get(CommonConfigurationKeys.MODULE_NAME) ?: "<no module name provided>"
|
||||||
|
|
||||||
val libraryRoots = compilerConfig.jvmModularRoots + compilerConfig.jvmClasspathRoots
|
val libraryRoots = compilerConfig.jvmModularRoots + compilerConfig.jvmClasspathRoots
|
||||||
val libraryRootsByType = libraryRoots.groupBy { it.isDirectory }
|
val (directories, jars) = libraryRoots.partition { it.isDirectory }
|
||||||
libraryRootsByType[true]?.let { directories ->
|
|
||||||
directories.forEach {
|
directories.forEach {
|
||||||
// E.g., project/app/build/intermediates/javac/debug/classes
|
// E.g., project/app/build/intermediates/javac/debug/classes
|
||||||
val root = it.toPath()
|
val root = it.toPath()
|
||||||
@@ -113,8 +112,6 @@ internal fun buildKtModuleProviderByCompilerConfiguration(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
libraryRootsByType[false]?.let { jars ->
|
|
||||||
jars.forEach {
|
jars.forEach {
|
||||||
// E.g., project/libs/libA/a.jar
|
// E.g., project/libs/libA/a.jar
|
||||||
val root = it.toPath()
|
val root = it.toPath()
|
||||||
@@ -131,7 +128,6 @@ internal fun buildKtModuleProviderByCompilerConfiguration(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
compilerConfig.get(JVMConfigurationKeys.JDK_HOME)?.let { jdkHome ->
|
compilerConfig.get(JVMConfigurationKeys.JDK_HOME)?.let { jdkHome ->
|
||||||
val vfm = VirtualFileManager.getInstance()
|
val vfm = VirtualFileManager.getInstance()
|
||||||
val jdkHomePath = jdkHome.toPath()
|
val jdkHomePath = jdkHome.toPath()
|
||||||
|
|||||||
Reference in New Issue
Block a user