mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-223882 remote dev: fix starting the frontend process from sources without dev build
While we still have shared run configurations which start the split mode without dev build (e.g., 'IDEA Split'), they shouldn't fail. Before the change, an attempt to load a content module descriptor from an output directory failed with a rather cryptic error message. GitOrigin-RevId: 62f4f5ef997c2b07093b9af7421905ffc6103e39
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7919f276af
commit
4d193499a0
@@ -38,6 +38,7 @@ import java.util.concurrent.atomic.AtomicReferenceArray
|
||||
import java.util.jar.JarInputStream
|
||||
import java.util.zip.ZipInputStream
|
||||
import javax.xml.stream.XMLStreamException
|
||||
import kotlin.io.path.isDirectory
|
||||
|
||||
private val LOG: Logger
|
||||
get() = PluginManagerCore.logger
|
||||
@@ -946,14 +947,20 @@ private fun loadContentModuleDescriptors(
|
||||
}
|
||||
|
||||
if (isDeprecatedLoader && jarFileForModule != null && Files.exists(jarFileForModule)) {
|
||||
val raw = MixedDirAndJarDataLoader(files = arrayOf(FileItem(jarFileForModule, subDescriptorFile)), pool = pool, jarOnly = true).use { dataLoader ->
|
||||
val raw = MixedDirAndJarDataLoader(files = arrayOf(FileItem(jarFileForModule, subDescriptorFile)), pool = pool, jarOnly = !isRunningFromSourcesWithoutDevBuild).use { dataLoader ->
|
||||
val consumer = PluginDescriptorFromXmlStreamConsumer(
|
||||
readContext = loadingContext.readContext,
|
||||
xIncludeLoader = createXIncludeLoader(pathResolver = PluginXmlPathResolver.DEFAULT_PATH_RESOLVER, dataLoader = dataLoader),
|
||||
)
|
||||
val data = pool.load(jarFileForModule).use {
|
||||
it.loadZipEntry(subDescriptorFile)
|
||||
} ?: error("Failed to load entry '$subDescriptorFile' from jar file '$jarFileForModule'")
|
||||
val data =
|
||||
if (isRunningFromSourcesWithoutDevBuild && jarFileForModule.isDirectory()) {
|
||||
Files.readAllBytes(jarFileForModule.resolve(subDescriptorFile))
|
||||
}
|
||||
else {
|
||||
pool.load(jarFileForModule).use {
|
||||
it.loadZipEntry(subDescriptorFile)
|
||||
} ?: error("Failed to load entry '$subDescriptorFile' from jar file '$jarFileForModule'")
|
||||
}
|
||||
consumer.consume(data, dataLoader.toString())
|
||||
consumer.getBuilder()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user