From 394031a1830d23261b3f0622988432759d0600af Mon Sep 17 00:00:00 2001 From: Vyacheslav Gerasimov Date: Tue, 2 Apr 2019 22:46:54 +0300 Subject: [PATCH] Build: Fix upload_plugins.gradle broken after migration to gradle 5.0 `<< {` syntax is removed since gradle 5.0 --- upload_plugins.gradle | 62 ++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/upload_plugins.gradle b/upload_plugins.gradle index f9af1095a59..7e5e2e1503a 100644 --- a/upload_plugins.gradle +++ b/upload_plugins.gradle @@ -10,39 +10,41 @@ buildscript { } } -task uploadPlugins() << { - def env = System.getenv() - def username = env['PLUGIN_REPOSITORY_USER'] - def password = env['PLUGIN_REPOSITORY_PASSWORD'] - def channel = env['PLUGIN_REPOSITORY_CHANNEL'] - if (channel == "_default_") { - channel = null - } - def path = env['PLUGIN_UPLOAD_PATH'] - if (path == null) { - path = "." - } - def repo = new org.jetbrains.intellij.pluginRepository.PluginRepositoryInstance( - "https://plugins.jetbrains.com/", - username, password) - - File[] files = new File(path).listFiles({ _, String filename -> - if (!filename.startsWith("kotlin-plugin") || !filename.endsWith(".zip")) false - else { - // don't publish CIDR plugins to IDEA channel - def filenameLowerCase = filename.toLowerCase() - if (filenameLowerCase.contains("clion") || filenameLowerCase.contains("appcode")) false - else true +task uploadPlugins { + doLast { + def env = System.getenv() + def username = env['PLUGIN_REPOSITORY_USER'] + def password = env['PLUGIN_REPOSITORY_PASSWORD'] + def channel = env['PLUGIN_REPOSITORY_CHANNEL'] + if (channel == "_default_") { + channel = null } - } as FilenameFilter) + def path = env['PLUGIN_UPLOAD_PATH'] + if (path == null) { + path = "." + } + def repo = new org.jetbrains.intellij.pluginRepository.PluginRepositoryInstance( + "https://plugins.jetbrains.com/", + username, password) - files = files.sort { f1, f2 -> - f1.name.contains("1.1.2-5") ? 1 : (f2.name.contains("1.1.2-5") ? -1 : (f1.name <=> f2.name)) - } + File[] files = new File(path).listFiles({ _, String filename -> + if (!filename.startsWith("kotlin-plugin") || !filename.endsWith(".zip")) false + else { + // don't publish CIDR plugins to IDEA channel + def filenameLowerCase = filename.toLowerCase() + if (filenameLowerCase.contains("clion") || filenameLowerCase.contains("appcode")) false + else true + } + } as FilenameFilter) - files.each { file -> - println("Uploading ${file.name}") - repo.uploadPlugin(6954, file, channel) + files = files.sort { f1, f2 -> + f1.name.contains("1.1.2-5") ? 1 : (f2.name.contains("1.1.2-5") ? -1 : (f1.name <=> f2.name)) + } + + files.each { file -> + println("Uploading ${file.name}") + repo.uploadPlugin(6954, file, channel) + } } }