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 ->
|
||||
project.configure(project) {
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'signing'
|
||||
|
||||
if (!project.hasProperty('prebuiltJar')) {
|
||||
apply plugin: 'signing'
|
||||
|
||||
signing {
|
||||
required { (project.properties["signingRequired"] ?: project.isSonatypeRelease) }
|
||||
sign configurations.archives
|
||||
}
|
||||
signing {
|
||||
required { (project.properties["signingRequired"] ?: project.isSonatypeRelease) }
|
||||
sign configurations.archives
|
||||
}
|
||||
|
||||
signArchives {
|
||||
enabled signing.required
|
||||
signArchives {
|
||||
enabled signing.required
|
||||
}
|
||||
}
|
||||
|
||||
task dist(type: Copy, dependsOn: assemble) {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,4 +33,17 @@ compileKotlin.dependsOn preprocessSources
|
||||
|
||||
jar {
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,4 +89,25 @@ test.executable = "${JDK_18}/bin/java"
|
||||
dokka {
|
||||
outputFormat = 'markdown'
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,4 +39,17 @@ compileKotlin.dependsOn preprocessSources
|
||||
|
||||
jar {
|
||||
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