mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[rdct-tests] IJI-1676 Support running tests on compilation output jars: fix com.intellij.tools.launch.ide.ClassPathBuilder
GitOrigin-RevId: 254ff554edd4c7e0bc215f2a9329fc7c8d6403f2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e3170834cc
commit
a9a25fd125
@@ -16,6 +16,7 @@ import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.util.*
|
||||
import java.util.logging.Logger
|
||||
import kotlin.io.path.name
|
||||
import kotlin.io.path.pathString
|
||||
|
||||
class ClassPathBuilder(private val paths: PathsProvider, private val modulesToScopes: Map<String, JpsJavaClasspathKind>) {
|
||||
@@ -113,6 +114,10 @@ class ClassPathBuilder(private val paths: PathsProvider, private val modulesToSc
|
||||
|
||||
private fun Collection<Path>.replaceWithArchivedIfNeeded(): Collection<Path> {
|
||||
val mapping = PathManager.getArchivedCompiledClassesMapping() ?: return this
|
||||
return map { path -> if (Files.isRegularFile(path)) path else mapping[path.pathString]?.let { Path.of(it) } ?: path }
|
||||
return map { path ->
|
||||
if (Files.isRegularFile(path)) path
|
||||
// path is absolute, mapping contains only the last two path elements
|
||||
else mapping[path.parent.name + "/" + path.name]?.let { Path.of(it) } ?: path
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user