Add Gradle Plugin Portal publication to the buildscripts

Add option to disable signing (-PnoSign), to be used when publishing
pre-built artifacts

Add option to define specific version for publishing, to be used when
publishing test versions

(cherry picked from commit dcd55e9)
This commit is contained in:
Sergey Igushkin
2017-06-13 15:49:45 +03:00
parent 4497874f31
commit a4be282074
5 changed files with 94 additions and 7 deletions
+38
View File
@@ -4,9 +4,11 @@ buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_gradle_plugin_version}"
classpath "com.gradle.publish:plugin-publish-plugin:0.9.7"
}
}
@@ -45,4 +47,40 @@ task clean {
doLast {
delete "${buildDir}/repo"
}
}
configure([project(':kotlin-gradle-plugin'), project(':kotlin-allopen'), project(':kotlin-noarg')]) { project ->
apply plugin: 'com.gradle.plugin-publish'
if (project.hasProperty('publishPluginsVersion')) {
configurations.archives.artifacts.all {
version = project.getProperty('publishPluginsVersion')
}
}
if (project.hasProperty("${project.name}-jar")) {
println("Using pre-built artifact for ${project.name}")
configurations.archives.artifacts.clear()
artifacts {
archives(file(project.getProperty("${project.name}-jar"))) {
name project.name
}
}
}
publishPlugins.doFirst {
assert !kotlin_version.contains('SNAPSHOT')
}
pluginBundle {
website = 'https://kotlinlang.org/'
vcsUrl = 'https://github.com/JetBrains/kotlin/'
description = 'Kotlin plugins for Gradle'
tags = ['kotlin']
mavenCoordinates {
groupId = "org.jetbrains.kotlin"
}
}
}