From 4cc0f4c18e3a738692e83dd82ceab1c97ea4b201 Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Tue, 5 Nov 2024 22:13:19 +0100 Subject: [PATCH] [registry] IJPL-162599 Cloud Registry module (cherry picked from commit 1ee095a80648cab61f459be424aa53c5968ce26d) (cherry picked from commit 3ce94793672e9d676b0bab99023e911193f4efff) IJ-MR-154004 GitOrigin-RevId: 5a69e858a1c20003a85d730668feef0363f5c94b --- .../resources/META-INF/IdeaPlugin.xml | 6 ++++++ .../intellij/build/impl/PlatformModules.kt | 7 ++++++- .../resources/META-INF/IdeCore.xml | 1 + .../openapi/util/registry/ManagedRegistry.kt | 18 ++++++++++++++++++ platform/util/api-dump-experimental.txt | 12 ++++++++++++ .../openapi/util/registry/RegistryValue.kt | 6 +++++- .../util/registry/RegistryValueSource.kt | 2 +- .../openapi/util/registry/RegistryTest.java | 1 + .../pycharm/PyCharmCommunityProperties.kt | 2 +- .../resources/META-INF/PyCharmCorePlugin.xml | 6 ++++++ 10 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 platform/ide-core/src/com/intellij/openapi/util/registry/ManagedRegistry.kt diff --git a/community-resources/resources/META-INF/IdeaPlugin.xml b/community-resources/resources/META-INF/IdeaPlugin.xml index f5be54c1ec78..c751c5932546 100644 --- a/community-resources/resources/META-INF/IdeaPlugin.xml +++ b/community-resources/resources/META-INF/IdeaPlugin.xml @@ -19,8 +19,14 @@ + + + + + + , context: BuildContext): XIncludePathResolver { return object : XIncludePathResolver { override fun resolvePath(relativePath: String, base: Path?, isOptional: Boolean, isDynamic: Boolean): Path? { - if (isOptional || isDynamic || excludedPaths.contains(relativePath)) { + if ((isOptional || isDynamic || excludedPaths.contains(relativePath)) + && !COMMUNITY_IMPL_EXTENSIONS.contains(relativePath)) { // It isn't safe to resolve includes at build time if they're optional. // This could lead to issues when running another product using this distribution. // E.g., if the corresponding module is somehow being excluded on runtime. diff --git a/platform/ide-core-impl/resources/META-INF/IdeCore.xml b/platform/ide-core-impl/resources/META-INF/IdeCore.xml index 6b7516c9ad8c..45e3f05d3b36 100644 --- a/platform/ide-core-impl/resources/META-INF/IdeCore.xml +++ b/platform/ide-core-impl/resources/META-INF/IdeCore.xml @@ -4,6 +4,7 @@ + diff --git a/platform/ide-core/src/com/intellij/openapi/util/registry/ManagedRegistry.kt b/platform/ide-core/src/com/intellij/openapi/util/registry/ManagedRegistry.kt new file mode 100644 index 000000000000..6d1280d45df5 --- /dev/null +++ b/platform/ide-core/src/com/intellij/openapi/util/registry/ManagedRegistry.kt @@ -0,0 +1,18 @@ +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +package com.intellij.openapi.util.registry + +import com.intellij.openapi.extensions.ExtensionPointName +import org.jetbrains.annotations.ApiStatus + +/** + * Marker interface for implementation of provisioner that controls registry keys for teams. + */ +@ApiStatus.Internal +interface ManagedRegistry + +private val EP_NAME = ExtensionPointName.create("com.intellij.registry.managed") + +@ApiStatus.Internal +fun getManagedRegistry(): ManagedRegistry? { + return EP_NAME.extensionList.firstOrNull() +} \ No newline at end of file diff --git a/platform/util/api-dump-experimental.txt b/platform/util/api-dump-experimental.txt index 2cb5c36c38ab..f466dafdf58b 100644 --- a/platform/util/api-dump-experimental.txt +++ b/platform/util/api-dump-experimental.txt @@ -24,6 +24,18 @@ c:com.intellij.openapi.util.UserDataHolderBase f:com.intellij.openapi.util.io.NioFiles - *s:copyRecursively(java.nio.file.Path,java.nio.file.Path):V - *s:copyRecursively(java.nio.file.Path,java.nio.file.Path,java.util.function.Consumer):V +c:com.intellij.openapi.util.registry.RegistryValue +- *f:getSource():com.intellij.openapi.util.registry.RegistryValueSource +- *f:setSelectedOption(java.lang.String,com.intellij.openapi.util.registry.RegistryValueSource):V +- *:setValue(java.lang.String,com.intellij.openapi.util.registry.RegistryValueSource):V +*e:com.intellij.openapi.util.registry.RegistryValueSource +- java.lang.Enum +- sf:MANAGER:com.intellij.openapi.util.registry.RegistryValueSource +- sf:SYSTEM:com.intellij.openapi.util.registry.RegistryValueSource +- sf:USER:com.intellij.openapi.util.registry.RegistryValueSource +- s:getEntries():kotlin.enums.EnumEntries +- s:valueOf(java.lang.String):com.intellij.openapi.util.registry.RegistryValueSource +- s:values():com.intellij.openapi.util.registry.RegistryValueSource[] f:com.intellij.openapi.util.text.HtmlChunkUtilKt - *sf:buildChildren(com.intellij.openapi.util.text.HtmlChunk$Element,kotlin.jvm.functions.Function1):com.intellij.openapi.util.text.HtmlChunk$Element - *sf:buildHtml(kotlin.jvm.functions.Function1):java.lang.String diff --git a/platform/util/src/com/intellij/openapi/util/registry/RegistryValue.kt b/platform/util/src/com/intellij/openapi/util/registry/RegistryValue.kt index f6d0efde91b3..95f7d0a8be94 100644 --- a/platform/util/src/com/intellij/openapi/util/registry/RegistryValue.kt +++ b/platform/util/src/com/intellij/openapi/util/registry/RegistryValue.kt @@ -11,6 +11,7 @@ import com.intellij.ui.ColorHexUtil import com.intellij.util.containers.ContainerUtil import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job +import org.jetbrains.annotations.ApiStatus import org.jetbrains.annotations.ApiStatus.Internal import org.jetbrains.annotations.NonNls import org.jetbrains.annotations.TestOnly @@ -34,6 +35,7 @@ open class RegistryValue @Internal constructor( private var doubleCachedValue = Double.NaN private var booleanCachedValue: Boolean? = null + @ApiStatus.Experimental fun getSource(): RegistryValueSource? { return registry.getStoredProperties().get(key)?.source } @@ -104,6 +106,7 @@ open class RegistryValue @Internal constructor( setSelectedOption(selected, RegistryValueSource.SYSTEM) } + @ApiStatus.Experimental fun setSelectedOption(selected: String?, source: RegistryValueSource) { val options = asOptions().toMutableList() for ((i, option) in options.withIndex()) { @@ -229,10 +232,11 @@ open class RegistryValue @Internal constructor( setValue(value.toString()) } - fun setValue(value: String) { + open fun setValue(value: String) { setValue(value, RegistryValueSource.SYSTEM) } + @ApiStatus.Experimental open fun setValue(value: String, source: RegistryValueSource) { val globalValueChangeListener = registry.valueChangeListener globalValueChangeListener.beforeValueChanged(this) diff --git a/platform/util/src/com/intellij/openapi/util/registry/RegistryValueSource.kt b/platform/util/src/com/intellij/openapi/util/registry/RegistryValueSource.kt index 1405c25c51f3..7acc31b560df 100644 --- a/platform/util/src/com/intellij/openapi/util/registry/RegistryValueSource.kt +++ b/platform/util/src/com/intellij/openapi/util/registry/RegistryValueSource.kt @@ -3,7 +3,7 @@ package com.intellij.openapi.util.registry import org.jetbrains.annotations.ApiStatus -@ApiStatus.Internal +@ApiStatus.Experimental enum class RegistryValueSource { /** * Values set by user via Registry UI. diff --git a/platform/util/testSrc/com/intellij/openapi/util/registry/RegistryTest.java b/platform/util/testSrc/com/intellij/openapi/util/registry/RegistryTest.java index 70a141c34882..acb0fc54aed9 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/registry/RegistryTest.java +++ b/platform/util/testSrc/com/intellij/openapi/util/registry/RegistryTest.java @@ -264,6 +264,7 @@ public class RegistryTest { Element entryElement = new Element("entry"); entryElement.setAttribute("key", entry.getKey()); entryElement.setAttribute("value", entry.getValue()); + entryElement.setAttribute("source", "SYSTEM"); registryElement.addContent(entryElement); } return registryElement; diff --git a/python/build/src/org/jetbrains/intellij/build/pycharm/PyCharmCommunityProperties.kt b/python/build/src/org/jetbrains/intellij/build/pycharm/PyCharmCommunityProperties.kt index 4122b0de379b..0b4d404618c9 100644 --- a/python/build/src/org/jetbrains/intellij/build/pycharm/PyCharmCommunityProperties.kt +++ b/python/build/src/org/jetbrains/intellij/build/pycharm/PyCharmCommunityProperties.kt @@ -27,7 +27,7 @@ open class PyCharmCommunityProperties(protected val communityHome: Path) : PyCha productLayout.productImplementationModules = listOf( "intellij.platform.starter", "intellij.pycharm.community", - "intellij.platform.whatsNew", + "intellij.platform.whatsNew" ) productLayout.bundledPluginModules += sequenceOf( diff --git a/python/ide-common/resources/META-INF/PyCharmCorePlugin.xml b/python/ide-common/resources/META-INF/PyCharmCorePlugin.xml index c15654d49115..a6b97940e818 100644 --- a/python/ide-common/resources/META-INF/PyCharmCorePlugin.xml +++ b/python/ide-common/resources/META-INF/PyCharmCorePlugin.xml @@ -9,8 +9,14 @@ + + + + + +