From fe20ff50c85293a46c04797b52ed20ed55339695 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 2 Apr 2021 22:02:09 +0200 Subject: [PATCH] disable splash for WebStorm and DataGrip GitOrigin-RevId: 90a868cdcacc90c64918e252b6ddd92b423f51b4 --- .../build/IdeaCommunityProperties.groovy | 3 +- .../intellij/build/ProductProperties.groovy | 7 +++- .../build/impl/VmOptionsGenerator.groovy | 40 ++++++++++--------- .../com/intellij/idea/CommandLineArgs.java | 5 ++- .../src/com/intellij/idea/SocketLock.java | 4 +- .../src/com/intellij/idea/SplashManager.java | 8 +++- .../src/com/intellij/idea/StartupUtil.java | 9 ++++- .../pycharm/PyCharmPropertiesBase.groovy | 9 ++--- 8 files changed, 51 insertions(+), 34 deletions(-) diff --git a/build/groovy/org/jetbrains/intellij/build/IdeaCommunityProperties.groovy b/build/groovy/org/jetbrains/intellij/build/IdeaCommunityProperties.groovy index 2a611beb1f75..fcd884e61270 100644 --- a/build/groovy/org/jetbrains/intellij/build/IdeaCommunityProperties.groovy +++ b/build/groovy/org/jetbrains/intellij/build/IdeaCommunityProperties.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2020 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. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.intellij.build import groovy.transform.CompileDynamic @@ -16,6 +16,7 @@ class IdeaCommunityProperties extends BaseIdeaProperties { additionalIDEPropertiesFilePaths = ["$home/build/conf/ideaCE.properties".toString()] toolsJarRequired = true scrambleMainJar = false + useSplash = true buildCrossPlatformDistribution = true productLayout.productImplementationModules = ["intellij.platform.main"] diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/ProductProperties.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/ProductProperties.groovy index d2d9a9ef65c4..ed135f15a969 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/ProductProperties.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/ProductProperties.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2020 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. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.intellij.build import groovy.transform.CompileStatic @@ -60,6 +60,11 @@ abstract class ProductProperties { boolean isAntRequired = false + /** + * Whether to use splash for application start-up. + */ + boolean useSplash = false + /** * Additional arguments which will be added to JVM command line in IDE launchers for all operating systems */ diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/VmOptionsGenerator.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/VmOptionsGenerator.groovy index bbbcbe6ef75f..b583dfde5cf5 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/VmOptionsGenerator.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/VmOptionsGenerator.groovy @@ -7,33 +7,35 @@ import org.jetbrains.intellij.build.ProductProperties @CompileStatic final class VmOptionsGenerator { - static final List COMMON_VM_OPTIONS = - [ - '-XX:+UseG1GC', - '-XX:SoftRefLRUPolicyMSPerMB=50', - '-XX:CICompilerCount=2', - '-XX:+HeapDumpOnOutOfMemoryError', - '-XX:-OmitStackTraceInFastThrow', - '-ea', - '-Dsun.io.useCanonCaches=false', - '-Djdk.http.auth.tunneling.disabledSchemes=""', - '-Djdk.attach.allowAttachSelf=true', - '-Djdk.module.illegalAccess.silent=true', - '-Dkotlinx.coroutines.debug=off', - ] + static final List COMMON_VM_OPTIONS = List.of( + '-XX:+UseG1GC', + '-XX:SoftRefLRUPolicyMSPerMB=50', + '-XX:CICompilerCount=2', + '-XX:+HeapDumpOnOutOfMemoryError', + '-XX:-OmitStackTraceInFastThrow', + '-ea', + '-Dsun.io.useCanonCaches=false', + '-Djdk.http.auth.tunneling.disabledSchemes=""', + '-Djdk.attach.allowAttachSelf=true', + '-Djdk.module.illegalAccess.silent=true', + '-Dkotlinx.coroutines.debug=off', + ) static final String defaultCodeCacheSetting = '-XX:ReservedCodeCacheSize=512m' static List computeVmOptions(JvmArchitecture arch, boolean isEAP, ProductProperties productProperties) { - List commonVmOptions + List result = new ArrayList<>(vmMemoryOptions(arch, productProperties)) if (isEAP) { // must be consistent with `com.intellij.openapi.application.ConfigImportHelper#updateVMOptions` - commonVmOptions = ["-XX:MaxJavaStackTraceDepth=10000"] + COMMON_VM_OPTIONS + result.add("-XX:MaxJavaStackTraceDepth=10000") + } - else { - commonVmOptions = COMMON_VM_OPTIONS + result.addAll(COMMON_VM_OPTIONS) + if (productProperties.useSplash) { + //noinspection SpellCheckingInspection + result.add("-Dsplash=true") } - return vmMemoryOptions(arch, productProperties) + commonVmOptions + return result } private static List vmMemoryOptions(JvmArchitecture arch, ProductProperties productProperties) { diff --git a/platform/platform-impl/src/com/intellij/idea/CommandLineArgs.java b/platform/platform-impl/src/com/intellij/idea/CommandLineArgs.java index 7f1df8b75ef7..15138003c953 100644 --- a/platform/platform-impl/src/com/intellij/idea/CommandLineArgs.java +++ b/platform/platform-impl/src/com/intellij/idea/CommandLineArgs.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 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. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.idea; import com.intellij.ide.RecentProjectsManagerBase; @@ -8,6 +8,7 @@ import org.jetbrains.annotations.NotNull; public final class CommandLineArgs { public static final String DISABLE_NON_BUNDLED_PLUGINS = "disableNonBundledPlugins"; public static final String DONT_REOPEN_PROJECTS = "dontReopenProjects"; + public static final String SPLASH = "splash"; @SuppressWarnings("SpellCheckingInspection") public static final String NO_SPLASH = "nosplash"; @@ -25,6 +26,6 @@ public final class CommandLineArgs { } public static boolean isKnownArgument(@NotNull String arg) { - return NO_SPLASH.equals(arg) || DISABLE_NON_BUNDLED_PLUGINS.equalsIgnoreCase(arg) || DONT_REOPEN_PROJECTS.equalsIgnoreCase(arg); + return SPLASH.equals(arg) || NO_SPLASH.equals(arg) || DISABLE_NON_BUNDLED_PLUGINS.equalsIgnoreCase(arg) || DONT_REOPEN_PROJECTS.equalsIgnoreCase(arg); } } diff --git a/platform/platform-impl/src/com/intellij/idea/SocketLock.java b/platform/platform-impl/src/com/intellij/idea/SocketLock.java index 7148cd6010ad..7f00b9dfcfeb 100644 --- a/platform/platform-impl/src/com/intellij/idea/SocketLock.java +++ b/platform/platform-impl/src/com/intellij/idea/SocketLock.java @@ -263,7 +263,7 @@ public final class SocketLock { boolean result = ContainerUtil.intersects(paths, stringList); if (result) { // update property right now, without scheduling to EDT - in some cases, allows to avoid a splash flickering - System.setProperty(CommandLineArgs.NO_SPLASH, "true"); + System.setProperty(CommandLineArgs.SPLASH, "false"); EventQueue.invokeLater(() -> { Runnable hideSplashTask = SplashManager.getHideTask(); if (hideSplashTask != null) { @@ -279,7 +279,7 @@ public final class SocketLock { if (currentDirectory == null) { currentDirectory = "."; } - out.writeUTF(ACTIVATE_COMMAND + token + '\0' + Paths.get(currentDirectory).toAbsolutePath().toString() + '\0' + String.join("\0", args)); + out.writeUTF(ACTIVATE_COMMAND + token + '\0' + Paths.get(currentDirectory).toAbsolutePath() + '\0' + String.join("\0", args)); out.flush(); socket.setSoTimeout(0); diff --git a/platform/platform-impl/src/com/intellij/idea/SplashManager.java b/platform/platform-impl/src/com/intellij/idea/SplashManager.java index 8dd3a7160f36..638ef6f4adcd 100644 --- a/platform/platform-impl/src/com/intellij/idea/SplashManager.java +++ b/platform/platform-impl/src/com/intellij/idea/SplashManager.java @@ -34,8 +34,12 @@ public final class SplashManager { public static void show(String @NotNull [] args, boolean visible) { for (String arg : args) { - if (CommandLineArgs.NO_SPLASH.equals(arg)) { - System.setProperty(CommandLineArgs.NO_SPLASH, "true"); + if (CommandLineArgs.SPLASH.equals(arg)) { + System.setProperty(CommandLineArgs.SPLASH, "true"); + return; + } + else if (CommandLineArgs.NO_SPLASH.equals(arg)) { + System.setProperty(CommandLineArgs.SPLASH, "false"); return; } } diff --git a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java index 9b7fbfd3eaba..248256fba599 100644 --- a/platform/platform-impl/src/com/intellij/idea/StartupUtil.java +++ b/platform/platform-impl/src/com/intellij/idea/StartupUtil.java @@ -398,6 +398,7 @@ public final class StartupUtil { System.setProperty("com.jetbrains.suppressWindowRaise", "true"); } + //noinspection SpellCheckingInspection EventQueue.invokeLater(() -> { try { // it is required even if headless because some tests creates configurable, so, our LaF is expected @@ -422,7 +423,13 @@ public final class StartupUtil { activity = activity.endAndStart("init JBUIScale"); JBUIScale.scale(1f); - if (!Main.isLightEdit() && !Boolean.getBoolean(CommandLineArgs.NO_SPLASH)) { + boolean showSplash = false; + // product specifies `slash` VM properties, `nosplash` is deprecated property, + // it should be checked first + if (!Boolean.getBoolean(CommandLineArgs.NO_SPLASH) && Boolean.getBoolean(CommandLineArgs.SPLASH)) { + showSplash = true; + } + if (showSplash && !Main.isLightEdit()) { Activity prepareSplashActivity = activity.endAndStart("splash preparation"); Activity prepareSplashQueueActivity = prepareSplashActivity.startChild("splash preparation (in queue)"); EventQueue.invokeLater(() -> { diff --git a/python/build/groovy/org/jetbrains/intellij/build/pycharm/PyCharmPropertiesBase.groovy b/python/build/groovy/org/jetbrains/intellij/build/pycharm/PyCharmPropertiesBase.groovy index f6e940c1cebb..be205d697d11 100644 --- a/python/build/groovy/org/jetbrains/intellij/build/pycharm/PyCharmPropertiesBase.groovy +++ b/python/build/groovy/org/jetbrains/intellij/build/pycharm/PyCharmPropertiesBase.groovy @@ -1,14 +1,10 @@ -// Copyright 2000-2020 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. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.intellij.build.pycharm import com.intellij.openapi.util.io.FileUtil import groovy.transform.CompileStatic import groovy.transform.TypeCheckingMode -import org.jetbrains.intellij.build.ApplicationInfoProperties -import org.jetbrains.intellij.build.BuildContext -import org.jetbrains.intellij.build.BuildTasks -import org.jetbrains.intellij.build.CompilationTasks -import org.jetbrains.intellij.build.JetBrainsProductProperties +import org.jetbrains.intellij.build.* import java.nio.file.FileVisitResult import java.nio.file.Files @@ -23,6 +19,7 @@ abstract class PyCharmPropertiesBase extends JetBrainsProductProperties { PyCharmPropertiesBase() { baseFileName = "pycharm" reassignAltClickToMultipleCarets = true + useSplash = true productLayout.mainJarName = "pycharm.jar" productLayout.additionalPlatformJars.putAll("testFramework.jar", "intellij.platform.testFramework.core",