mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
[platform] refactoring: rename ProductMode.LOCAL_IDE to MONOLITH for consistency (RDCT-1417)
GitOrigin-RevId: 145088995b32517ae536e626d8d54dfb31a25331
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cb4fdfc2fc
commit
366d2f2ea3
@@ -32,7 +32,7 @@ import kotlin.io.path.extension
|
||||
|
||||
internal class ModuleBasedProductLoadingStrategy(internal val moduleRepository: RuntimeModuleRepository) : ProductLoadingStrategy() {
|
||||
private val currentMode by lazy {
|
||||
val currentModeId = System.getProperty(PLATFORM_PRODUCT_MODE_PROPERTY, ProductMode.LOCAL_IDE.id)
|
||||
val currentModeId = System.getProperty(PLATFORM_PRODUCT_MODE_PROPERTY, ProductMode.MONOLITH.id)
|
||||
val currentMode = ProductMode.entries.find { it.id == currentModeId }
|
||||
if (currentMode == null) {
|
||||
error("Unknown mode '$currentModeId' specified in '$PLATFORM_PRODUCT_MODE_PROPERTY' system property")
|
||||
|
||||
@@ -213,7 +213,7 @@ abstract class ProductProperties {
|
||||
* This property makes sense only if [rootModuleForModularLoader] is set to a non-null value.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
var productMode: ProductMode = ProductMode.LOCAL_IDE
|
||||
var productMode: ProductMode = ProductMode.MONOLITH
|
||||
|
||||
/**
|
||||
* Specifies name of cross-platform ZIP archive if `[buildCrossPlatformDistribution]` is set to `true`.
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.nio.file.Path
|
||||
internal class PathBasedProductLoadingStrategy : ProductLoadingStrategy() {
|
||||
// this property returns hardcoded Strings instead of ProductMode, because currently ProductMode class isn't available in dependencies of this module
|
||||
override val currentModeId: String
|
||||
get() = if (AppMode.isRemoteDevHost()) "backend" else "local_IDE"
|
||||
get() = if (AppMode.isRemoteDevHost()) "backend" else "monolith"
|
||||
|
||||
override fun addMainModuleGroupToClassPath(bootstrapClassLoader: ClassLoader) {
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
- java.lang.Enum
|
||||
- sf:BACKEND:com.intellij.platform.runtime.product.ProductMode
|
||||
- sf:FRONTEND:com.intellij.platform.runtime.product.ProductMode
|
||||
- sf:LOCAL_IDE:com.intellij.platform.runtime.product.ProductMode
|
||||
- sf:MONOLITH:com.intellij.platform.runtime.product.ProductMode
|
||||
- getId():java.lang.String
|
||||
- s:valueOf(java.lang.String):com.intellij.platform.runtime.product.ProductMode
|
||||
- s:values():com.intellij.platform.runtime.product.ProductMode[]
|
||||
|
||||
@@ -12,7 +12,7 @@ public enum ProductMode {
|
||||
/**
|
||||
* Indicates that this process performs all necessary tasks to provide smart features itself. This is the default mode for all IDEs.
|
||||
*/
|
||||
LOCAL_IDE("local_IDE"),
|
||||
MONOLITH("monolith"),
|
||||
/**
|
||||
* Indicates that this process doesn't perform heavy tasks like code analysis, and takes necessary information from another process.
|
||||
* Currently, this is used by JetBrains Client process connected to a remote development host or CodeWithMe session.
|
||||
|
||||
@@ -22,7 +22,7 @@ final class ProductModes {
|
||||
case FRONTEND: return RuntimeModuleId.module("intellij.platform.monolith");
|
||||
|
||||
//this module doesn't exist yet, it will be added when we need to use it
|
||||
case LOCAL_IDE: return RuntimeModuleId.module("intellij.platform.frontend");
|
||||
case MONOLITH: return RuntimeModuleId.module("intellij.platform.frontend");
|
||||
|
||||
//currently we use the same modules in 'backend' and 'localIde' modes, in the future we may disable some UI-only modules in 'backend' mode
|
||||
case BACKEND: return RuntimeModuleId.module("intellij.platform.frontend");
|
||||
|
||||
@@ -32,7 +32,7 @@ class ProductModulesLoaderTest {
|
||||
)
|
||||
writePluginXmlWithModules(tempDirectory.rootPath / "plugin", "<idea-plugin><id>plugin</id></idea-plugin>")
|
||||
val xml = generateProductModulesWithPlugin()
|
||||
val productModules = ProductModulesSerialization.loadProductModules(xml, ProductMode.LOCAL_IDE, repository)
|
||||
val productModules = ProductModulesSerialization.loadProductModules(xml, ProductMode.MONOLITH, repository)
|
||||
val mainGroupModules = productModules.mainModuleGroup.includedModules.sortedBy { it.moduleDescriptor.moduleId.stringId }
|
||||
assertEquals(2, mainGroupModules.size)
|
||||
val (root, util) = mainGroupModules
|
||||
@@ -64,7 +64,7 @@ class ProductModulesLoaderTest {
|
||||
</product-modules>
|
||||
""".trimIndent())
|
||||
}.generateInTempDir().resolve(FILE_NAME)
|
||||
val productModules = ProductModulesSerialization.loadProductModules(xml, ProductMode.LOCAL_IDE, repository)
|
||||
val productModules = ProductModulesSerialization.loadProductModules(xml, ProductMode.MONOLITH, repository)
|
||||
val mainGroupModules = productModules.mainModuleGroup.includedModules.sortedBy { it.moduleDescriptor.moduleId.stringId }
|
||||
assertEquals(2, mainGroupModules.size)
|
||||
val (optional, root) = mainGroupModules
|
||||
@@ -86,7 +86,7 @@ class ProductModulesLoaderTest {
|
||||
writePluginXmlWithModules(tempDirectory.rootPath / "plugin", "plugin", "optional", "unknown")
|
||||
|
||||
val xml = generateProductModulesWithPlugin()
|
||||
val productModules = ProductModulesSerialization.loadProductModules(xml, ProductMode.LOCAL_IDE, repository)
|
||||
val productModules = ProductModulesSerialization.loadProductModules(xml, ProductMode.MONOLITH, repository)
|
||||
val pluginModuleGroup = productModules.bundledPluginModuleGroups.single()
|
||||
val pluginModules = pluginModuleGroup.includedModules
|
||||
assertEquals(2, pluginModules.size)
|
||||
@@ -123,7 +123,7 @@ class ProductModulesLoaderTest {
|
||||
assertEquals("plugin.common", common.moduleDescriptor.moduleId.stringId)
|
||||
assertEquals(additionalModuleName, additional.moduleDescriptor.moduleId.stringId)
|
||||
}
|
||||
checkGroup(ProductMode.LOCAL_IDE, "plugin.localIde")
|
||||
checkGroup(ProductMode.MONOLITH, "plugin.localIde")
|
||||
checkGroup(ProductMode.FRONTEND, "plugin.frontend")
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ abstract class StatisticsEventLoggerProvider(val recorderId: String,
|
||||
// Use `String?` instead of boolean flag for future expansion with other IDE modes
|
||||
val ideMode = if(AppMode.isRemoteDevHost()) "RDH" else null
|
||||
val currentProductModeId = ProductLoadingStrategy.strategy.currentModeId
|
||||
val productMode = if (currentProductModeId != ProductMode.LOCAL_IDE.id) {
|
||||
val productMode = if (currentProductModeId != ProductMode.MONOLITH.id) {
|
||||
currentProductModeId
|
||||
} else if (detectClionNova()) {
|
||||
"nova"
|
||||
|
||||
@@ -56,7 +56,7 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
|
||||
private fun loadProductModules(moduleRepository: RuntimeModuleRepository, projectHome: Path): ProductModules {
|
||||
val currentModeId = System.getProperty(PLATFORM_PRODUCT_MODE_PROPERTY, ProductMode.LOCAL_IDE.id)
|
||||
val currentModeId = System.getProperty(PLATFORM_PRODUCT_MODE_PROPERTY, ProductMode.MONOLITH.id)
|
||||
val currentMode = ProductMode.entries.find { it.id == currentModeId }
|
||||
if (currentMode == null) {
|
||||
reportError("Unknown mode '$currentModeId' specified in '$PLATFORM_PRODUCT_MODE_PROPERTY' system property")
|
||||
|
||||
Reference in New Issue
Block a user