use pluginAuto for rest of Community plugins

GitOrigin-RevId: d7d2e762fb10d5971d70f71c7271620326621f32
This commit is contained in:
Vladimir Krivosheev
2024-04-09 15:37:40 +00:00
committed by intellij-monorepo-bot
parent a710fe7b9d
commit 83655b4ba3
3 changed files with 28 additions and 48 deletions
@@ -57,13 +57,13 @@ object CommunityRepositoryModules {
spec.withModule("intellij.java.guiForms.jps", "jps/java-guiForms-jps.jar")
},
KotlinPluginBuilder.kotlinPlugin(KotlinPluginBuilder.KotlinUltimateSources.WITH_COMMUNITY_MODULES),
plugin("intellij.vcs.git") { spec ->
pluginAuto(listOf("intellij.vcs.git")) { spec ->
spec.withModule("intellij.vcs.git.rt", "git4idea-rt.jar")
},
plugin("intellij.xpath") { spec ->
pluginAuto(listOf("intellij.xpath")) { spec ->
spec.withModule("intellij.xpath.rt", "rt/xslt-rt.jar")
},
plugin("intellij.platform.langInjection") { spec ->
pluginAuto(listOf("intellij.platform.langInjection")) { spec ->
spec.withModule("intellij.java.langInjection", "IntelliLang.jar")
spec.withModule("intellij.xml.langInjection", "IntelliLang.jar")
spec.withModule("intellij.java.langInjection.jps")
@@ -77,7 +77,7 @@ object CommunityRepositoryModules {
spec.withProjectLibrary("XmlRPC")
spec.withProjectLibrary("jsonpath")
},
plugin("intellij.xslt.debugger") { spec ->
pluginAuto(listOf("intellij.xslt.debugger")) { spec ->
spec.withModule("intellij.xslt.debugger.rt", "xslt-debugger-rt.jar")
spec.withModule("intellij.xslt.debugger.impl.rt", "rt/xslt-debugger-impl-rt.jar")
spec.withModuleLibrary("Saxon-6.5.5", "intellij.xslt.debugger.impl.rt", "rt/saxon.jar")
@@ -131,7 +131,7 @@ object CommunityRepositoryModules {
copyDir(mavenDist, targetLib.resolve("maven3"))
}
},
plugin(listOf(
pluginAuto(listOf(
"intellij.gradle",
"intellij.gradle.common",
"intellij.gradle.toolingProxy",
@@ -171,22 +171,10 @@ object CommunityRepositoryModules {
spec.withProjectLibrary("TestNG")
},
pluginAuto(listOf("intellij.dev", "intellij.platform.statistics.devkit")),
plugin("intellij.devkit") { spec ->
spec.withModule("intellij.devkit.core")
spec.withModule("intellij.devkit.git")
spec.withModule("intellij.devkit.themes")
spec.withModule("intellij.devkit.gradle")
spec.withModule("intellij.devkit.i18n")
spec.withModule("intellij.devkit.images")
spec.withModule("intellij.devkit.intelliLang")
spec.withModule("intellij.devkit.uiDesigner")
spec.withModule("intellij.devkit.workspaceModel")
spec.withModule("intellij.kotlin.devkit")
pluginAuto(listOf("intellij.devkit")) { spec ->
spec.withModule("intellij.devkit.jps")
spec.withModule("intellij.devkit.runtimeModuleRepository.jps")
spec.withProjectLibrary("workspace-model-codegen")
spec.bundlingRestrictions.includeInDistribution = PluginDistribution.NOT_FOR_PUBLIC_BUILDS
},
pluginAuto(listOf("intellij.eclipse")) { spec ->
@@ -209,19 +197,19 @@ object CommunityRepositoryModules {
spec.withModule("intellij.terminal.sh")
spec.withResource("resources/shell-integrations", "shell-integrations")
},
plugin("intellij.emojipicker") { spec ->
pluginAuto("intellij.emojipicker") { spec ->
spec.bundlingRestrictions.supportedOs = persistentListOf(OsFamily.LINUX)
},
plugin("intellij.textmate") { spec ->
pluginAuto("intellij.textmate") { spec ->
spec.withModule("intellij.textmate.core")
spec.withResource("lib/bundles", "lib/bundles")
},
PythonCommunityPluginModules.pythonCommunityPluginLayout(),
androidDesignPlugin(),
plugin("intellij.completionMlRankingModels") { spec ->
pluginAuto(listOf("intellij.completionMlRankingModels")) { spec ->
spec.bundlingRestrictions.includeInDistribution = PluginDistribution.NOT_FOR_RELEASE
},
plugin("intellij.statsCollector") { spec ->
pluginAuto(listOf("intellij.statsCollector")) { spec ->
spec.bundlingRestrictions.includeInDistribution = PluginDistribution.NOT_FOR_RELEASE
},
pluginAuto(listOf("intellij.lombok", "intellij.lombok.generated")),
@@ -241,16 +229,16 @@ object CommunityRepositoryModules {
))
val CONTRIB_REPOSITORY_PLUGINS: List<PluginLayout> = java.util.List.of(
plugin("intellij.errorProne") { spec ->
pluginAuto("intellij.errorProne") { spec ->
spec.withModule("intellij.errorProne.jps", "jps/errorProne-jps.jar")
},
plugin("intellij.cucumber.java") { spec ->
pluginAuto("intellij.cucumber.java") { spec ->
spec.withModule("intellij.cucumber.jvmFormatter", "cucumber-jvmFormatter.jar")
spec.withModule("intellij.cucumber.jvmFormatter3", "cucumber-jvmFormatter3.jar")
spec.withModule("intellij.cucumber.jvmFormatter4", "cucumber-jvmFormatter4.jar")
spec.withModule("intellij.cucumber.jvmFormatter5", "cucumber-jvmFormatter5.jar")
},
plugin("intellij.serial.monitor") { spec ->
pluginAuto("intellij.serial.monitor") { spec ->
spec.withProjectLibrary("io.github.java.native.jssc", LibraryPackMode.STANDALONE_SEPARATE)
},
)
@@ -766,9 +754,6 @@ object CommunityRepositoryModules {
}
}
@JvmStatic
@JvmOverloads
fun groovyPlugin(additionalModules: List<String> = emptyList(), addition: ((PluginLayout.PluginLayoutSpec) -> Unit)? = null): PluginLayout {
return plugin("intellij.groovy") { spec ->
spec.directoryName = "Groovy"
@@ -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 org.jetbrains.intellij.build
import kotlinx.collections.immutable.PersistentList
@@ -10,7 +10,7 @@ import java.util.Objects
*
* @see org.jetbrains.intellij.build.impl.PluginLayout.PluginLayoutSpec#getBundlingRestrictions()
*/
class PluginBundlingRestrictions private constructor(
class PluginBundlingRestrictions(
/**
* Change this value if the plugin works on some OS only and therefore don't need to be bundled with distributions for other OS.
*/
@@ -113,11 +113,14 @@ class PluginLayout private constructor(
return layout
}
@JvmStatic
fun plugin(moduleNames: List<String>, body: (SimplePluginLayoutSpec) -> Unit): PluginLayout {
val layout = PluginLayout(mainModule = moduleNames.first())
fun pluginAuto(moduleName: String, body: (SimplePluginLayoutSpec) -> Unit): PluginLayout = pluginAuto(listOf(moduleName), body)
fun pluginAuto(moduleNames: List<String>, body: (SimplePluginLayoutSpec) -> Unit): PluginLayout {
val layout = PluginLayout(mainModule = moduleNames.first(), auto = true)
layout.withModules(moduleNames)
body(SimplePluginLayoutSpec(layout))
val spec = SimplePluginLayoutSpec(layout)
body(spec)
layout.bundlingRestrictions = spec.bundlingRestrictions.build()
return layout
}
@@ -137,13 +140,6 @@ class PluginLayout private constructor(
return layout
}
fun pluginAuto(moduleNames: List<String>, body: (SimplePluginLayoutSpec) -> Unit): PluginLayout {
val layout = PluginLayout(mainModule = moduleNames.first(), auto = true)
layout.withModules(moduleNames)
body(SimplePluginLayoutSpec(layout))
return layout
}
fun plugin(mainModule: String): PluginLayout {
val layout = PluginLayout(mainModule = mainModule)
layout.withModule(mainModule)
@@ -167,6 +163,11 @@ class PluginLayout private constructor(
}
sealed class PluginLayoutBuilder(@JvmField protected val layout: PluginLayout) : BaseLayoutSpec(layout) {
/**
* Returns [PluginBundlingRestrictions] instance which can be used to exclude the plugin from some distributions.
*/
val bundlingRestrictions: PluginBundlingRestrictions.Builder = PluginBundlingRestrictions.Builder()
/**
* @param resourcePath path to resource file or directory relative to the plugin's main module content root
* @param relativeOutputPath target path relative to the plugin root directory
@@ -194,8 +195,7 @@ class PluginLayout private constructor(
}
}
@Experimental
class SimplePluginLayoutSpec(layout: PluginLayout) : PluginLayoutBuilder(layout)
class SimplePluginLayoutSpec internal constructor(layout: PluginLayout) : PluginLayoutBuilder(layout)
// as a builder for PluginLayout, that ideally should be immutable
class PluginLayoutSpec(layout: PluginLayout) : PluginLayoutBuilder(layout) {
@@ -216,11 +216,6 @@ class PluginLayout private constructor(
val mainModule
get() = layout.mainModule
/**
* Returns [PluginBundlingRestrictions] instance which can be used to exclude the plugin from some distributions.
*/
val bundlingRestrictions: PluginBundlingRestrictions.Builder = PluginBundlingRestrictions.Builder()
var mainJarName: String
get() = layout.mainJarName
/**