diff --git a/build/bundled-plugins/ru_pack/lib/intellij-ru-pack-0.0.1.jar b/build/bundled-plugins/ru_pack/lib/intellij-ru-pack-0.0.1.jar deleted file mode 100644 index f4deee418c28..000000000000 Binary files a/build/bundled-plugins/ru_pack/lib/intellij-ru-pack-0.0.1.jar and /dev/null differ diff --git a/openide/src/ru/openide/OpenIdePluginBundler.kt b/openide/src/ru/openide/OpenIdePluginBundler.kt index 1306a1dafec3..8894fda3da81 100644 --- a/openide/src/ru/openide/OpenIdePluginBundler.kt +++ b/openide/src/ru/openide/OpenIdePluginBundler.kt @@ -27,28 +27,29 @@ import java.nio.file.Path object OpenIdePluginBundler { 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" + private val plugins = listOf( + PluginInfo("Lombook Plugin", "lombok"), + PluginInfo("com.haulmont.intellij.rupack", "ru_pack") + ) + fun getBundlePluginPaths(context: BuildContext): List { val communityHomeDir = context.paths.communityHomeDir - return listOf( - Path.of("${communityHomeDir}/$DOWNLOADABLE_PLUGINS_DIR/amplicode"), - Path.of("${communityHomeDir}/$DOWNLOADABLE_PLUGINS_DIR/lombok"), - Path.of("${communityHomeDir}/$PHYSICAL_PLUGINS_DIR/ru_pack") - ) + return plugins.map { Path.of("${communityHomeDir}/$DOWNLOADABLE_PLUGINS_DIR/${it.folderName}") } + + listOf(Path.of("${communityHomeDir}/$DOWNLOADABLE_PLUGINS_DIR/amplicode")) } fun bundlePlugins(context: BuildContext) { - bundleLombokPluginFromMarketplace(context) + plugins.forEach { bundlePluginFromMarketplace(context, it) } bundleAmplicodePlugin(context) } - private fun bundleLombokPluginFromMarketplace(context: BuildContext) { + private fun bundlePluginFromMarketplace(context: BuildContext, pluginInfo: PluginInfo) { val parameters = hashMapOf( - "id" to "Lombook Plugin", + "id" to pluginInfo.pluginId, "build" to context.fullBuildNumber ) @@ -58,7 +59,7 @@ object OpenIdePluginBundler { .let(URI::create) val archivePath = BuildDependenciesDownloader.downloadFileToCacheLocation(COMMUNITY_ROOT, uri) - val targetDir = context.paths.communityHomeDir.resolve("$DOWNLOADABLE_PLUGINS_DIR/lombok") + val targetDir = context.paths.communityHomeDir.resolve("$DOWNLOADABLE_PLUGINS_DIR/${pluginInfo.folderName}") BuildDependenciesDownloader.extractFile(archivePath, targetDir, COMMUNITY_ROOT, BuildDependenciesExtractOptions.STRIP_ROOT) } @@ -94,4 +95,6 @@ object OpenIdePluginBundler { val match = regex.find(this) return match?.groupValues?.get(1) } + + private class PluginInfo(val pluginId: String, val folderName: String) } \ No newline at end of file