mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[plugin model tests] report an error if module-level extension point is found in the monorepo (IJPL-179175)
GitOrigin-RevId: 430b0ba282ef1fd22f366d75927713d7703a6508
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e569e5068b
commit
f9d91aac95
@@ -261,6 +261,7 @@ class PluginModelValidator(
|
||||
sourceModuleNameToFileInfo = sourceModuleNameToFileInfo,
|
||||
moduleNameToInfo = moduleNameToInfo,
|
||||
)
|
||||
checkModuleElements(moduleDescriptor = pluginInfo.descriptor, sourceModule = pluginInfo.sourceModule, pluginInfo.descriptorFile)
|
||||
}
|
||||
|
||||
val registeredContentModules = allMainModulesOfPlugins.flatMapTo(HashSet()) { pluginInfo ->
|
||||
@@ -526,6 +527,26 @@ class PluginModelValidator(
|
||||
}
|
||||
|
||||
checkContentModuleUnexpectedElements(moduleDescriptor, referencingModuleInfo.sourceModule, moduleInfo)
|
||||
checkModuleElements(moduleDescriptor, moduleInfo.sourceModule, moduleInfo.descriptorFile)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks elements in the main module or a content module
|
||||
*/
|
||||
private fun checkModuleElements(moduleDescriptor: RawPluginDescriptor, sourceModule: JpsModule, descriptorFile: Path) {
|
||||
for (extensionPointElement in moduleDescriptor.moduleElementsContainer.extensionPoints) {
|
||||
reportError(
|
||||
message = """
|
||||
|Module-level extension point '$extensionPointElement' is defined in '${sourceModule.name}'.
|
||||
|Module-level extension points are deprecated in general and forbidden in intellij monorepo.
|
||||
|Use application-level or project-level extension point, and pass 'Module' instance as a parameter if needed.
|
||||
|""".trimMargin(),
|
||||
sourceModule = sourceModule,
|
||||
mapOf(
|
||||
"descriptorFile" to descriptorFile,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user