forked from JetBrains/kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload_plugins.gradle
34 lines (32 loc) · 1000 Bytes
/
upload_plugins.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
buildscript {
repositories {
mavenCentral()
maven {
url('https://dl.bintray.com/jetbrains/plugin-repository-rest-client/')
}
}
dependencies {
classpath 'org.jetbrains.intellij:plugin-repository-rest-client:0.1.15'
}
}
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)
new File(path).eachFileMatch(~/kotlin-plugin-.*\.zip/) { file ->
println("Uploading ${file.name}")
repo.uploadPlugin(6954, file, channel)
}
}
defaultTasks 'uploadPlugins'