diff --git a/openide/src/ru/openide/OpenIdePluginBundler.kt b/openide/src/ru/openide/OpenIdePluginBundler.kt index b061bba35df7..08f3271416ea 100644 --- a/openide/src/ru/openide/OpenIdePluginBundler.kt +++ b/openide/src/ru/openide/OpenIdePluginBundler.kt @@ -27,10 +27,11 @@ object OpenIdePluginBundler { private const val DOWNLOADABLE_PLUGINS_DIR = "build/download/plugins" private const val PLUGINS_DOWNLOAD_URL = "https://plugins.openide.ru/pluginManager" + private const val PLUGIN_DOWNLOAD_BY_VERSION_URL = "https://plugins.openide.ru/plugin/download" private val plugins = listOf( PluginInfo("com.haulmont.intellij.rupack", "ru_pack"), - PluginInfo("com.haulmont.amplicode", "amplicode"), + PluginInfo("com.haulmont.amplicode", "amplicode", version = "2025.3.2-261"), PluginInfo("ru.openide.pro.updater", "updater") ) @@ -49,20 +50,27 @@ object OpenIdePluginBundler { } private suspend fun bundlePluginFromMarketplace(context: BuildContext, pluginInfo: PluginInfo) { - val parameters = hashMapOf( - "id" to pluginInfo.pluginId, - "build" to context.fullBuildNumber - ) + val url = if (pluginInfo.version != null) { + Urls.newFromEncoded(PLUGIN_DOWNLOAD_BY_VERSION_URL) + .addParameters(hashMapOf( + "pluginId" to pluginInfo.pluginId, + "version" to pluginInfo.version + )) + } + else { + Urls.newFromEncoded(PLUGINS_DOWNLOAD_URL) + .addParameters(hashMapOf( + "id" to pluginInfo.pluginId, + "build" to context.fullBuildNumber + )) + } - val uri = Urls.newFromEncoded(PLUGINS_DOWNLOAD_URL) - .addParameters(parameters) - .toExternalForm() - .let(URI::create) + val uri = url.toExternalForm().let(URI::create) val archivePath = BuildDependenciesDownloader.downloadFileToCacheLocation(COMMUNITY_ROOT, uri) val targetDir = context.paths.communityHomeDir.resolve("$DOWNLOADABLE_PLUGINS_DIR/${pluginInfo.folderName}") BuildDependenciesDownloader.extractFile(archivePath, targetDir, COMMUNITY_ROOT, BuildDependenciesExtractOptions.STRIP_ROOT) } - private class PluginInfo(val pluginId: String, val folderName: String) + private class PluginInfo(val pluginId: String, val folderName: String, val version: String? = null) } \ No newline at end of file