Files
kotlin-fork/libraries/examples/kotlin-gradle-subplugin-example/build.gradle
T
Alexander Likhachev 03f9d78eb3 [Build] Add workaround to make local publishing serializable
Also signing plugin now being applied only when signing is required.
#KT-44611 In Progress
2021-04-23 03:52:41 +03:00

66 lines
2.0 KiB
Groovy

apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'jps-compatible'
repositories {
mavenLocal()
mavenCentral()
}
pill {
variant = 'FULL'
}
dependencies {
compile project(':kotlin-gradle-plugin-api')
// Use this dependency instead when building apart from the other modules:
// compile "org.jetbrains.kotlin:kotlin-gradle-plugin-api:$kotlin_version"
compile project(':kotlin-test::kotlin-test-junit')
compileOnly kotlinStdlib()
compileOnly project(':compiler')
compileOnly project(':compiler:plugin-api')
compileOnly project(':compiler:cli-common')
compileOnly project(':compiler:cli')
compileOnly gradleApi()
compileOnly("kotlin.build:intellij-core:${rootProject.ext["versions.intellijSdk"]}") {
artifact {
name = 'intellij-core'
type = 'jar'
extension = 'jar'
}
}
}
// Relocate `com.intellij.*` and some other classes to match those in the `kotlin-compiler-embeddable`
// (for example, the actual package at runtime is `org.jetbrains.kotlin.com.intellij.*`):
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
// In a standalone build, you can setup the relocation with the Shadow plugin.
publishing {
publications {
main(MavenPublication) {
artifact tasks.named("embeddable")
}
}
}
tasks.register("install") {
dependsOn(tasks.named("publishToMavenLocal"))
}
// workaround for Gradle configuration cache
// TODO: remove it when https://github.com/gradle/gradle/pull/16945 merged into used in build Gradle version
tasks.withType(PublishToMavenLocal) {
def originalTask = it
def serializablePublishTask =
tasks.register(originalTask.name + "Serializable", PublishToMavenLocalSerializable) {
publication = originalTask.publication
}
originalTask.onlyIf { false }
originalTask.dependsOn(serializablePublishTask)
}