Files
kotlin-fork/libraries/tools/kotlin-gradle-plugin/build.gradle
T
Ilya Chernikov a46dd5b30e Avoid using reflected types in the scripting API
since it causes numerous classloading issues. Using the wrapping types
and reload them in the proper context when needed.
Note: this version supports only classes, but the wrapping type could
be extended to support other types in the future.
+ numerous fixes related to proper loading and handling of the templates.
2018-05-28 22:10:56 +02:00

159 lines
5.0 KiB
Groovy

apply plugin: 'java'
apply plugin: 'java-gradle-plugin'
apply plugin: 'kotlin'
apply plugin: 'groovy'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'jps-compatible'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.9.13'
}
}
configureJvmProject(project)
configurePublishing(project)
repositories {
jcenter()
mavenLocal()
maven { url 'https://maven.google.com' }
}
configurations {
agp25CompileOnly
}
pill {
variant = "FULL"
}
dependencies {
compile project(':kotlin-gradle-plugin-api')
compileOnly project(':compiler')
compileOnly project(':compiler:incremental-compilation-impl')
compileOnly project(':compiler:daemon-common')
compile project(':kotlin-stdlib')
compileOnly project(':kotlin-reflect-api')
compileOnly project(':kotlin-android-extensions')
compileOnly project(':kotlin-build-common')
compileOnly project(':kotlin-compiler-runner')
compileOnly project(':kotlin-annotation-processing')
compileOnly project(':kotlin-annotation-processing-gradle')
compileOnly 'com.android.tools.build:gradle:2.0.0'
compileOnly 'org.codehaus.groovy:groovy-all:2.4.12'
compileOnly gradleApi()
compileOnly("kotlin.build.custom.deps:intellij-core:${rootProject.ext["versions.intellijSdk"]}") {
artifact {
name = 'intellij-core'
type = 'jar'
extension = 'jar'
}
}
compileOnly project(':kotlin-scripting-gradle')
runtime project(path: ':kotlin-compiler-embeddable', configuration: "runtimeJar")
runtime project(path: ':kotlin-annotation-processing-gradle', configuration: "runtimeJar")
runtime project(path: ':kotlin-android-extensions', configuration: 'runtimeJar')
runtime project(path: ':kotlin-compiler-runner', configuration: 'runtimeJar')
runtime project(':kotlin-reflect')
runtime project(':kotlin-scripting-common')
runtime project(':kotlin-scripting-compiler')
runtime project(path: ':kotlin-scripting-gradle', configuration: 'runtimeJar')
// com.android.tools.build:gradle has ~50 unneeded transitive dependencies
agp25CompileOnly('com.android.tools.build:gradle:3.0.0-alpha1') { transitive = false }
agp25CompileOnly('com.android.tools.build:gradle-core:3.0.0-alpha1') { transitive = false }
agp25CompileOnly('com.android.tools.build:builder-model:3.0.0-alpha1') { transitive = false }
agp25CompileOnly 'org.codehaus.groovy:groovy-all:2.4.12'
agp25CompileOnly gradleApi()
agp25CompileOnly project(':kotlin-annotation-processing')
agp25CompileOnly project(':kotlin-annotation-processing-gradle')
testCompileOnly project(':compiler')
testCompile project(path: ':kotlin-build-common', configuration: 'tests-jar')
testCompile project(':kotlin-android-extensions')
testCompile project(':kotlin-compiler-runner')
testCompile project(':kotlin-test::kotlin-test-junit')
testCompile "junit:junit:4.12"
testCompileOnly project(':kotlin-reflect-api')
testCompileOnly project(':kotlin-annotation-processing')
testCompileOnly project(':kotlin-annotation-processing-gradle')
}
tasks.withType(project.compileKotlin.class) {
kotlinOptions.jdkHome = JDK_18
}
compileKotlin.dependsOn compileGroovy
compileGroovy.dependsOn.remove("compileJava")
def groovyClassesDir = file("${buildDir}/mainGroovyClasses")
compileGroovy.destinationDir = groovyClassesDir
sourceSets.main.compileClasspath += files(groovyClassesDir)
compileGroovy.classpath = sourceSets.main.compileClasspath - files(groovyClassesDir)
sourceSets.main.java.srcDirs += sourceSets.main.kotlin.srcDirs
sourceSets {
agp25 {
compileClasspath += configurations.compile + configurations.agp25CompileOnly + sourceSets.main.output
compileClasspath += files(groovyClassesDir)
}
}
compileAgp25Kotlin.dependsOn compileGroovy
processResources {
expand(project.properties)
}
jar.dependsOn agp25Classes
jar {
from compileGroovy.destinationDir
from sourceSets.agp25.output.classesDirs
manifestAttributes(manifest, project)
}
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDepsToShadedCompiler(project, jar, {}), {})
artifacts {
archives sourcesJar
archives javadocJar
}
test.executable = "${JDK_18}/bin/java"
validateTaskProperties.failOnWarning = true
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'
}
}
}