mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
cleanup
GitOrigin-RevId: abf0c22754f06c325024f969a5d3c6e68c6fd5af
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a29ac8baf7
commit
53d0dbe426
@@ -1352,25 +1352,14 @@ suspend fun createIdeClassPath(platform: PlatformLayout, context: BuildContext):
|
||||
return classPath
|
||||
}
|
||||
|
||||
suspend fun buildSearchableOptions(
|
||||
context: BuildContext,
|
||||
systemProperties: Map<String, String> = emptyMap(),
|
||||
): Path? {
|
||||
return buildSearchableOptions(
|
||||
productRunner = IntellijProductRunner.createRunner(context),
|
||||
context = context,
|
||||
systemProperties = systemProperties,
|
||||
)
|
||||
suspend fun buildSearchableOptions(context: BuildContext, systemProperties: Map<String, String> = emptyMap()): Path? {
|
||||
return buildSearchableOptions(productRunner = IntellijProductRunner.createRunner(context), context = context, systemProperties = systemProperties)
|
||||
}
|
||||
|
||||
/**
|
||||
* Build index which is used to search options in the Settings dialog.
|
||||
*/
|
||||
private suspend fun buildSearchableOptions(
|
||||
productRunner: IntellijProductRunner,
|
||||
context: BuildContext,
|
||||
systemProperties: Map<String, String> = emptyMap(),
|
||||
): Path? {
|
||||
private suspend fun buildSearchableOptions(productRunner: IntellijProductRunner, context: BuildContext, systemProperties: Map<String, String> = emptyMap()): Path? {
|
||||
val span = Span.current()
|
||||
if (context.isStepSkipped(BuildOptions.SEARCHABLE_OPTIONS_INDEX_STEP)) {
|
||||
span.addEvent("skip building searchable options index")
|
||||
@@ -1401,14 +1390,13 @@ private suspend fun buildSearchableOptions(
|
||||
}
|
||||
val modules = withContext(Dispatchers.IO) {
|
||||
coroutineScope {
|
||||
locales.forEach { locale: SearchableOptionLocalization ->
|
||||
for (locale in locales) {
|
||||
launch {
|
||||
// Start the product in headless mode using com.intellij.ide.ui.search.TraverseUIStarter.
|
||||
// It'll process all UI elements in the `Settings` dialog and build an index for them.
|
||||
productRunner.runProduct(
|
||||
arguments = listOf("traverseUI", targetDirectory.toString(), "true"),
|
||||
additionalSystemProperties = systemProperties +
|
||||
locale.systemProperties,
|
||||
additionalSystemProperties = systemProperties + locale.systemProperties,
|
||||
isLongRunning = true,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -273,13 +273,6 @@ class JarPackager private constructor(
|
||||
val patchedDirs = moduleOutputPatcher.getPatchedDir(moduleName)
|
||||
val patchedContent = moduleOutputPatcher.getPatchedContent(moduleName)
|
||||
|
||||
val searchableOptionsJarDir = if (jarsWithSearchableOptions.contains(item.relativeOutputFile)) {
|
||||
context.paths.searchableOptionDir.resolve(item.relativeOutputFile)
|
||||
}
|
||||
else {
|
||||
null
|
||||
}
|
||||
|
||||
val module = context.findRequiredModule(moduleName)
|
||||
val moduleOutDir = context.getModuleOutputDir(module)
|
||||
val extraExcludes = layout?.moduleExcludes?.get(moduleName) ?: emptyList()
|
||||
@@ -319,8 +312,8 @@ class JarPackager private constructor(
|
||||
moduleSources.add(DirSource(dir = dir))
|
||||
}
|
||||
|
||||
if (searchableOptionsJarDir != null) {
|
||||
moduleSources.add(DirSource(dir = searchableOptionsJarDir))
|
||||
if (jarsWithSearchableOptions.contains(item.relativeOutputFile)) {
|
||||
moduleSources.add(DirSource(dir = context.paths.searchableOptionDir.resolve(item.relativeOutputFile)))
|
||||
}
|
||||
|
||||
val excludes = if (extraExcludes.isEmpty()) {
|
||||
|
||||
@@ -42,11 +42,7 @@ private class DevBuildProductRunner(
|
||||
private val homePath: Path,
|
||||
private val classPath: Collection<Path>,
|
||||
) : IntellijProductRunner {
|
||||
override suspend fun runProduct(
|
||||
arguments: List<String>,
|
||||
additionalSystemProperties: Map<String, String>,
|
||||
isLongRunning: Boolean,
|
||||
) {
|
||||
override suspend fun runProduct(arguments: List<String>, additionalSystemProperties: Map<String, String>, isLongRunning: Boolean) {
|
||||
runApplicationStarter(
|
||||
context = context,
|
||||
ideClasspath = classPath.map { it.toString() },
|
||||
|
||||
@@ -8,8 +8,7 @@ import org.jetbrains.intellij.build.BuildContext
|
||||
* This can be used to obtain some resources and include them in the distribution.
|
||||
*/
|
||||
internal interface IntellijProductRunner {
|
||||
suspend fun runProduct(arguments: List<String>, additionalSystemProperties: Map<String, String> = emptyMap(),
|
||||
isLongRunning: Boolean = false)
|
||||
suspend fun runProduct(arguments: List<String>, additionalSystemProperties: Map<String, String> = emptyMap(), isLongRunning: Boolean = false)
|
||||
|
||||
companion object {
|
||||
suspend fun createRunner(context: BuildContext): IntellijProductRunner {
|
||||
|
||||
@@ -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.ide.ui.search;
|
||||
|
||||
import com.intellij.application.options.OptionsContainingConfigurable;
|
||||
@@ -43,13 +43,13 @@ import java.util.*;
|
||||
|
||||
/**
|
||||
* Used in installer's "build searchable options" step.
|
||||
*
|
||||
* In order to run locally, use "TraverseUi" run configuration (pass corresponding "idea.platform.prefix" property via VM options,
|
||||
* <p>
|
||||
* To run locally, use "TraverseUi" run configuration (pass corresponding "idea.platform.prefix" property via VM options,
|
||||
* and choose correct main module).
|
||||
*
|
||||
* <p>
|
||||
* Pass {@code true} as the second parameter to have searchable options split by modules.
|
||||
*/
|
||||
@SuppressWarnings({"CallToPrintStackTrace", "UseOfSystemOutOrSystemErr"})
|
||||
@SuppressWarnings("UseOfSystemOutOrSystemErr")
|
||||
public final class TraverseUIStarter implements ApplicationStarter {
|
||||
private static final @NonNls String OPTIONS = "options";
|
||||
private static final @NonNls String CONFIGURABLE = "configurable";
|
||||
@@ -302,8 +302,7 @@ public final class TraverseUIStarter implements ApplicationStarter {
|
||||
return map;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Map<String, PluginId> getActionToPluginId() {
|
||||
private static @NotNull Map<String, PluginId> getActionToPluginId() {
|
||||
ActionManagerEx actionManager = ActionManagerEx.getInstanceEx();
|
||||
Map<String, PluginId> actionToPluginId = new HashMap<>();
|
||||
for (PluginId id : PluginId.getRegisteredIds()) {
|
||||
@@ -314,13 +313,12 @@ public final class TraverseUIStarter implements ApplicationStarter {
|
||||
return actionToPluginId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String getModuleByAction(@NotNull final AnAction rootAction, @NotNull final Map<String, PluginId> actionToPluginId) {
|
||||
final Deque<AnAction> actions = new ArrayDeque<>();
|
||||
private static @NotNull String getModuleByAction(final @NotNull AnAction rootAction, @NotNull Map<String, PluginId> actionToPluginId) {
|
||||
Deque<AnAction> actions = new ArrayDeque<>();
|
||||
actions.add(rootAction);
|
||||
while (!actions.isEmpty()) {
|
||||
final AnAction action = actions.remove();
|
||||
final String module = getModuleByClass(action.getClass());
|
||||
AnAction action = actions.remove();
|
||||
String module = getModuleByClass(action.getClass());
|
||||
if (!ROOT_ACTION_MODULE.equals(module)) {
|
||||
return module;
|
||||
}
|
||||
@@ -328,10 +326,11 @@ public final class TraverseUIStarter implements ApplicationStarter {
|
||||
Collections.addAll(actions, ((ActionGroup)action).getChildren(null));
|
||||
}
|
||||
}
|
||||
final ActionManager actionManager = ActionManager.getInstance();
|
||||
final PluginId id = actionToPluginId.get(actionManager.getId(rootAction));
|
||||
|
||||
ActionManager actionManager = ActionManager.getInstance();
|
||||
PluginId id = actionToPluginId.get(actionManager.getId(rootAction));
|
||||
if (id != null) {
|
||||
final IdeaPluginDescriptor plugin = PluginManagerCore.getPlugin(id);
|
||||
IdeaPluginDescriptor plugin = PluginManagerCore.getPlugin(id);
|
||||
if (plugin != null && !plugin.getName().equals(PluginManagerCore.SPECIAL_IDEA_PLUGIN_ID.getIdString())) {
|
||||
return PathUtil.getFileName(plugin.getPluginPath().toString());
|
||||
}
|
||||
@@ -339,8 +338,7 @@ public final class TraverseUIStarter implements ApplicationStarter {
|
||||
return ROOT_ACTION_MODULE;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String getModuleByClass(@NotNull final Class<?> aClass) {
|
||||
private static @NotNull String getModuleByClass(final @NotNull Class<?> aClass) {
|
||||
return PathUtil.getFileName(PathUtil.getJarPathForClass(aClass));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user