diff --git a/build/src/OpenSourceCommunityInstallersBuildTarget.kt b/build/src/OpenSourceCommunityInstallersBuildTarget.kt
index 8ebd99b6fa6d..00362bbbf218 100644
--- a/build/src/OpenSourceCommunityInstallersBuildTarget.kt
+++ b/build/src/OpenSourceCommunityInstallersBuildTarget.kt
@@ -45,7 +45,7 @@ object OpenSourceCommunityInstallersBuildTarget {
runBlocking(Dispatchers.Default) {
val options = OPTIONS.copy(buildStepsToSkip = OPTIONS.buildStepsToSkip + BUILD_STEPS_DISABLED_FOR_GITHUB_ACTIONS)
val context = createCommunityBuildContext(options)
- OpenIdePluginBundler.bundleAmplicodePlugin(context)
+ OpenIdePluginBundler.bundlePlugins(context)
context.compileModules(moduleNames = null, includingTestsInModules = listOf("intellij.platform.jps.build.tests"))
buildDistributions(context)
spanBuilder("build standalone JPS").use {
diff --git a/openide/openide.iml b/openide/openide.iml
index 671c9ac2247e..b88c7309130b 100644
--- a/openide/openide.iml
+++ b/openide/openide.iml
@@ -13,5 +13,6 @@
+
\ No newline at end of file
diff --git a/openide/src/ru/openide/OpenIdePluginBundler.kt b/openide/src/ru/openide/OpenIdePluginBundler.kt
index c0cbb75966aa..1306a1dafec3 100644
--- a/openide/src/ru/openide/OpenIdePluginBundler.kt
+++ b/openide/src/ru/openide/OpenIdePluginBundler.kt
@@ -14,6 +14,7 @@
package ru.openide
import com.intellij.openapi.util.JDOMUtil
+import com.intellij.util.Urls
import com.intellij.util.io.HttpRequests
import org.jdom.Element
import org.jetbrains.intellij.build.BuildContext
@@ -25,20 +26,48 @@ import java.nio.file.Path
object OpenIdePluginBundler {
- private const val PLUGINS_DIR = "build/download/plugins"
+ private const val DOWNLOADABLE_PLUGINS_DIR = "build/download/plugins"
+ private const val PHYSICAL_PLUGINS_DIR = "build/bundled-plugins"
private const val AMPLICODE_URL = "https://amplicode.ru"
private const val AMPLICODE_MARKETPLACE_URL = "https://amplicode.ru/jetbrains-marketplace"
+ private const val PLUGINS_DOWNLOAD_URL = "https://plugins.openide.ru/pluginManager"
fun getBundlePluginPaths(context: BuildContext): List {
val communityHomeDir = context.paths.communityHomeDir
- return listOf(Path.of("${communityHomeDir}/$PLUGINS_DIR/amplicode"))
+ return listOf(
+ Path.of("${communityHomeDir}/$DOWNLOADABLE_PLUGINS_DIR/amplicode"),
+ Path.of("${communityHomeDir}/$DOWNLOADABLE_PLUGINS_DIR/lombok"),
+ Path.of("${communityHomeDir}/$PHYSICAL_PLUGINS_DIR/ru_pack")
+ )
}
- fun bundleAmplicodePlugin(context: BuildContext) {
+ fun bundlePlugins(context: BuildContext) {
+ bundleLombokPluginFromMarketplace(context)
+ bundleAmplicodePlugin(context)
+ }
+
+ private fun bundleLombokPluginFromMarketplace(context: BuildContext) {
+ val parameters = hashMapOf(
+ "id" to "Lombook Plugin",
+ "build" to context.fullBuildNumber
+ )
+
+ val uri = Urls.newFromEncoded(PLUGINS_DOWNLOAD_URL)
+ .addParameters(parameters)
+ .toExternalForm()
+ .let(URI::create)
+
+ val archivePath = BuildDependenciesDownloader.downloadFileToCacheLocation(COMMUNITY_ROOT, uri)
+ val targetDir = context.paths.communityHomeDir.resolve("$DOWNLOADABLE_PLUGINS_DIR/lombok")
+ BuildDependenciesDownloader.extractFile(archivePath, targetDir, COMMUNITY_ROOT, BuildDependenciesExtractOptions.STRIP_ROOT)
+ }
+
+ // TODO: download amplicode from marketplace like lombok plugin
+ private fun bundleAmplicodePlugin(context: BuildContext) {
val majorVersion = context.buildNumber.substringBefore('.')
val uri = resolveAmplicodeUri(majorVersion)
val archivePath = BuildDependenciesDownloader.downloadFileToCacheLocation(COMMUNITY_ROOT, uri)
- val targetDir = context.paths.communityHomeDir.resolve("$PLUGINS_DIR/amplicode")
+ val targetDir = context.paths.communityHomeDir.resolve("$DOWNLOADABLE_PLUGINS_DIR/amplicode")
BuildDependenciesDownloader.extractFile(archivePath, targetDir, COMMUNITY_ROOT, BuildDependenciesExtractOptions.STRIP_ROOT)
}