mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
OPENIDE #182 Add localization plugin to OpenIDE Marketplace
(cherry picked from commitc555ed1b5e) (cherry picked from commit28cdf1e698)
This commit is contained in:
Binary file not shown.
@@ -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<Path> {
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user