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:
@@ -83,16 +83,18 @@ task preparePublication {
|
|||||||
ext.configurePublishing = { Project project ->
|
ext.configurePublishing = { Project project ->
|
||||||
project.configure(project) {
|
project.configure(project) {
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'signing'
|
|
||||||
|
|
||||||
|
if (!project.hasProperty('prebuiltJar')) {
|
||||||
|
apply plugin: 'signing'
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
required { (project.properties["signingRequired"] ?: project.isSonatypeRelease) }
|
required { (project.properties["signingRequired"] ?: project.isSonatypeRelease) }
|
||||||
sign configurations.archives
|
sign configurations.archives
|
||||||
}
|
}
|
||||||
|
|
||||||
signArchives {
|
signArchives {
|
||||||
enabled signing.required
|
enabled signing.required
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task dist(type: Copy, dependsOn: assemble) {
|
task dist(type: Copy, dependsOn: assemble) {
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ buildscript {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url 'https://plugins.gradle.org/m2/' }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_gradle_plugin_version}"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_gradle_plugin_version}"
|
||||||
|
classpath "com.gradle.publish:plugin-publish-plugin:0.9.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,3 +48,39 @@ task clean {
|
|||||||
delete "${buildDir}/repo"
|
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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,3 +34,16 @@ compileKotlin.dependsOn preprocessSources
|
|||||||
jar {
|
jar {
|
||||||
from(targetSrc) { include("META-INF/**") }
|
from(targetSrc) { include("META-INF/**") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pluginBundle {
|
||||||
|
plugins {
|
||||||
|
kotlinAllopenPlugin {
|
||||||
|
id = 'org.jetbrains.kotlin.plugin.allopen'
|
||||||
|
description = displayName = 'Kotlin All Open compiler plugin'
|
||||||
|
}
|
||||||
|
kotlinSpringPlugin {
|
||||||
|
id = 'org.jetbrains.kotlin.plugin.spring'
|
||||||
|
description = displayName = 'Kotlin Spring compiler plugin'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -90,3 +90,24 @@ dokka {
|
|||||||
outputFormat = 'markdown'
|
outputFormat = 'markdown'
|
||||||
includes = ["${projectDir}/Module.md"]
|
includes = ["${projectDir}/Module.md"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pluginBundle {
|
||||||
|
plugins {
|
||||||
|
kotlinJvmPlugin {
|
||||||
|
id = 'org.jetbrains.kotlin.jvm'
|
||||||
|
description = displayName = 'Kotlin JVM plugin'
|
||||||
|
}
|
||||||
|
kotlinAndroidPlugin {
|
||||||
|
id = 'org.jetbrains.kotlin.android'
|
||||||
|
description = displayName = 'Kotlin Android plugin'
|
||||||
|
}
|
||||||
|
kotlinAndroidExtensionsPlugin {
|
||||||
|
id = 'org.jetbrains.kotlin.android.extensions'
|
||||||
|
description = displayName = 'Kotlin Android Extensions plugin'
|
||||||
|
}
|
||||||
|
kotlinKaptPlugin {
|
||||||
|
id = 'org.jetbrains.kotlin.kapt'
|
||||||
|
description = displayName = 'Kotlin Kapt plugin'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,3 +40,16 @@ compileKotlin.dependsOn preprocessSources
|
|||||||
jar {
|
jar {
|
||||||
from(targetSrc) { include("META-INF/**") }
|
from(targetSrc) { include("META-INF/**") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pluginBundle {
|
||||||
|
plugins {
|
||||||
|
kotlinNoargPlugin {
|
||||||
|
id = 'org.jetbrains.kotlin.plugin.noarg'
|
||||||
|
description = displayName = 'Kotlin No Arg compiler plugin'
|
||||||
|
}
|
||||||
|
kotlinJpaPlugin {
|
||||||
|
id = 'org.jetbrains.kotlin.plugin.jpa'
|
||||||
|
description = displayName = 'Kotlin JPA compiler plugin'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user