allow to specify several content tags

GitOrigin-RevId: c19982c946742fc0f705bdf7b16a813bbf72f3e8
This commit is contained in:
Vladimir Krivosheev
2021-10-05 10:02:01 +00:00
committed by intellij-monorepo-bot
parent d08717530c
commit 0f9bf52ace
3 changed files with 11 additions and 8 deletions
@@ -1,5 +1,5 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
@file:Suppress("ReplaceGetOrSet")
@file:Suppress("ReplaceGetOrSet", "ReplaceNegatedIsEmptyWithIsNotEmpty")
package com.intellij.ide.plugins
import com.intellij.AbstractBundle
@@ -94,7 +94,7 @@ class IdeaPluginDescriptorImpl(raw: RawPluginDescriptor,
@JvmField val projectContainerDescriptor = raw.projectContainerDescriptor
@JvmField val moduleContainerDescriptor = raw.moduleContainerDescriptor
@JvmField val content = raw.content
@JvmField val content: PluginContentDescriptor = raw.contentModules?.let { PluginContentDescriptor(it) } ?: PluginContentDescriptor.EMPTY
@JvmField val dependencies = raw.dependencies
@JvmField val modules: List<PluginId> = raw.modules ?: Collections.emptyList()
@@ -1,4 +1,4 @@
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.plugins
import com.intellij.openapi.extensions.ExtensionDescriptor
@@ -52,7 +52,7 @@ class RawPluginDescriptor {
@JvmField var epNameToExtensions: MutableMap<String, MutableList<ExtensionDescriptor>>? = null
@JvmField internal var content = PluginContentDescriptor.EMPTY
@JvmField internal var contentModules: MutableList<PluginContentDescriptor.ModuleItem>? = null
@JvmField internal var dependencies = ModuleDependenciesDescriptor.EMPTY
class ActionDescriptor(
@@ -1,6 +1,6 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
@file:JvmName("XmlReader")
@file:Suppress("ReplaceNegatedIsEmptyWithIsNotEmpty")
@file:Suppress("ReplaceNegatedIsEmptyWithIsNotEmpty", "ReplacePutWithAssignment", "ReplaceGetOrSet")
package com.intellij.ide.plugins
import com.intellij.openapi.components.ComponentConfig
@@ -14,7 +14,6 @@ import com.intellij.openapi.util.createNonCoalescingXmlStreamReader
import com.intellij.platform.util.plugins.DataLoader
import com.intellij.util.NoOpXmlInterner
import com.intellij.util.XmlInterner
import com.intellij.util.lang.Java11Shim
import com.intellij.util.lang.ZipFilePool
import com.intellij.util.messages.ListenerDescriptor
import com.intellij.util.readXmlAsModel
@@ -667,7 +666,12 @@ private fun readComponents(reader: XMLStreamReader2, containerDescriptor: Contai
private fun readContent(reader: XMLStreamReader2,
descriptor: RawPluginDescriptor,
readContext: ReadModuleContext) {
val items = ArrayList<PluginContentDescriptor.ModuleItem>()
var items = descriptor.contentModules
if (items == null) {
items = ArrayList()
descriptor.contentModules = items
}
reader.consumeChildElements { elementName ->
when (elementName) {
"module" -> {
@@ -694,7 +698,6 @@ private fun readContent(reader: XMLStreamReader2,
}
reader.skipElement()
}
descriptor.content = PluginContentDescriptor(Java11Shim.INSTANCE.copyOfCollection(items))
assert(reader.isEndElement)
}