mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 00:40:28 +07:00
experimental ij void
GitOrigin-RevId: c980a4927fabeedda2284695f234ee41652b6db5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
956b017e55
commit
9f566cc5fb
@@ -18,6 +18,7 @@
|
||||
<module name="intellij.kotlin.onboarding-promoter"/>
|
||||
<module name="intellij.platform.experiment"/>
|
||||
<module name="intellij.idea.customization.base"/>
|
||||
<module name="intellij.platform.tips"/>
|
||||
</content>
|
||||
<xi:include href="/META-INF/common-ide-modules.xml"/>
|
||||
|
||||
|
||||
@@ -176,16 +176,6 @@ abstract class BaseIdeaProperties : JetBrainsProductProperties() {
|
||||
productLayout.compatiblePluginsToIgnore = persistentListOf(
|
||||
JavaPluginLayout.MAIN_MODULE_NAME,
|
||||
)
|
||||
additionalModulesToCompile = persistentListOf("intellij.tools.jps.build.standalone")
|
||||
modulesToCompileTests = persistentListOf("intellij.platform.jps.build.tests")
|
||||
}
|
||||
|
||||
/**
|
||||
* 🌲
|
||||
* see KTIJ-30761
|
||||
* @see org.jetbrains.intellij.build.sharedIndexes.PreSharedIndexesGenerator
|
||||
*/
|
||||
protected fun enableKotlinPluginK2ByDefault() {
|
||||
additionalVmOptions += "-Didea.kotlin.plugin.use.k2=true"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.jetbrains.plugin.structure.base.plugin.PluginCreationSuccess
|
||||
import com.jetbrains.plugin.structure.base.problems.InvalidDescriptorProblem
|
||||
import com.jetbrains.plugin.structure.base.problems.PluginProblem
|
||||
import com.jetbrains.plugin.structure.intellij.plugin.IdePlugin
|
||||
import kotlinx.collections.immutable.plus
|
||||
import org.jetbrains.intellij.build.SoftwareBillOfMaterials.Companion.Suppliers
|
||||
import org.jetbrains.intellij.build.impl.PlatformJarNames.PLATFORM_CORE_NIO_FS
|
||||
import org.jetbrains.jps.model.module.JpsModule
|
||||
@@ -39,31 +40,38 @@ abstract class JetBrainsProductProperties : ProductProperties() {
|
||||
override suspend fun copyAdditionalFiles(context: BuildContext, targetDir: Path) {
|
||||
}
|
||||
|
||||
override fun validatePlugin(pluginId: String?, result: PluginCreationResult<IdePlugin>, context: BuildContext): List<PluginProblem> {
|
||||
return buildList {
|
||||
val problems = super.validatePlugin(pluginId, result, context).filterNot {
|
||||
(
|
||||
// FIXME IDEA-356970
|
||||
pluginId == "com.intellij.plugins.projectFragments" ||
|
||||
// FIXME IJPL-159498
|
||||
pluginId == "org.jetbrains.plugins.docker.gateway"
|
||||
) && it.message.contains("Service preloading is deprecated") ||
|
||||
(
|
||||
// FIXME PY-74322
|
||||
pluginId == "com.intellij.python.frontend" ||
|
||||
// FIXME AE-121
|
||||
pluginId == "com.jetbrains.personalization"
|
||||
) && it.message.contains("Plugin has no dependencies")
|
||||
}
|
||||
addAll(problems)
|
||||
if (result is PluginCreationSuccess && result.plugin.vendor?.contains("JetBrains") != true) {
|
||||
add(object : InvalidDescriptorProblem(
|
||||
descriptorPath = "",
|
||||
detailedMessage = "${result.plugin.pluginId} is published not by JetBrains: ${result.plugin.vendor}"
|
||||
) {
|
||||
override val level = Level.ERROR
|
||||
})
|
||||
final override fun validatePlugin(pluginId: String?, result: PluginCreationResult<IdePlugin>, context: BuildContext): List<PluginProblem> {
|
||||
val problems = super.validatePlugin(pluginId, result, context).filterNot {
|
||||
(
|
||||
// FIXME IDEA-356970
|
||||
pluginId == "com.intellij.plugins.projectFragments" ||
|
||||
// FIXME IJPL-159498
|
||||
pluginId == "org.jetbrains.plugins.docker.gateway" || pluginId == "com.intellij.java" || pluginId == "com.intellij.java.ide"
|
||||
) && it.message.contains("Service preloading is deprecated") ||
|
||||
(
|
||||
// FIXME PY-74322
|
||||
pluginId == "com.intellij.python.frontend" ||
|
||||
// FIXME AE-121
|
||||
pluginId == "com.jetbrains.personalization"
|
||||
) && it.message.contains("Plugin has no dependencies")
|
||||
}
|
||||
if (result is PluginCreationSuccess && result.plugin.vendor?.contains("JetBrains") != true) {
|
||||
return problems + object : InvalidDescriptorProblem(
|
||||
descriptorPath = "",
|
||||
detailedMessage = "${result.plugin.pluginId} is published not by JetBrains: ${result.plugin.vendor}"
|
||||
) {
|
||||
override val level = Level.ERROR
|
||||
}
|
||||
}
|
||||
return problems
|
||||
}
|
||||
|
||||
/**
|
||||
* 🌲
|
||||
* see KTIJ-30761
|
||||
* @see org.jetbrains.intellij.build.sharedIndexes.PreSharedIndexesGenerator
|
||||
*/
|
||||
protected fun enableKotlinPluginK2ByDefault() {
|
||||
additionalVmOptions += "-Didea.kotlin.plugin.use.k2=true"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,12 +300,6 @@ abstract class ProductProperties {
|
||||
*/
|
||||
val mavenArtifacts: MavenArtifactsProperties = MavenArtifactsProperties()
|
||||
|
||||
/**
|
||||
* Specified additional modules (not included into the product layout) which need to be compiled when product is built.
|
||||
* todo get rid of this
|
||||
*/
|
||||
var additionalModulesToCompile: PersistentList<String> = persistentListOf()
|
||||
|
||||
/**
|
||||
* Specified modules which tests need to be compiled when product is built.
|
||||
* todo get rid of this
|
||||
|
||||
@@ -94,7 +94,7 @@ internal suspend fun buildProduct(request: BuildRequest, createProductProperties
|
||||
|
||||
val classifier = computeAdditionalModulesFingerprint(request.additionalModules)
|
||||
val productDirNameWithoutClassifier = if (request.platformPrefix == "Idea") "idea-community" else request.platformPrefix
|
||||
val productDirName = (productDirNameWithoutClassifier + classifier).takeLast(255)
|
||||
val productDirName = (productDirNameWithoutClassifier + (if (System.getProperty("intellij.build.minimal").toBoolean()) "-ij-void" else "") + classifier).takeLast(255)
|
||||
|
||||
val buildDir = withContext(Dispatchers.IO.limitedParallelism(4)) {
|
||||
val buildDir = rootDir.resolve(productDirName)
|
||||
@@ -302,7 +302,6 @@ private suspend fun collectModulesToCompileForDistribution(context: BuildContext
|
||||
if (context.isEmbeddedJetBrainsClientEnabled) {
|
||||
result.add(context.productProperties.embeddedJetBrainsClientMainModule!!)
|
||||
}
|
||||
result.addAll(context.productProperties.additionalModulesToCompile)
|
||||
result.add("intellij.idea.community.build.tasks")
|
||||
result.add("intellij.platform.images.build")
|
||||
result.removeAll(productLayout.excludedModuleNames)
|
||||
@@ -548,7 +547,13 @@ internal suspend fun createProductProperties(productConfiguration: ProductConfig
|
||||
|
||||
return spanBuilder("create product properties").use {
|
||||
val productPropertiesClass = try {
|
||||
classLoader.loadClass(productConfiguration.className)
|
||||
val className = if (System.getProperty("intellij.build.minimal").toBoolean()) {
|
||||
"org.jetbrains.intellij.build.IjVoidProperties"
|
||||
}
|
||||
else {
|
||||
productConfiguration.className
|
||||
}
|
||||
classLoader.loadClass(className)
|
||||
}
|
||||
catch (_: ClassNotFoundException) {
|
||||
val classPathString = classPathFiles.joinToString(separator = "\n") { file ->
|
||||
|
||||
@@ -531,7 +531,6 @@ private suspend fun checkProductProperties(context: BuildContext) {
|
||||
checkPaths2(properties.brandingResourcePaths, "productProperties.brandingResourcePaths")
|
||||
checkPaths2(properties.additionalIDEPropertiesFilePaths, "productProperties.additionalIDEPropertiesFilePaths")
|
||||
checkPaths2(properties.additionalDirectoriesWithLicenses, "productProperties.additionalDirectoriesWithLicenses")
|
||||
checkModules(properties.additionalModulesToCompile, "productProperties.additionalModulesToCompile", context)
|
||||
checkModule(properties.applicationInfoModule, "productProperties.applicationInfoModule", context)
|
||||
properties.embeddedJetBrainsClientMainModule?.let { embeddedJetBrainsClientMainModule ->
|
||||
checkModule(embeddedJetBrainsClientMainModule, "productProperties.embeddedJetBrainsClientMainModule", context)
|
||||
|
||||
@@ -478,28 +478,28 @@ private suspend fun validatePlugins(context: BuildContext, pluginSpecs: Collecti
|
||||
continue
|
||||
}
|
||||
launch {
|
||||
validatePlugin(path = path, context = context, span = span)
|
||||
validatePlugin(file = path, context = context, span = span)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun validatePlugin(path: Path, context: BuildContext, span: Span) {
|
||||
private fun validatePlugin(file: Path, context: BuildContext, span: Span) {
|
||||
val pluginManager = IdePluginManager.createManager()
|
||||
val result = pluginManager.createPlugin(path, validateDescriptor = true)
|
||||
val result = pluginManager.createPlugin(pluginFile = file, validateDescriptor = true)
|
||||
// todo fix AddStatisticsEventLogListenerTemporary
|
||||
val id = when (result) {
|
||||
is PluginCreationSuccess -> result.plugin.pluginId
|
||||
is PluginCreationFail -> (pluginManager.createPlugin(path, validateDescriptor = false) as? PluginCreationSuccess)?.plugin?.pluginId
|
||||
is PluginCreationFail -> (pluginManager.createPlugin(pluginFile = file, validateDescriptor = false) as? PluginCreationSuccess)?.plugin?.pluginId
|
||||
}
|
||||
val problems = context.productProperties.validatePlugin(id, result, context)
|
||||
if (problems.isNotEmpty()) {
|
||||
span.addEvent("failed", Attributes.of(AttributeKey.stringKey("path"), "$path"))
|
||||
span.addEvent("failed", Attributes.of(AttributeKey.stringKey("path"), "$file"))
|
||||
context.messages.reportBuildProblem(
|
||||
problems.joinToString(
|
||||
prefix = "${id ?: path}: ",
|
||||
prefix = "${id ?: file}: ",
|
||||
separator = ". ",
|
||||
), identity = "${id ?: path}"
|
||||
), identity = "${id ?: file}"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.application.impl;
|
||||
|
||||
import com.intellij.ReviseWhenPortedToJDK;
|
||||
@@ -54,9 +54,9 @@ public final class ApplicationInfoImpl extends ApplicationInfoEx {
|
||||
private String myCopyrightStart = "2000";
|
||||
private String myShortCompanyName;
|
||||
private String myCompanyUrl = "https://www.jetbrains.com/";
|
||||
private String mySplashImageUrl;
|
||||
private String myEapSplashImageUrl;
|
||||
private String mySvgIconUrl;
|
||||
private @Nullable String splashImageUrl;
|
||||
private @Nullable String eapSplashImageUrl;
|
||||
private String svgIconUrl;
|
||||
private String mySvgEapIconUrl;
|
||||
private String mySmallSvgIconUrl;
|
||||
private String mySmallSvgEapIconUrl;
|
||||
@@ -79,7 +79,7 @@ public final class ApplicationInfoImpl extends ApplicationInfoEx {
|
||||
private boolean myShowWhatsNewOnUpdate;
|
||||
private String myWinKeymapUrl;
|
||||
private String myMacKeymapUrl;
|
||||
private boolean myEAP;
|
||||
private boolean isEap;
|
||||
private boolean myHasHelp = true;
|
||||
private boolean myHasContextHelp = true;
|
||||
private String myWebHelpUrl = "https://www.jetbrains.com/idea/webhelp/";
|
||||
@@ -114,8 +114,8 @@ public final class ApplicationInfoImpl extends ApplicationInfoEx {
|
||||
myPatchVersion = child.getAttributeValue("patch");
|
||||
myFullVersionFormat = child.getAttributeValue("full");
|
||||
myCodeName = child.getAttributeValue("codename");
|
||||
myEAP = Boolean.parseBoolean(child.getAttributeValue("eap"));
|
||||
myVersionSuffix = child.getAttributeValue("suffix", myEAP ? "EAP" : null);
|
||||
isEap = Boolean.parseBoolean(child.getAttributeValue("eap"));
|
||||
myVersionSuffix = child.getAttributeValue("suffix", isEap ? "EAP" : null);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -133,17 +133,17 @@ public final class ApplicationInfoImpl extends ApplicationInfoEx {
|
||||
break;
|
||||
|
||||
case "logo": {
|
||||
mySplashImageUrl = getAttributeValue(child, "url");
|
||||
splashImageUrl = getAttributeValue(child, "url");
|
||||
}
|
||||
break;
|
||||
|
||||
case "logo-eap": {
|
||||
myEapSplashImageUrl = getAttributeValue(child, "url");
|
||||
eapSplashImageUrl = getAttributeValue(child, "url");
|
||||
}
|
||||
break;
|
||||
|
||||
case "icon": {
|
||||
mySvgIconUrl = child.getAttributeValue("svg");
|
||||
svgIconUrl = child.getAttributeValue("svg");
|
||||
mySmallSvgIconUrl = child.getAttributeValue("svg-small");
|
||||
}
|
||||
break;
|
||||
@@ -271,7 +271,7 @@ public final class ApplicationInfoImpl extends ApplicationInfoEx {
|
||||
readPluginInfo(null);
|
||||
}
|
||||
|
||||
Objects.requireNonNull(mySvgIconUrl, "Missing attribute: //icon@svg");
|
||||
Objects.requireNonNull(svgIconUrl, "Missing attribute: //icon@svg");
|
||||
Objects.requireNonNull(mySmallSvgIconUrl, "Missing attribute: //icon@svg-small");
|
||||
|
||||
overrideFromProperties();
|
||||
@@ -408,7 +408,7 @@ public final class ApplicationInfoImpl extends ApplicationInfoEx {
|
||||
@Override
|
||||
public String getVersionName() {
|
||||
String fullName = ApplicationNamesInfo.getInstance().getFullProductName();
|
||||
if (myEAP && myCodeName != null && !myCodeName.isEmpty()) {
|
||||
if (isEap && myCodeName != null && !myCodeName.isEmpty()) {
|
||||
fullName += " (" + myCodeName + ")";
|
||||
}
|
||||
return fullName;
|
||||
@@ -430,8 +430,8 @@ public final class ApplicationInfoImpl extends ApplicationInfoEx {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSplashImageUrl() {
|
||||
return isEAP() && myEapSplashImageUrl != null ? myEapSplashImageUrl : mySplashImageUrl;
|
||||
public @Nullable String getSplashImageUrl() {
|
||||
return isEap && eapSplashImageUrl != null ? eapSplashImageUrl : splashImageUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -441,7 +441,7 @@ public final class ApplicationInfoImpl extends ApplicationInfoEx {
|
||||
|
||||
@ApiStatus.Internal
|
||||
public @NotNull String getApplicationSvgIconUrl(boolean isEap) {
|
||||
return isEap && mySvgEapIconUrl != null ? mySvgEapIconUrl : mySvgIconUrl;
|
||||
return isEap && mySvgEapIconUrl != null ? mySvgEapIconUrl : svgIconUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -461,17 +461,17 @@ public final class ApplicationInfoImpl extends ApplicationInfoEx {
|
||||
|
||||
@Override
|
||||
public boolean isEAP() {
|
||||
return myEAP;
|
||||
return isEap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMajorEAP() {
|
||||
return myEAP && (myMinorVersion == null || myMinorVersion.indexOf('.') < 0);
|
||||
return isEap && (myMinorVersion == null || myMinorVersion.indexOf('.') < 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPreview() {
|
||||
return !myEAP && myVersionSuffix != null && ("Preview".equalsIgnoreCase(myVersionSuffix) || myVersionSuffix.startsWith("RC"));
|
||||
return !isEap && myVersionSuffix != null && ("Preview".equalsIgnoreCase(myVersionSuffix) || myVersionSuffix.startsWith("RC"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.ide.util
|
||||
|
||||
import com.intellij.openapi.components.service
|
||||
@@ -27,8 +27,11 @@ interface TipAndTrickManager {
|
||||
fun canShowDialogAutomaticallyNow(project: Project): Boolean
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val DISABLE_TIPS_FOR_PROJECT: Key<Boolean> = Key.create("DISABLE_TIPS_FOR_PROJECT")
|
||||
|
||||
fun getInstance(): TipAndTrickManager = service()
|
||||
fun getInstance(): TipAndTrickManager {
|
||||
return service()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,5 @@
|
||||
</content>
|
||||
|
||||
<xi:include href="/META-INF/vcs-modules.xml"/>
|
||||
|
||||
</idea-plugin>
|
||||
@@ -22,7 +22,5 @@
|
||||
<module name="intellij.platform.debugger.impl.backend"/>
|
||||
|
||||
<module name="intellij.platform.frontend"/>
|
||||
|
||||
<module name="intellij.platform.tips"/>
|
||||
</content>
|
||||
</idea-plugin>
|
||||
@@ -4,9 +4,10 @@ package com.intellij.platform.tips
|
||||
import com.intellij.ide.plugins.DynamicPluginListener
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor
|
||||
import com.intellij.ide.util.TipAndTrickManager
|
||||
import com.intellij.openapi.components.serviceIfCreated
|
||||
|
||||
internal class CloseTipDialogOnPluginUnloadingListener : DynamicPluginListener {
|
||||
private class CloseTipDialogOnPluginUnloadingListener : DynamicPluginListener {
|
||||
override fun beforePluginUnload(pluginDescriptor: IdeaPluginDescriptor, isUpdate: Boolean) {
|
||||
TipAndTrickManager.getInstance().closeTipDialog()
|
||||
serviceIfCreated<TipAndTrickManager>()?.closeTipDialog()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package training.featuresSuggester
|
||||
|
||||
import com.intellij.openapi.Disposable
|
||||
@@ -13,7 +13,7 @@ abstract class FeatureSuggesterTest : BasePlatformTestCase() {
|
||||
protected abstract val testingSuggesterId: String
|
||||
|
||||
lateinit var expectedSuggestion: Suggestion
|
||||
private lateinit var disposable: Disposable
|
||||
private var disposable: Disposable? = null
|
||||
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
@@ -23,12 +23,12 @@ abstract class FeatureSuggesterTest : BasePlatformTestCase() {
|
||||
FeatureSuggester.suggesters.forEach { settings.setEnabled(it.id, true) }
|
||||
expectedSuggestion = NoSuggestion
|
||||
disposable = Disposer.newDisposable()
|
||||
FeatureSuggesterTestUtils.subscribeToSuggestions(myFixture.project, disposable) { suggestion -> expectedSuggestion = suggestion }
|
||||
FeatureSuggesterTestUtils.subscribeToSuggestions(myFixture.project, disposable!!) { suggestion -> expectedSuggestion = suggestion }
|
||||
}
|
||||
|
||||
override fun tearDown() {
|
||||
try {
|
||||
Disposer.dispose(disposable)
|
||||
disposable?.let { Disposer.dispose(it) }
|
||||
}
|
||||
catch (e: Throwable) {
|
||||
addSuppressedException(e)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<module name="intellij.platform.ide.newUiOnboarding"/>
|
||||
<module name="intellij.platform.ml.embeddings"/>
|
||||
<module name="intellij.ide.startup.importSettings"/>
|
||||
<module name="intellij.platform.tips"/>
|
||||
</content>
|
||||
<xi:include href="/META-INF/common-ide-modules.xml"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user