mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[devkit] update from sources action: allow to build enabled non-bundled plugins only
"Build disabled and non-bundled plugins" option is replaced by "Build enabled plugins only". If the option is enabled, the scripts will build only those bundled and non-bundled plugins which are enabled in the current IDE instance greatly reducing build time. GitOrigin-RevId: 779777318ed254242f8d41b44666ccc885bd97b2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fec8e2b00f
commit
5d8355dd05
@@ -138,6 +138,15 @@ class BuildOptions {
|
||||
*/
|
||||
List<String> bundledPluginDirectoriesToSkip = System.getProperty("intellij.build.bundled.plugin.dirs.to.skip", "").split(",") as List<String>
|
||||
|
||||
/**
|
||||
* Specifies list of names of directories of non-bundled plugins (determined by {@link ProductModulesLayout#pluginsToPublish} and
|
||||
* {@link ProductModulesLayout#buildAllCompatiblePlugins}) which should be actually built. This option can be used to speed up updating
|
||||
* the IDE from sources. By default all plugins determined by {@link ProductModulesLayout#pluginsToPublish} and
|
||||
* {@link ProductModulesLayout#buildAllCompatiblePlugins} are built. In order to skip building all non-bundled plugins, set the property to
|
||||
* {@code none}.
|
||||
*/
|
||||
List<String> nonBundledPluginDirectoriesToInclude = System.getProperty("intellij.build.non.bundled.plugin.dirs.to.include", "").split(",") as List<String>
|
||||
|
||||
/**
|
||||
* Specifies JRE version to be bundled with distributions, 11 by default.
|
||||
*/
|
||||
|
||||
+8
-1
@@ -48,7 +48,7 @@ class DistributionJARsBuilder {
|
||||
LinkedHashSet<PluginLayout> pluginsToPublish = []) {
|
||||
this.patchedApplicationInfo = patchedApplicationInfo
|
||||
this.buildContext = buildContext
|
||||
this.pluginsToPublish = pluginsToPublish
|
||||
this.pluginsToPublish = filterPluginsToPublish(pluginsToPublish)
|
||||
buildContext.ant.patternset(id: RESOURCES_INCLUDED) {
|
||||
include(name: "**/*Bundle*.properties")
|
||||
include(name: "**/*Messages.properties")
|
||||
@@ -198,6 +198,13 @@ class DistributionJARsBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
LinkedHashSet<PluginLayout> filterPluginsToPublish(LinkedHashSet<PluginLayout> plugins) {
|
||||
def toInclude = buildContext.options.nonBundledPluginDirectoriesToInclude as Set<String>
|
||||
if (toInclude.isEmpty()) return plugins
|
||||
if (toInclude.size() == 1 && toInclude.contains("none")) return new LinkedHashSet<PluginLayout>()
|
||||
return plugins.findAll { toInclude.contains(it.directoryName) }
|
||||
}
|
||||
|
||||
private static Set<String> getLibsToRemoveVersion() {
|
||||
return ["Trove4j", "Log4J", "jna", "jetbrains-annotations-java5", "JDOM"].toSet()
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class UpdateFromSourcesDialog(private val project: Project,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor())
|
||||
}
|
||||
row {
|
||||
checkBox("Build disabled and non-bundled plugins", state::buildDisabledPlugins)
|
||||
checkBox("Build enabled plugins only", { !state.buildDisabledPlugins }, { state.buildDisabledPlugins = !it })
|
||||
}
|
||||
row {
|
||||
checkBox("Do not show this dialog again", { !state.showSettings }, { state.showSettings = !it },
|
||||
|
||||
+24
-10
@@ -75,23 +75,30 @@ internal open class UpdateIdeFromSourcesAction
|
||||
return error("The build scripts is out-of-date, please update to the latest 'master' sources.")
|
||||
}
|
||||
|
||||
val bundledPluginDirsToSkip: List<String> = if (state.buildDisabledPlugins) {
|
||||
emptyList()
|
||||
}
|
||||
else {
|
||||
val bundledPluginDirsToSkip: List<String>
|
||||
val nonBundledPluginDirsToInclude: List<String>
|
||||
val buildEnabledPluginsOnly = !state.buildDisabledPlugins
|
||||
if (buildEnabledPluginsOnly) {
|
||||
val pluginDirectoriesToSkip = LinkedHashSet(state.pluginDirectoriesForDisabledPlugins)
|
||||
pluginDirectoriesToSkip.removeAll(PluginManagerCore.getLoadedPlugins().asSequence().filter { it.isBundled }.map { it.path }.filter { it.isDirectory }.map { it.name })
|
||||
PluginManagerCore.getPlugins().filter { it.isBundled && !it.isEnabled }.map { it.path }.filter { it.isDirectory }.mapTo(pluginDirectoriesToSkip) { it.name }
|
||||
val list = pluginDirectoriesToSkip.toMutableList()
|
||||
state.pluginDirectoriesForDisabledPlugins = list
|
||||
list
|
||||
bundledPluginDirsToSkip = list
|
||||
nonBundledPluginDirsToInclude = PluginManagerCore.getPlugins().filter {
|
||||
!it.isBundled && it.isEnabled && it.version != null && it.version.contains("SNAPSHOT")
|
||||
}.map { it.path }.filter { it.isDirectory }.map { it.name }
|
||||
}
|
||||
else {
|
||||
bundledPluginDirsToSkip = emptyList()
|
||||
nonBundledPluginDirsToInclude = emptyList()
|
||||
}
|
||||
|
||||
val deployDir = "$devIdeaHome/out/deploy"
|
||||
val distRelativePath = "dist"
|
||||
val backupDir = "$devIdeaHome/out/backup-before-update-from-sources"
|
||||
val params = createScriptJavaParameters(devIdeaHome, project, deployDir, distRelativePath, scriptFile,
|
||||
bundledPluginDirsToSkip, state.buildDisabledPlugins) ?: return
|
||||
buildEnabledPluginsOnly, bundledPluginDirsToSkip, nonBundledPluginDirsToInclude) ?: return
|
||||
ProjectTaskManager.getInstance(project)
|
||||
.buildAllModules()
|
||||
.onSuccess {
|
||||
@@ -268,8 +275,9 @@ internal open class UpdateIdeFromSourcesAction
|
||||
deployDir: String,
|
||||
@Suppress("SameParameterValue") distRelativePath: String,
|
||||
scriptFile: File,
|
||||
buildEnabledPluginsOnly: Boolean,
|
||||
bundledPluginDirsToSkip: List<String>,
|
||||
buildNonBundledPlugins: Boolean): JavaParameters? {
|
||||
nonBundledPluginDirsToInclude: List<String>): JavaParameters? {
|
||||
val sdk = ProjectRootManager.getInstance(project).projectSdk
|
||||
if (sdk == null) {
|
||||
LOG.warn("Project SDK is not defined")
|
||||
@@ -310,10 +318,16 @@ internal open class UpdateIdeFromSourcesAction
|
||||
params.programParametersList.add("update-from-sources")
|
||||
params.vmParametersList.add("-D$includeBinAndRuntimeProperty=true")
|
||||
params.vmParametersList.add("-Dintellij.build.bundled.jre.prefix=jbrsdk-")
|
||||
if (bundledPluginDirsToSkip.isNotEmpty()) {
|
||||
params.vmParametersList.add("-Dintellij.build.bundled.plugin.dirs.to.skip=${bundledPluginDirsToSkip.joinToString(",")}")
|
||||
|
||||
if (buildEnabledPluginsOnly) {
|
||||
if (bundledPluginDirsToSkip.isNotEmpty()) {
|
||||
params.vmParametersList.add("-Dintellij.build.bundled.plugin.dirs.to.skip=${bundledPluginDirsToSkip.joinToString(",")}")
|
||||
}
|
||||
val nonBundled = if (nonBundledPluginDirsToInclude.isNotEmpty()) nonBundledPluginDirsToInclude.joinToString(",") else "none"
|
||||
params.vmParametersList.add("-Dintellij.build.non.bundled.plugin.dirs.to.include=$nonBundled")
|
||||
}
|
||||
if (buildNonBundledPlugins) {
|
||||
|
||||
if (!buildEnabledPluginsOnly || nonBundledPluginDirsToInclude.isNotEmpty()) {
|
||||
params.vmParametersList.add("-Dintellij.build.local.plugins.repository=true")
|
||||
}
|
||||
params.vmParametersList.add("-Dintellij.build.output.root=$deployDir")
|
||||
|
||||
Reference in New Issue
Block a user