Build: Add maven publication for Kotlin plugin artifacts

This commit is contained in:
Vyacheslav Gerasimov
2019-04-03 12:05:42 +03:00
parent c1cb6da436
commit 38ea5a85a3
15 changed files with 127 additions and 59 deletions
+34
View File
@@ -0,0 +1,34 @@
apply(plugin = "maven-publish")
configure<PublishingExtension> {
publications {
create<MavenPublication>("KotlinPlugin") {
val artifactName = if (project.name == "idea-plugin") "kotlin-plugin" else project.name
artifactId = "$artifactName-${IdeVersionConfigurator.currentIde.name.toLowerCase()}"
from(components["java"])
}
}
repositories {
maven {
url = uri(findProperty("deployRepoUrl") ?: findProperty("deploy-url") ?: "${rootProject.buildDir}/repo")
authentication {
val mavenUser = findProperty("kotlin.bintray.user") as String?
val mavenPass = findProperty("kotlin.bintray.password") as String?
if (url.scheme != "file" && mavenUser != null && mavenPass != null) {
credentials {
username = mavenUser
password = mavenPass
}
}
}
}
}
}
// Disable default `publish` task so publishing will not be done during maven artifact publish
// We should use specialized tasks since we have multiple publications in project
tasks.named("publish") {
enabled = false
dependsOn.clear()
}
+1
View File
@@ -109,6 +109,7 @@ dependencies {
compileOnly(intellijPluginDep("copyright"))
compileOnly(intellijPluginDep("properties"))
compileOnly(intellijPluginDep("java-i18n"))
compileOnly(intellijPluginDep("gradle"))
testCompileOnly(project(":kotlin-reflect-api")) // TODO: fix import (workaround for jps build)
testCompile(project(":kotlin-test:kotlin-test-junit"))
+4 -1
View File
@@ -8,7 +8,8 @@ plugins {
dependencies {
compile(kotlinStdlib())
compile(intellijPluginDep("gradle"))
compileOnly(intellijPluginDep("gradle"))
compileOnly(intellijDep()) { includeJars("slf4j-api-1.7.25") }
}
@@ -18,3 +19,5 @@ sourceSets {
}
runtimeJar()
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
@@ -40,3 +40,5 @@ testsJar()
projectTest(parallel = true) {
workingDir = rootDir
}
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
+12 -10
View File
@@ -7,19 +7,21 @@ plugins {
}
dependencies {
testRuntime(project(":kotlin-reflect"))
compile(project(":kotlin-allopen-compiler-plugin"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:cli-common"))
compile(project(":idea"))
compile(project(":idea:idea-jvm"))
compile(project(":idea:idea-jps-common"))
compile(project(":plugins:annotation-based-compiler-plugins-ide-support"))
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:frontend"))
compileOnly(project(":compiler:cli-common"))
compileOnly(project(":idea"))
compileOnly(project(":idea:idea-jvm"))
compileOnly(project(":idea:idea-jps-common"))
compileOnly(project(":plugins:annotation-based-compiler-plugins-ide-support"))
compileOnly(intellijDep())
excludeInAndroidStudio(rootProject) { compileOnly(intellijPluginDep("maven")) }
compileOnly(intellijPluginDep("gradle"))
testRuntime(project(":kotlin-reflect"))
testCompileOnly(project(":kotlin-serialization"))
testCompileOnly(project(":plugins:lint"))
testCompileOnly(project(":plugins:kapt3-idea"))
@@ -56,6 +58,6 @@ sourceSets {
runtimeJar()
projectTest(parallel = true) {
projectTest(parallel = true)
}
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
@@ -12,11 +12,11 @@ val androidExtensionsRuntimeForTests by configurations.creating
dependencies {
testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compile(project(":compiler:util"))
compile(project(":compiler:plugin-api"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:backend"))
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:plugin-api"))
compileOnly(project(":compiler:frontend"))
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":compiler:backend"))
compileOnly(project(":kotlin-android-extensions-runtime"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("asm-all", rootProject = rootProject) }
@@ -61,3 +61,5 @@ projectTest {
systemProperty("robolectric.classpath", robolectricClasspath.asPath)
}
}
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
@@ -7,15 +7,16 @@ plugins {
}
dependencies {
compile(project(":plugins:android-extensions-compiler"))
testRuntime(intellijDep())
compile(project(":compiler:util"))
compile(project(":compiler:light-classes"))
compile(project(":idea:idea-core"))
compile(project(":idea"))
compile(project(":idea:idea-jvm"))
compile(project(":idea:idea-gradle"))
compile(project(":plugins:android-extensions-compiler"))
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:light-classes"))
compileOnly(project(":idea:idea-core"))
compileOnly(project(":idea"))
compileOnly(project(":idea:idea-jvm"))
compileOnly(project(":idea:idea-gradle"))
compileOnly(project(":kotlin-android-extensions-runtime"))
compileOnly(intellijPluginDep("android"))
compileOnly(intellijPluginDep("Groovy"))
@@ -85,3 +86,5 @@ projectTest(parallel = true) {
}
runtimeJar()
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
+8 -5
View File
@@ -6,11 +6,12 @@ plugins {
dependencies {
compile(kotlinStdlib())
compile(project(":compiler:frontend"))
compile(project(":idea")) { isTransitive = false }
compile(project(":idea:kotlin-gradle-tooling"))
compile(project(":idea:idea-core"))
compile(project(":idea:idea-gradle"))
compileOnly(project(":compiler:frontend"))
compileOnly(project(":idea")) { isTransitive = false }
compileOnly(project(":idea:kotlin-gradle-tooling"))
compileOnly(project(":idea:idea-core"))
compileOnly(project(":idea:idea-gradle"))
compileOnly(intellijDep())
Platform[192].orHigher {
compileOnly(intellijPluginDep("java"))
@@ -25,3 +26,5 @@ sourceSets {
}
runtimeJar()
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
@@ -8,12 +8,12 @@ plugins {
dependencies {
compileOnly(intellijCoreDep()) { includeJars("intellij-core", "asm-all", rootProject = rootProject) }
compile(project(":compiler:plugin-api"))
compile(project(":compiler:frontend"))
compile(project(":compiler:backend"))
compile(project(":compiler:ir.backend.common"))
compile(project(":js:js.frontend"))
compile(project(":js:js.translator"))
compileOnly(project(":compiler:plugin-api"))
compileOnly(project(":compiler:frontend"))
compileOnly(project(":compiler:backend"))
compileOnly(project(":compiler:ir.backend.common"))
compileOnly(project(":js:js.frontend"))
compileOnly(project(":js:js.translator"))
runtime(kotlinStdlib())
@@ -41,3 +41,5 @@ testsJar()
projectTest(parallel = true) {
workingDir = rootDir
}
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
@@ -7,6 +7,8 @@ plugins {
}
dependencies {
compileOnly(project(":js:js.translator"))
compile(project(":kotlinx-serialization-compiler-plugin"))
compile(project(":idea"))
compile(project(":idea:idea-gradle"))
+2
View File
@@ -42,3 +42,5 @@ testsJar()
projectTest(parallel = true) {
workingDir = rootDir
}
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
+13 -11
View File
@@ -7,20 +7,22 @@ plugins {
}
dependencies {
testRuntime(project(":kotlin-reflect"))
compile(project(":kotlin-noarg-compiler-plugin"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:backend"))
compile(project(":compiler:cli-common"))
compile(project(":idea"))
compile(project(":idea:idea-jps-common"))
compile(project(":plugins:annotation-based-compiler-plugins-ide-support"))
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:frontend"))
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":compiler:backend"))
compileOnly(project(":compiler:cli-common"))
compileOnly(project(":idea"))
compileOnly(project(":idea:idea-jps-common"))
compileOnly(project(":plugins:annotation-based-compiler-plugins-ide-support"))
compileOnly(intellijDep())
excludeInAndroidStudio(rootProject) { compileOnly(intellijPluginDep("maven")) }
compileOnly(intellijPluginDep("gradle"))
testRuntime(project(":kotlin-reflect"))
testCompileOnly(project(":kotlin-serialization"))
testCompileOnly(project(":plugins:lint"))
testCompileOnly(project(":plugins:kapt3-idea"))
@@ -57,6 +59,6 @@ sourceSets {
runtimeJar()
projectTest(parallel = true) {
projectTest(parallel = true)
}
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
@@ -8,21 +8,22 @@ plugins {
dependencies {
compile(project(":kotlin-sam-with-receiver-compiler-plugin"))
compile(project(":plugins:annotation-based-compiler-plugins-ide-support"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":idea:idea-core"))
compileOnly(project(":plugins:annotation-based-compiler-plugins-ide-support"))
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:frontend"))
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":idea:idea-core"))
Ide.IJ183 {
compile(project(":idea:idea-android"))
compileOnly(project(":idea:idea-android"))
}
compile(project(":idea"))
compile(project(":idea:idea-jvm"))
compileOnly(project(":idea"))
compileOnly(project(":idea:idea-jvm"))
compileOnly(intellijDep()) { includeJars("openapi", "extensions", "util") }
compileOnly(intellijDep()) { includeJars("platform-api") }
compileOnly(intellijDep()) { includeJars("platform-api", "openapi", "extensions", "util") }
compileOnly(intellijDep("gradle"))
}
sourceSets {
@@ -31,3 +32,5 @@ sourceSets {
}
runtimeJar()
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
@@ -11,6 +11,7 @@ dependencies {
compileOnly(project(":idea:idea-gradle"))
compileOnly(project(":idea:idea-core"))
compileOnly(intellijDep())
compileOnly(intellijDep("gradle"))
}
sourceSets {
+10 -4
View File
@@ -3,7 +3,7 @@ import java.util.regex.Pattern.quote
description = "Kotlin IDEA plugin"
plugins {
`java-base`
java
}
repositories {
@@ -116,6 +116,7 @@ val gradleToolingModel by configurations.creating
val libraries by configurations.creating {
extendsFrom(gradleToolingModel)
exclude("org.jetbrains.intellij.deps", "trove4j") // Idea already has trove4j
}
val jpsPlugin by configurations.creating
@@ -124,8 +125,6 @@ configurations.all {
resolutionStrategy {
preferProjectModules()
}
exclude("org.jetbrains.intellij.deps", "trove4j") // Idea already has trove4j
}
dependencies {
@@ -154,11 +153,16 @@ dependencies {
gradleToolingModel(project(":allopen-ide-plugin")) { isTransitive = false }
jpsPlugin(project(":kotlin-jps-plugin")) { isTransitive = false }
(libraries.dependencies + gradleToolingModel.dependencies)
.map { if (it is ProjectDependency) it.dependencyProject else it }
.forEach(::compile)
}
val jar = runtimeJar {
from("$rootDir/resources/kotlinManifest.properties")
archiveName = "kotlin-plugin.jar"
archiveFileName.set("kotlin-plugin.jar")
}.get() // make it eager to avoid corresponding refactorings in the kotlin-ultimate part for now
val ideaPluginDir: File by rootProject.extra
@@ -178,3 +182,5 @@ tasks.register<Sync>("ideaPlugin") {
rename(quote("-$version"), "")
rename(quote("-$bootstrapKotlinVersion"), "")
}
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")