Advertisement
SDL2

import gradle.package from Kotlin

Jul 8th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 1.44 KB | None | 0 0
  1. import org.jetbrains.intellij.pluginRepository.PluginRepositoryInstance
  2.  
  3. buildscript {
  4.     repositories {
  5.         mavenCentral()
  6.         maven("https://dl.bintray.com/jetbrains/intellij-plugin-service")
  7.     }
  8.  
  9.     dependencies {
  10.         classpath("org.jetbrains.intellij:plugin-repository-rest-client:0.4.32")
  11.     }
  12. }
  13.  
  14. task("uploadPlugins") {
  15.     doLast {
  16.         val kotlinPluginId = 6954
  17.         val channel = (project.findProperty("plugins.repository.channel") as String?)
  18.             ?.let { if (it == "_default_") null else it }
  19.         val path = project.findProperty("plugins.path") as String? ?: "."
  20.         val token = project.property("plugins.repository.token") as String
  21.  
  22.         val repo = PluginRepositoryInstance("https://plugins.jetbrains.com/", token)
  23.  
  24.         val pluginFiles = File(path)
  25.             .listFiles { _, fileName ->
  26.                 fileName.toLowerCase().let {
  27.                     it.startsWith("kotlin-plugin") &&
  28.                             it.endsWith(".zip") &&
  29.                             // don't publish CIDR plugins to IDEA channel
  30.                             !it.contains("clion") &&
  31.                             !it.contains("appcode")
  32.                 }
  33.             }
  34.  
  35.         pluginFiles
  36.             ?.sorted()
  37.             ?.forEach { pluginFile ->
  38.                 println("Uploading ${pluginFile.name}")
  39.                 repo.uploadPlugin(kotlinPluginId, pluginFile, channel)
  40.             }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement